SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by jim brow » Wed, 05 Mar 2003 07:43:09



Complete error message and backtrace is below

I'm porting a working program from Linux 8.0 and have a case where
propagating an exception that is covered by a try {} catch{}
a couple of levels up the stack leads to the mentioned SIGSEGV.
This is on RedHat Linux 7.2 on IBM zSeries.

I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
works correctly.

Any ideas? Might this be the compiler?

Jim
____________________________________________________________________
Program received signal SIGSEGV, Segmentation fault.
0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
99      mutex.c: No such file or directory.
         in mutex.c
Current language:  auto; currently c
(gdb) backtrace
#0  0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
#1  0x402da138 in __libc_free (mem=0x410) at malloc.c:3152
#2  0x00410d46 in __builtin_vec_delete (ptr=0x410) at
../../gcc/cp/new2.cc:62
#3  0x00416a36 in SmException::~SmException (this=0x7ffff988,
__in_chrg=2) at src/cpp/SmException_c.h:65
#4  0x0040e19e in main (argc=1, argv=0x7ffffad4) at src/sample/sample.cpp:21

 
 
 

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by Steve Wa » Wed, 05 Mar 2003 09:08:19




Quote:>Complete error message and backtrace is below

>I'm porting a working program from Linux 8.0 and have a case where
>propagating an exception that is covered by a try {} catch{}
>a couple of levels up the stack leads to the mentioned SIGSEGV.
>This is on RedHat Linux 7.2 on IBM zSeries.

>I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
>works correctly.

>Any ideas? Might this be the compiler?

Actually, it's a pretty fair bet that it's your application trashing
memory somewhere that it shouldn't be.  Try one of the memory error
catchers (ElectricFence, dmalloc, Insure++, whatever) that supports
your thread environment.
--
Steve Watt KD6GGD  PP-ASEL-IA          ICBM: 121W 56' 57.8" / 37N 20' 14.9"

   Free time?  There's no such thing.  It just comes in varying prices...

 
 
 

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by Joshua Jone » Wed, 05 Mar 2003 13:36:33



Quote:

> I'm porting a working program from Linux 8.0 and have a case where
> propagating an exception that is covered by a try {} catch{}
> a couple of levels up the stack leads to the mentioned SIGSEGV.
> This is on RedHat Linux 7.2 on IBM zSeries.

> I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
> works correctly.

> Any ideas? Might this be the compiler?

This is almost certainly a problem in YOUR program... the fact that
your app worked on some platforms does not mean it is correct; it
only means that those environments failed to expose the error.
Can you post some code?

--
 josh(at)cc.gatech.edu  |  http://intmain.net:800

 443443 local keystrokes since last reboot (41 days ago)

 
 
 

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by Santhosh Kudv » Wed, 05 Mar 2003 21:52:48



Quote:> Complete error message and backtrace is below

> I'm porting a working program from Linux 8.0 and have a case where
> propagating an exception that is covered by a try {} catch{}
> a couple of levels up the stack leads to the mentioned SIGSEGV.
> This is on RedHat Linux 7.2 on IBM zSeries.

> I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
> works correctly.

> Any ideas? Might this be the compiler?

> Jim
> ____________________________________________________________________
> Program received signal SIGSEGV, Segmentation fault.
> 0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
> 99      mutex.c: No such file or directory.
>          in mutex.c
> Current language:  auto; currently c
> (gdb) backtrace
> #0  0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
> #1  0x402da138 in __libc_free (mem=0x410) at malloc.c:3152
> #2  0x00410d46 in __builtin_vec_delete (ptr=0x410) at
> ../../gcc/cp/new2.cc:62
> #3  0x00416a36 in SmException::~SmException (this=0x7ffff988,
> __in_chrg=2) at src/cpp/SmException_c.h:65
> #4  0x0040e19e in main (argc=1, argv=0x7ffffad4) at

src/sample/sample.cpp:21

Do check if all your mutex's are initialized, some Compilers are more
forgiving than others.
And posting some code which reproduces the problem might prove to be more
useful.

HTH

Cheers
santhosh

 
 
 

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by jim brow » Wed, 05 Mar 2003 22:37:18


Thanks for the advice. I've tried for a week to produce a simple
test case and all the simpler attempts work correctly.
It sounds like upgrading to gcc 2.97 is not the right action.
I'll look at all the mutex code again and if I can find the
solution, I'll post here.

Thanks again.




>>Complete error message and backtrace is below

>>I'm porting a working program from Linux 8.0 and have a case where
>>propagating an exception that is covered by a try {} catch{}
>>a couple of levels up the stack leads to the mentioned SIGSEGV.
>>This is on RedHat Linux 7.2 on IBM zSeries.

>>I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
>>works correctly.

>>Any ideas? Might this be the compiler?

>>Jim
>>____________________________________________________________________
>>Program received signal SIGSEGV, Segmentation fault.
>>0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
>>99      mutex.c: No such file or directory.
>>         in mutex.c
>>Current language:  auto; currently c
>>(gdb) backtrace
>>#0  0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
>>#1  0x402da138 in __libc_free (mem=0x410) at malloc.c:3152
>>#2  0x00410d46 in __builtin_vec_delete (ptr=0x410) at
>>../../gcc/cp/new2.cc:62
>>#3  0x00416a36 in SmException::~SmException (this=0x7ffff988,
>>__in_chrg=2) at src/cpp/SmException_c.h:65
>>#4  0x0040e19e in main (argc=1, argv=0x7ffffad4) at

> src/sample/sample.cpp:21

> Do check if all your mutex's are initialized, some Compilers are more
> forgiving than others.
> And posting some code which reproduces the problem might prove to be more
> useful.

> HTH

> Cheers
> santhosh

 
 
 

SIGSEGV in pthread_mutex_lock in RedHat 7.2 gcc 2.95.3

Post by jim brow » Fri, 07 Mar 2003 00:53:20


Thanks to all for the help. I looked at the code that initializes my
mutex and it was fine -- but it was in the constructor of a global class
in a shared library. Apparently constructors in global classes in
shared libraries are not executed when the library is loaded.
Shameful.

No clue how I'll fix it (we have global classes throughout our product)
but at least I know what's going on.

Thanks again
Jim


> Thanks for the advice. I've tried for a week to produce a simple
> test case and all the simpler attempts work correctly.
> It sounds like upgrading to gcc 2.97 is not the right action.
> I'll look at all the mutex code again and if I can find the
> solution, I'll post here.

> Thanks again.




>>> Complete error message and backtrace is below

>>> I'm porting a working program from Linux 8.0 and have a case where
>>> propagating an exception that is covered by a try {} catch{}
>>> a couple of levels up the stack leads to the mentioned SIGSEGV.
>>> This is on RedHat Linux 7.2 on IBM zSeries.

>>> I also have RedHat Linux 7.2 on Intel with gcc 2.96 and this
>>> works correctly.

>>> Any ideas? Might this be the compiler?

>>> Jim
>>> ____________________________________________________________________
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
>>> 99      mutex.c: No such file or directory.
>>>         in mutex.c
>>> Current language:  auto; currently c
>>> (gdb) backtrace
>>> #0  0x403eb2d6 in __pthread_mutex_lock (mutex=0x410) at mutex.c:99
>>> #1  0x402da138 in __libc_free (mem=0x410) at malloc.c:3152
>>> #2  0x00410d46 in __builtin_vec_delete (ptr=0x410) at
>>> ../../gcc/cp/new2.cc:62
>>> #3  0x00416a36 in SmException::~SmException (this=0x7ffff988,
>>> __in_chrg=2) at src/cpp/SmException_c.h:65
>>> #4  0x0040e19e in main (argc=1, argv=0x7ffffad4) at

>> src/sample/sample.cpp:21

>> Do check if all your mutex's are initialized, some Compilers are more
>> forgiving than others.
>> And posting some code which reproduces the problem might prove to be more
>> useful.

>> HTH

>> Cheers
>> santhosh

 
 
 

1. Problem building gcc 2.95.2 on RedHat 7.2

I'm having a problem getting gcc 2.95.2 built on
RedHat 7.2. Here's what I did:

1) Did a clean install of RH 7.2, including the
   "Software Development", "Kernel Development",
   and "Legacy Application Support" options in
   the install.

2) Ran up2date on my system

3) Make sure that the compat-XXXX rpm's were
   installed.

4) Downloaded gcc-2.95.2.tar.gz

5) Created a separate directory for the
   build, ran configure in that directory,
   and started the build. I get an error
   building indstream.cc in libio.

From looking at the error, there apparently
was a change in /usr/include/_G_config.h between
gcc 2.95.2 and gcc 2.96 (installed with RH 7.2).
Clearly this is causing the error, but there
are more than this. I had tried fixing indstream.cc
to match the new header files and this fixed this
particular problem, but other compile problems
popped up later.

I have tried looking for gcc 2.95.2 rpm's, but
all of the ones I found on www.rpmfind.net were
not actually gcc 2.95.2 (even though they were
labelled as such), but rather gcc 2.95.3.

Has anyone been able to successfully build gcc 2.95.2
on an out-of-the-box install of RH 7.2? If so, how
did you do it?

Also, the compat-XXX rpm's install header files
which seem to be compatible with gcc 2.95.2. If I
could simply tell configure to use these header
files instead of the ones in /usr/include, then
this would probably work as well - any idea how
to do that?

Thanks,

Eric

2. Compressed File System

3. Errors compiling Wingz 1.4 Add-ins (Linux 1.3.99, GCC 2.6)

4. Need advice on commercial spreadsheets

5. configuring gcc-2.7.2.x on redhat 7.2

6. problem with DFE-530TX

7. New HOWTO....HOWTO-Hose-RedHat-Installation (help!)

8. PF/NAT questions

9. Upgrade gcc 2.96-98 to gcc 3.2-7 on Redhat 7.2

10. In search of Solaris 2.5 Netscape Navigator 3.0 plug ins

11. Need HELP to Log User Log-ins form the internet

12. Suse 7.0; Yast2, kinternet, rc.dialout und ich komme nicht ins Internet

13. Netscape plug-ins on AIX 4