|
From: Naveen K. <g_n...@ya...> - 2011-07-07 20:53:20
|
>Run "strace valgrind" and look near the end of the output >to see if some system call (that valgrind expects the OS to have) >is not implemented. File a bug report; see: > http://valgrind.org/support/bug_reports.html John I did some digging and it looks like it is aborting in memcheck (gdb) bt #0 0x38028448 in vgPlain_exit () at m_libcassert.c:157 #1 0x3802a853 in vgPlain_err_missing_prog () at m_libcprint.c:584 #2 0x3806082a in vgPlain_ii_create_image () at m_initimg/initimg-linux.c:860 #3 0x380309cb in valgrind_main (argc=1, argv=0xbffff904, envp=0xbffff90c) at m_main.c:1747 #4 0x380314f5 in _start_in_C_linux (pArgc=0xbffff900) at m_main.c:2839 It looks like the syscall __NR_exit_group is not working so the code is falling through. I changed it to __NR_exit and now valgrind is atleast able to exit properly without any segmentation fault. Now when I do valgrind ls I get the following error -18797-- WARNING: Serious error when reading debug info --18797-- When reading debug info from /lib/ld-2.2.4.so: --18797-- Can't make sense of .sbss section mapping --18797-- WARNING: Serious error when reading debug info --18797-- When reading debug info from /bin/ls: --18797-- Can't make sense of .sbss section mapping valgrind: m_scheduler/sema.c:96 (vgModuleLocal_sema_down): Assertion 'sema->owner_lwpid != lwpid' failed. ==18797== at 0x38028595: report_and_quit (m_libcassert.c:194) ==18797== by 0x380286A7: vgPlain_assert_fail (m_libcassert.c:268) ==18797== by 0x3806363C: vgModuleLocal_sema_down (m_scheduler/sema.c:118) ==18797== by 0x38060FEC: vgPlain_acquire_BigLock (m_scheduler/scheduler.c:220) ==18797== by 0x38064875: vgPlain_client_syscall (m_syswrap/syswrap-main.c:1557) ==18797== by 0x380621D6: handle_syscall (m_scheduler/scheduler.c:901) ==18797== by 0x38062696: vgPlain_scheduler (m_scheduler/scheduler.c:1091) ==18797== by 0x38070C26: thread_wrapper (m_syswrap/syswrap-linux.c:94) ==18797== by 0x38070D1C: run_a_thread_NORETURN (m_syswrap/syswrap-linux.c:127) sched status: running_tid=0 Thread 1: status = VgTs_WaitSys ==18797== at 0x4011364: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x4007272: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x4003832: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x400F485: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x4002375: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x400215D: ??? (in /lib/ld-2.2.4.so) ==18797== by 0x4001E25: ??? (in /lib/ld-2.2.4.so) |
|
From: John R. <jr...@bi...> - 2011-07-11 03:27:42
|
On 07/07/2011 01:53 PM, Naveen Kumar wrote: >>Run "strace valgrind" and look near the end of the output >>to see if some system call (that valgrind expects the OS to have) >>is not implemented. File a bug report; see: >> http://valgrind.org/support/bug_reports.html > John I did some digging and it looks like it is aborting in memcheck > > (gdb) bt > #0 0x38028448 in vgPlain_exit () at m_libcassert.c:157 > #1 0x3802a853 in vgPlain_err_missing_prog () at m_libcprint.c:584 > #2 0x3806082a in vgPlain_ii_create_image () at m_initimg/initimg-linux.c:860 > #3 0x380309cb in valgrind_main (argc=1, argv=0xbffff904, envp=0xbffff90c) at m_main.c:1747 > #4 0x380314f5 in _start_in_C_linux (pArgc=0xbffff900) at m_main.c:2839 > > It looks like the syscall __NR_exit_group is not working so the code is falling through. I changed it to __NR_exit and now valgrind is atleast able to exit properly without any segmentation fault. Here you should construct a small actual source file which illustrates that __NR_exit_group does not work correctly under valgrind on your platform, then file a bug against valgrind, following the directions at: http://valgrind.org/support/bug_reports.html The C run-time library and the operating system itself also are acting unfriendly. The OS should implement the concept of __NR_exit_group. If the OS does not, then the C run-time library should emulate it (if nothing else, by aliasing exit_group() to exit().) Consider asking your OS and C run-time library for such implementations. > Now when I do valgrind ls I get the following error > > -18797-- WARNING: Serious error when reading debug info > --18797-- When reading debug info from /lib/ld-2.2.4.so: > --18797-- Can't make sense of .sbss section mapping > --18797-- WARNING: Serious error when reading debug info > --18797-- When reading debug info from /bin/ls: > --18797-- Can't make sense of .sbss section mapping > valgrind: m_scheduler/sema.c:96 (vgModuleLocal_sema_down): Assertion 'sema->owner_lwpid != lwpid' failed. This, too, is a bug in valgrind. Please file a bug report, and for this problem attach the output from: objdump --dwarf /lib/ld-2.2.4.so If the debuginfo is in a separate file other than /lib/ld-2.2.4.so, then run objdump on _that_ file, too. Inspect the output from: strace -o strace.out -e trace=file valgrind <args_to_valgrind> \ ./my_app <args_to_my_app> to see which other file would be appropriate. It might be something like: /usr/lib/debug/lib/ld-2.2.4.so.debug -- |