EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: sigsev while creating new gdd in multiple threads
From: Dirk Zimoch <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Tue, 23 Jun 2009 09:59:34 +0200
Hi Bruno,

From what I can see in the macro definition of gdd_NEWDEL_NEW(gdd) in gddNewDel.h, the gddScalar::new() operator is not fully thread safe. Initialization of the freelist is not protected. Thus, calling gdd*::new() for the first time in two different threads may crash. Maybe using gdd*::new() the first time while still in single threaded context may cure the problem.

Dirk


Bruno Coudoin wrote:
Hi,

Tonight I found something odd. I am perhaps doing something wrong but
after several test the results were consistant.

I have a multithreaded application, at startup each thread creates
several gdd. It ends up frequently in the following SIGSEGV:
  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0x98a35b90 (LWP 1020)]
  0x00f2b2b8 in gdd::operator new (size=44) at ../gdd.cc:26
  26      gdd_NEWDEL_NEW(gdd)

My code to create the gdd is as simple as:
  gdd *pDD;
  pDD = new gddScalar ( gddAppType_value, aitEnumInt32 );

It seems like my program crashes at startup but if it passed the first
gdd creation of each threads, it becomes stable after that. More threads
I have, more chance I have to see the crash.

My configuration:
Epics 3.14.10
CentOS 5.3
Multi core processor.

Has anybody ever seen this issue? I'll try to dig further tomorrow, if
someone has ideas on workarounds or tests to do to refine the issue,
your welcome.

Bruno.




--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182

Replies:
RE: sigsev while creating new gdd in multiple threads Jeff Hill
References:
sigsev while creating new gdd in multiple threads Bruno Coudoin

Navigate by Date:
Prev: sigsev while creating new gdd in multiple threads Bruno Coudoin
Next: EPICS 3.13 - 3.14 compatibility McLay,SA (Stewart) (ROE,UKATC)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: sigsev while creating new gdd in multiple threads Bruno Coudoin
Next: RE: sigsev while creating new gdd in multiple threads Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·