|
From: Mathieu L. <mat...@gm...> - 2009-09-07 08:38:27
|
hi, I just stumbled upon the following output by valgrind. I am using userspace threads/stacks/context switching. Is this kind of hard error expected ? If not, what kind of information would you want in a bug report ? (I can point to the full example code but, that's a bit huge) [mathieu@mathieu-laptop ns-3-dev]$ valgrind ./build/debug/examples/process-ping ==7786== Memcheck, a memory error detector. ==7786== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al. ==7786== Using LibVEX rev 1884, a library for dynamic binary translation. ==7786== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP. ==7786== Using valgrind-3.4.1, a dynamic binary instrumentation framework. ==7786== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al. ==7786== For more details, rerun with: -v ==7786== ==7786== Warning: client switching stacks? SP change: 0x7fefff478 --> 0x59fcfe8 ==7786== to suppress, use: --max-stackframe=34248598672 or greater --7786-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting --7786-- si_code=1; Faulting address: 0x205137354; sp: 0x40308bc10 valgrind: the 'impossible' happened: Killed by fatal signal ==7786== at 0x3803A962: vgPlain_get_StackTrace_wrk (m_stacktrace.c:251) ==7786== by 0x3803AAC0: vgPlain_get_StackTrace (m_stacktrace.c:483) ==7786== by 0x38027105: record_ExeContext_wrk (m_execontext.c:316) ==7786== by 0x38002B05: vgMemCheck_new_block (mc_malloc_wrappers.c:214) ==7786== by 0x38002F65: vgMemCheck___builtin_new (mc_malloc_wrappers.c:246) ==7786== by 0x3804D07B: vgPlain_scheduler (scheduler.c:1303) ==7786== by 0x3805EC14: run_a_thread_NORETURN (syswrap-linux.c:89) sched status: running_tid=1 Thread 1: status = VgTs_Runnable Segmentation fault -- Mathieu Lacage <mat...@gm...> |
|
From: Ashley P. <as...@pi...> - 2009-09-07 09:37:29
|
On Mon, 2009-09-07 at 10:38 +0200, Mathieu Lacage wrote: > > I just stumbled upon the following output by valgrind. I am using > userspace threads/stacks/context switching. Is this kind of hard error > expected ? My understanding is this kind of error is expected when using userspace stack switching, valgrind has to guess between this case and the case were people just use large stacks. If you re-run your code with the --max-stackframe=34248598672 suggested in the error message it should run better, in the past I've had this error repeat with a bigger value when doing that but using the bigger value has worked the second time around. I would also point out that there is a new version available, if the above doesn't help you you should re-test with the 3.5.0 release before investigating further. Ashley, -- Ashley Pittman, Bath, UK. Padb - A parallel job inspection tool for cluster computing http://padb.pittman.org.uk |
|
From: Julian S. <js...@ac...> - 2009-09-07 09:47:49
|
What happened is, your application switched stacks, then it did malloc(). Valgrind tries to unwind the stack (get a backtrace) at this point, so it can show you it in error messages later if needed. But the stack unwinder segfaults. This usually means the (application's) stack is corrupted (at the point you did the malloc). J On Monday 07 September 2009, Mathieu Lacage wrote: > hi, > > I just stumbled upon the following output by valgrind. I am using > userspace threads/stacks/context switching. Is this kind of hard error > expected ? If not, what kind of information would you want in a bug > report ? (I can point to the full example code but, that's a bit huge) > > [mathieu@mathieu-laptop ns-3-dev]$ valgrind > ./build/debug/examples/process-ping ==7786== Memcheck, a memory error > detector. > ==7786== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al. > ==7786== Using LibVEX rev 1884, a library for dynamic binary translation. > ==7786== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP. > ==7786== Using valgrind-3.4.1, a dynamic binary instrumentation framework. > ==7786== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al. > ==7786== For more details, rerun with: -v > ==7786== > ==7786== Warning: client switching stacks? SP change: 0x7fefff478 --> > 0x59fcfe8 ==7786== to suppress, use: --max-stackframe=34248598672 > or greater --7786-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 > (SIGSEGV) - exiting > --7786-- si_code=1; Faulting address: 0x205137354; sp: 0x40308bc10 > > valgrind: the 'impossible' happened: > Killed by fatal signal > ==7786== at 0x3803A962: vgPlain_get_StackTrace_wrk (m_stacktrace.c:251) > ==7786== by 0x3803AAC0: vgPlain_get_StackTrace (m_stacktrace.c:483) > ==7786== by 0x38027105: record_ExeContext_wrk (m_execontext.c:316) > ==7786== by 0x38002B05: vgMemCheck_new_block (mc_malloc_wrappers.c:214) > ==7786== by 0x38002F65: vgMemCheck___builtin_new > (mc_malloc_wrappers.c:246) ==7786== by 0x3804D07B: vgPlain_scheduler > (scheduler.c:1303) > ==7786== by 0x3805EC14: run_a_thread_NORETURN (syswrap-linux.c:89) > > sched status: > running_tid=1 > > Thread 1: status = VgTs_Runnable > Segmentation fault |