Hello, When running my program in helgrind it dies after printing the following error on screen ==25217== Warning: client switching stacks? SP change: 0xffefff318 --> 0x2ec302fc21b27bd ==25217== to suppress, use: --max-stackframe=210596195555030181 or greater ==25217== ==25217== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==25217== Bad permissions for mapped region at address 0x2EC302AC21B4ABF ==25217== at 0x2EC302AC21B4ABF: ??? ==25217==
Running in gdb the stack trace before the crash is (gdb) where #0 __libc_dl_error_tsd () at dl-tsd.c:51 #1 0x0000003a5220d205 in _dl_signal_error (errcode=0, objname=0x4801338 "/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so", occation=0x3a522189af "symbol lookup error", errstring=0xffeffeee0 "undefined symbol: pthread_mutexattr_gettype") at dl-error.c:79 #2 0x0000003a5220d3d4 in _dl_signal_cerror (errcode=0, objname=0x4801338 "/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so", occation=0x3a522189af "symbol lookup error", errstring=0xffeffeee0 "undefined symbol: pthread_mutexattr_gettype") at dl-error.c:152 #3 0x0000003a52209cf0 in _dl_lookup_symbol_x (undef_name=0x4a0706d "pthread_mutexattr_gettype", undef_map=0x4801370, ref=0xffefff080, symbol_scope=0x48016d0, version=0x0, type_class=1, flags=1, skip_map=0x0) at dl-lookup.c:321 #4 0x0000003a5220cfb5 in _dl_fixup (l=0x0, reloc_offset=<value optimized out>) at dl-runtime.c:108 #5 0x0000003a52212a32 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2 #6 0x0000000004a10731 in _vgw00000ZZ_libpthreadZdsoZd0_pthreadZumutexZuinit (mutex=0x5084ca0, attr=0xffefff1a0) at hg_intercepts.c:771 #7 0x000000000644830f in decaf::internal::util::concurrent::PlatformThread::createMutex (mutex=0x5084b68) at decaf/internal/util/concurrent/unix/PlatformThread.cpp:79 #8 0x0000000006445974 in decaf::internal::util::concurrent::Threading::initialize () at decaf/internal/util/concurrent/Threading.cpp:869 #9 0x00000000063eca2a in decaf::lang::Runtime::initializeRuntime (argc=0, argv=0x0) at decaf/internal/DecafRuntime.cpp:76 #10 0x000000000621ed39 in activemq::library::ActiveMQCPP::initializeLibrary (argc=0, argv=0x4801338) at activemq/library/ActiveMQCPP.cpp:57 #11 0x00000000054b1022 in ktSecFwIni () at ../ktcs/KTSecFWIniFini.cpp:18 #12 0x00000000054bb106 in __do_global_ctors_aux () from /lib64/security/pam_ktcs.so #13 0x000000000548f433 in _init () from /lib64/security/pam_ktcs.so #14 0x00000000054881fc in ?? () from /lib64/security/pam_ktcs.so #15 0x0000003a5220d4ab in call_init (l=0x56cd4a8, argc=1, argv=0xffeffffd8, env=0xffeffffe8) at dl-init.c:70 #16 0x0000003a5220d5b5 in _dl_init (main_map=0x5068ac0, argc=1, argv=0xffeffffd8, env=0xffeffffe8) at dl-init.c:134 #17 0x0000003a52211054 in dl_open_worker (a=<value optimized out>) at dl-open.c:506 #18 0x0000003a5220d136 in _dl_catch_error (objname=0xffefff570, errstring=0xffefff568, mallocedp=0xffefff57f, operate=0x3a52210d80 <dl_open_worker>, args=0xffefff520) at dl-error.c:178 #19 0x0000003a522108bc in _dl_open (file=0x5068a60 "/lib64/security/pam_ktcs.so", mode=-2147483646, caller_dlopen=0x3a57e0480a, nsid=-2, argc=1, argv=0xffeffffd8, env=0xffeffffe8) at dl-open.c:586 #20 0x0000003a52e00f9a in dlopen_doit (a=<value optimized out>) at dlopen.c:67 #21 0x0000003a5220d136 in _dl_catch_error (objname=0x3a530030d0, errstring=0x3a530030d8, mallocedp=0x3a530030c8, operate=0x3a52e00f30 <dlopen_doit>, args=0xffefff740) at dl-error.c:178 #22 0x0000003a52e0150d in _dlerror_run (operate=0x3a52e00f30 <dlopen_doit>, args=0xffefff740) at dlerror.c:164 #23 0x0000003a52e00f11 in __dlopen (file=<value optimized out>, mode=<value optimized out>) at dlopen.c:88 #24 0x0000003a57e0480a in ?? () from /lib64/libpam.so.0 #25 0x0000003a57e04ffb in ?? () from /lib64/libpam.so.0 #26 0x0000003a57e05338 in ?? () from /lib64/libpam.so.0 #27 0x0000003a57e05a58 in ?? () from /lib64/libpam.so.0 #28 0x0000003a57e07174 in pam_start () from /lib64/libpam.so.0 #29 0x0000000000400e29 in main (argc=1, argv=0xffeffffd8) at ../pam_ktcs_test/CheckUser.cc:59 (gdb) The code runs fine in memgrind and outside valgrind. The stack trace when the program is run without valgrind is (gdb) where #0 __pthread_mutex_init (mutex=0x619220, mutexattr=0x7fffffffd150) at pthread_mutex_init.c:42 #1 0x00002aaaabee130f in decaf::internal::util::concurrent::PlatformThread::createMutex (mutex=0x619148) at decaf/internal/util/concurrent/unix/PlatformThread.cpp:79 #2 0x00002aaaabede974 in decaf::internal::util::concurrent::Threading::initialize () at decaf/internal/util/concurrent/Threading.cpp:869 #3 0x00002aaaabe85a2a in decaf::lang::Runtime::initializeRuntime (argc=0, argv=0x0) at decaf/internal/DecafRuntime.cpp:76 #4 0x00002aaaabcb7d39 in activemq::library::ActiveMQCPP::initializeLibrary (argc=6394400, argv=0x7fffffffd150) at activemq/library/ActiveMQCPP.cpp:57 #5 0x00002aaaaaf4a022 in ktSecFwIni () at ../ktcs/KTSecFWIniFini.cpp:18 #6 0x00002aaaaaf54106 in __do_global_ctors_aux () from /lib64/security/pam_ktcs.so #7 0x00002aaaaaf28433 in _init () from /lib64/security/pam_ktcs.so #8 0x00002aaaaaf211fc in ?? () from /lib64/security/pam_ktcs.so #9 0x0000003a5220d4ab in call_init (l=0x2aaaab1664a8, argc=1, argv=0x7fffffffdf88, env=0x7fffffffdf98) at dl-init.c:70 #10 0x0000003a5220d5b5 in _dl_init (main_map=0x6038c0, argc=1, argv=0x7fffffffdf88, env=0x7fffffffdf98) at dl-init.c:134 #11 0x0000003a52211054 in dl_open_worker (a=<value optimized out>) at dl-open.c:506 #12 0x0000003a5220d136 in _dl_catch_error (objname=0x7fffffffd520, errstring=0x7fffffffd518, mallocedp=0x7fffffffd52f, operate=0x3a52210d80 <dl_open_worker>, args=0x7fffffffd4d0) at dl-error.c:178 #13 0x0000003a522108bc in _dl_open (file=0x603890 "/lib64/security/pam_ktcs.so", mode=-2147483646, caller_dlopen=0x3a57e0480a, nsid=-2, argc=1, argv=0x7fffffffdf88, env=0x7fffffffdf98) at dl-open.c:586 #14 0x0000003a52e00f9a in dlopen_doit (a=<value optimized out>) at dlopen.c:67 #15 0x0000003a5220d136 in _dl_catch_error (objname=0x3a530030d0, errstring=0x3a530030d8, mallocedp=0x3a530030c8, operate=0x3a52e00f30 <dlopen_doit>, args=0x7fffffffd6f0) at dl-error.c:178 #16 0x0000003a52e0150d in _dlerror_run (operate=0x3a52e00f30 <dlopen_doit>, args=0x7fffffffd6f0) at dlerror.c:164 #17 0x0000003a52e00f11 in __dlopen (file=<value optimized out>, mode=<value optimized out>) at dlopen.c:88 #18 0x0000003a57e0480a in ?? () from /lib64/libpam.so.0 #19 0x0000003a57e04ffb in ?? () from /lib64/libpam.so.0 #20 0x0000003a57e05338 in ?? () from /lib64/libpam.so.0 #21 0x0000003a57e05a58 in ?? () from /lib64/libpam.so.0 #22 0x0000003a57e07174 in pam_start () from /lib64/libpam.so.0 #23 0x0000000000400e29 in main (argc=1, argv=0x7fffffffdf88) at ../pam_ktcs_test/CheckUser.cc:59 (gdb) The function in question is shown below 61 //////////////////////////////////////////////////////////////////////////////// 62 void PlatformThread::createMutex(decaf_mutex_t* mutex) { 63 64 pthread_mutexattr_t attr; 65 66 if(pthread_mutexattr_init(&attr) != 0 ) { 67 throw RuntimeException( 68 __FILE__, __LINE__, "Failed to create OS Mutex attribute object." ); 69 } 70 71 if(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0 ) { 72 pthread_mutexattr_destroy(&attr); 73 throw RuntimeException( 74 __FILE__, __LINE__, "Failed to set mutex type in OS Mutex attribute object." ); 75 } 76 77 *mutex = new pthread_mutex_t; 78 79 if( pthread_mutex_init(*mutex, &attr) != 0 ) { 80 pthread_mutexattr_destroy(&attr); 81 delete *mutex; 82 *mutex = 0; 83 throw RuntimeException( 84 __FILE__, __LINE__, "Failed to create OS Mutex object." ); 85 } 86 87 pthread_mutexattr_destroy(&attr); 88 } 89 90 //////////////////////////////////////////////////////////////////////////////// There are other pthread_XXX functions before the call in question and they have no issues. Only pthread_mutex_init seems to have a problem. The problem is repeatable. Any explanation on what is going and how to address it is very much appreciated. I'm willing to try any experimental code to get more information or try a fix Thank you
------------------------------------------------------------------------------
_______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users