From: Maxim Y. <max...@gm...> - 2006-10-22 16:19:19
|
Sorry, forgot to forward it to the list. On 22/10/06, Maxim Yegorushkin <max...@gm...> wrote: > On 22/10/06, Josef Weidendorfer <Jos...@gm...> wrote: > > On Sunday 22 October 2006 16:24, Maxim Yegorushkin wrote: > > > My program uses signals heavily (sends itself). > > > > Actually, a good hint. > > > > > BB# 343925 > > > > > > Callgrind: threads.c:396 (push_exec_state): Assertion '(sp > 0) && (sp > > > < 10)' failed. > > > > Wow. > > This is one of the few places where callgrind has a fixed limit. > > You must be running more than 9 signal handlers at the same time > > (in one thread). > > > > Could this be the case? > > I'm using 16 realtime signals [SIGRTMIN, SIGRTMIN + 15]. All the > signal handler does is writing a byte to a pipe. > > > Can you try to increase MAX_SIGHANDLERS in callgrind/global.h, > > e.g. to 30, and test your program again? > > > > Hmmm... if you allow for reentrency into a signal handler, 30 could > > be not enough. > > > > Can you tell us if this helps? > > I took the easy path by making my program use 8 signals, rather than > 16 (the program is a test, so it's easily tunable). Now I get another > assertion. I can recompile valgrind to investigate further if you > like. > > [max@k-pax demux]$ valgrind -v --tool=callgrind bin/test > log > ==3466== Callgrind, a call-graph generating cache profiler. > ==3466== Copyright (C) 2002-2006, and GNU GPL'd, by Josef Weidendorfer et al. > ==3466== Using LibVEX rev 1658, a library for dynamic binary translation. > ==3466== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. > ==3466== Using valgrind-3.2.1, a dynamic binary instrumentation framework. > ==3466== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. > ==3466== > --3466-- Command line > --3466-- bin/test > --3466-- Startup, with flags: > --3466-- -v > --3466-- --tool=callgrind > --3466-- Contents of /proc/version: > --3466-- Linux version 2.6.17-1.2187_FC5 > (bre...@hs...) (gcc version 4.1.1 20060525 > (Red Hat 4.1.1-1)) #1 Mon Sep 11 01:17:06 EDT 2006 > --3466-- Arch and hwcaps: X86, x86-sse1-sse2 > --3466-- Valgrind library directory: /usr/local/lib/valgrind > ==3466== For interactive control, run 'callgrind_control -h'. > --3466-- Reading syms from /lib/ld-2.4.so (0x526000) > --3466-- Reading syms from /home/max/src/demux/bin/test (0x8048000) > --3466-- Reading syms from /usr/local/lib/valgrind/x86-linux/callgrind > (0x38000000) > --3466-- object doesn't have a dynamic symbol table > --3466-- Code check found runtime_resolve: ld-2.4.so > +0x12B60=0x538B60, length 24 > --3466-- Reading syms from > /usr/local/lib/valgrind/x86-linux/vgpreload_core.so (0x4001000) > --3466-- Reading syms from /lib/librt-2.4.so (0xDA4000) > --3466-- Reading syms from /usr/lib/libstdc++.so.6.0.8 (0x3E7000) > --3466-- object doesn't have a symbol table > --3466-- Reading syms from /lib/libm-2.4.so (0xDB3000) > --3466-- Reading syms from /lib/libgcc_s-4.1.1-20060525.so.1 (0x3D9000) > --3466-- object doesn't have a symbol table > --3466-- Reading syms from /lib/libpthread-2.4.so (0x3C3000) > --3466-- Reading syms from /lib/libc-2.4.so (0x101000) > --3466-- Symbol match: found runtime_resolve: ld-2.4.so +0x538B60=0x538B60 > demux::engine_base::signal_handler(int) > BB# 337249 > > Callgrind: threads.c:273 (vgCallgrind_post_signal): Assertion > '*(vgCallgrind_current_fn_stack.top) == 0' failed. > ==3466== at 0x38019C11: report_and_quit (m_libcassert.c:136) > ==3466== by 0x38019F3B: vgPlain_assert_fail (m_libcassert.c:200) > ==3466== by 0x3801795D: vgCallgrind_post_signal (threads.c:273) > ==3466== by 0x3805ACC7: vgPlain_sigframe_destroy (sigframe-x86-linux.c:694) > ==3466== by 0x3805D89B: vgSysWrap_x86_linux_sys_sigreturn_before > (syswrap-x86-linux.c:954) > ==3466== by 0x3804D75F: vgPlain_client_syscall (syswrap-main.c:719) > ==3466== by 0x38039E20: vgPlain_scheduler (scheduler.c:721) > ==3466== by 0x38058D53: run_a_thread_NORETURN (syswrap-linux.c:87) > > sched status: > running_tid=1 > > Thread 1: status = VgTs_Runnable > ==3466== at 0x3CDD93: __write_nocancel (in /lib/libpthread-2.4.so) > ==3466== by 0x3CF0C7: (within /lib/libpthread-2.4.so) > ==3466== by 0x3CF0C7: (within /lib/libpthread-2.4.so) > ==3466== by 0x3CF0C7: (within /lib/libpthread-2.4.so) > ==3466== by 0x804AEA4: demux::engine_base::mask(int, __sigset_t > const*, __sigset_t*) (demux.h:420) > ==3466== by 0x804B4B5: demux::engine_base::mask_guard::unblock() > (demux.h:303) > ==3466== by 0x804BFB6: demux::epoll_::do_readiness(unsigned, > demux::engine_base::mask_guard*, long long) (demux.h:642) > ==3466== by 0x804C347: demux::engine_<demux::epoll_>::loop() (demux.h:574) > ==3466== by 0x8049352: loop(unsigned) (test.cc:133) > ==3466== by 0x804948A: main (test.cc:150) > > Note: see also the FAQ.txt in the source distribution. > It contains workarounds to several common problems. > > If that doesn't help, please report this bug to: www.valgrind.org > > In the bug report, send all the above text, the valgrind > version, and what Linux distro you are using. Thanks. > |