crashes from pthread_mutex_lock ()

crashes from pthread_mutex_lock ()

Post by cc » Sat, 07 Dec 2002 23:59:42



Hi there,
    my program crashes on pthread_mutex_lock () call sometimes.
#0  0x40021df0 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x0806fa36 in cybmutex::lock() (this=0x7c347c24) at cybmutex.cpp:28
#2  0x08051f24 in Log::log(int, char*, ...) (this=0x7c347c20,
level=808591401,
    format=0x32313230 <Address 0x32313230 out of bounds>) at Log.cpp:176
#3  0x7c337c20 in ?? ()
Cannot access memory at address 0x7c327c20

Anyone have idea? I'm using g++ 3.2,  glibc 2.2.5-42, redhat 7.1, kernal
2.4.18. I compiled the program with -D_REENTRANT -D_POSIX_C_SOURCE=199506L.

 
 
 

crashes from pthread_mutex_lock ()

Post by Jirka Kosin » Sun, 08 Dec 2002 00:58:09



>     my program crashes on pthread_mutex_lock () call sometimes.
> #0  0x40021df0 in pthread_mutex_lock () from /lib/libpthread.so.0
> #1  0x0806fa36 in cybmutex::lock() (this=0x7c347c24) at cybmutex.cpp:28
> #2  0x08051f24 in Log::log(int, char*, ...) (this=0x7c347c20,
> level=808591401,
>     format=0x32313230 <Address 0x32313230 out of bounds>) at Log.cpp:176
> #3  0x7c337c20 in ?? ()
> Cannot access memory at address 0x7c327c20
> Anyone have idea? I'm using g++ 3.2,  glibc 2.2.5-42, redhat 7.1, kernal
> 2.4.18. I compiled the program with -D_REENTRANT -D_POSIX_C_SOURCE=199506L.

Please don't take this too personally ;) - but I'd bet that the error is
in your code, not in pthread implementation ;) - you've probably corrupted
your memory somewhere before, and pthread_mutex_lock() just crashes due to
some previously corrupted memory.

You can use efence or dmalloc or similar tools to diagnose where the
problem lies exactly.

--
JiKos.