|
From: Pete V. <pv...@gm...> - 2004-12-10 16:36:42
|
I'm a new user (downloaded Valgrind yesterday) and am wondering if anyone out there knows how to get VALGRIND_PRINTF to work. When I run my program under memcheck, I get logging output (at least when the program launches), but VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE don't seem to do anything. Could I be having problems because my application is built with the intel compiler and Valgrind was built with gcc? Thanks in advance, Pete |
|
From: Robert W. <rj...@du...> - 2004-12-10 18:31:46
|
> I'm a new user (downloaded Valgrind yesterday) and am wondering if > anyone out there knows how to get VALGRIND_PRINTF to work. When I run > my program under memcheck, I get logging output (at least when the > program launches), but VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE > don't seem to do anything. > > Could I be having problems because my application is built with the > intel compiler and Valgrind was built with gcc? I'm guessing that's probably it. VALGRIND_PRINTF is a pretty ugly macro that passes the varargs over to Valgrind for processing. If this VA_LIST was generated with another compiler, then, if you're lucky, you might some output. Most likely, everything go boom. I'm not too sure what to do about this, except maybe do the printf processing in the macro and pass a fully-assembled string over. That's ugly too, though. Regards, Robert. |
|
From: Pete V. <pv...@gm...> - 2004-12-10 21:00:19
|
Thanks for the response. It turns out I was being stupid and running Valgrind on my launch script rather than on the executable directly. Running the executable directly produced behavior that makes much more sense. Now a second newbie question -- if you're allowed more than one in a day. Do you have to do anything special to use Valgrind with UI's? After all its initialization and the reading of a project file, my app (a Qt app) dies when it seems it's about ready to start accepting user interactions. Since the error mentioned 'libc_freeres' in the trace, I added --run-libc-freeres=no to my options. Now the app dies without an error. Thanks again, Pete On Fri, 10 Dec 2004 10:31:02 -0800, Robert Walsh <rj...@du...> wrote: > > > > I'm a new user (downloaded Valgrind yesterday) and am wondering if > > anyone out there knows how to get VALGRIND_PRINTF to work. When I run > > my program under memcheck, I get logging output (at least when the > > program launches), but VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE > > don't seem to do anything. > > > > Could I be having problems because my application is built with the > > intel compiler and Valgrind was built with gcc? > > I'm guessing that's probably it. VALGRIND_PRINTF is a pretty ugly macro > that passes the varargs over to Valgrind for processing. If this > VA_LIST was generated with another compiler, then, if you're lucky, you > might some output. Most likely, everything go boom. > > I'm not too sure what to do about this, except maybe do the printf > processing in the macro and pass a fully-assembled string over. That's > ugly too, though. > > Regards, > Robert. > > |
|
From: Robert W. <rj...@du...> - 2004-12-13 18:56:56
|
> Now a second newbie question -- if you're allowed more than one in a > day. Do you have to do anything special to use Valgrind with UI's? > After all its initialization and the reading of a project file, my app > (a Qt app) dies when it seems it's about ready to start accepting user > interactions. Since the error mentioned 'libc_freeres' in the trace, I > added --run-libc-freeres=no to my options. Now the app dies without an > error. Kind of hard to tell without more details. Got any Valgrind output we could look at? |
|
From: Pete V. <pv...@gm...> - 2004-12-13 22:29:59
|
On Mon, 13 Dec 2004 10:56:48 -0800, Robert Walsh <rj...@du...> wrote: > Kind of hard to tell without more details. Got any Valgrind output we > could look at? Sure. I've pasted the verbose memcheck output below. Most of my suppressions were in the Python or Qt libraries. I was able to use Valgrind to find a few errors by using my app's scripting interface. The app now seems completely stable, but it exits under Valgrind when the UI finishes loading up (seems like it might be the first repaint b/c on one occasion I was able to dismiss a modal dialog before the app went away). Thanks again for any ideas anyone has to offer! Pete PS: I've been blown away by how helpful Valgrind is -- even having been limited to my app's scripting mode. ==29239== Memcheck, a memory error detector for x86-linux. ==29239== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al. ==29239== Using valgrind-2.2.0, a program supervision framework for x86-linux. ==29239== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al. ==29239== ==29239== My PID = 29239, parent PID = 19456. Prog and args are: ==29239== x86_linux2_na/ce3_executable ==29239== -script ==29239== /proj/pr/6814/test.py ==29239== ==29239== Valgrind library directory: /home/valle/valgrind/lib/valgrind ==29239== Command line ==29239== x86_linux2_na/ce3_executable ==29239== -script ==29239== /proj/pr/6814/test.py ==29239== Startup, with flags: ==29239== --tool=memcheck ==29239== --suppressions=/home/valle/valgrind/my.sup ==29239== --num-callers=12 ==29239== --log-file=/var/tmp/valgrind.log ==29239== -v ==29239== --run-libc-freeres=no ==29239== Contents of /proc/version: ==29239== Linux version 2.4.20-37.9.legacy (mac...@ja...) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Mon Sep 27 20:07:09 EDT 2004 ==29239== Reading syms from /sw/ce3/054-valle-01/x86_linux2_na/ce3_executable (0x8048000) ==29239== Reading syms from /lib/ld-2.3.2.so (0x1B8E4000) ==29239== object doesn't have any debug info ==29239== Reading syms from /home/valle/valgrind/lib/valgrind/stage2 (0xB0000000) ==29239== Reading syms from /lib/ld-2.3.2.so (0xB1000000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libdl-2.3.2.so (0xB102A000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/i686/libc-2.3.2.so (0xB102E000) ==29239== object doesn't have any debug info ==29239== Reading syms from /home/valle/valgrind/lib/valgrind/vgskin_memcheck.so (0xB1267000) ==29239== Reading suppressions file: /home/valle/valgrind/my.sup ==29239== Reading suppressions file: /home/valle/valgrind/lib/valgrind/default.supp ==29239== REDIRECT soname:libc.so.6(__GI___errno_location) to soname:libpthread.so.0(__errno_location) ==29239== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0(__errno_location) ==29239== REDIRECT soname:libc.so.6(__GI___h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==29239== REDIRECT soname:libc.so.6(__h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==29239== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0(__res_state) ==29239== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state) ==29239== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==29239== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen) ==29239== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==29239== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr) ==29239== ==29239== Reading syms from /home/valle/valgrind/lib/valgrind/vg_inject.so (0x1B8FD000) ==29239== Reading syms from /home/valle/valgrind/lib/valgrind/vgpreload_memcheck.so (0x1B900000) ==29239== TRANSLATE: 0x1B8F5BB0 redirected to 0x1B903498 ==29239== Reading syms from /proj/qt/3.3.2/x86_linux2_na/lib/libqt.so.3.3.2 (0x1B907000) ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/lib/libfreetype.so.6.3.2 (0x1C60D000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /proj/hoops/HOOPS-1110/Dev_Tools/hoops_3dgs/lib/linux/libhoops1110.so (0x1C65F000) ==29239== object doesn't have any debug info ==29239== Reading syms from /home/valle/valgrind/lib/valgrind/libpthread.so (0x1CAE7000) ==29239== Reading syms from /lib/libutil-2.3.2.so (0x1CB16000) ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXmu.so.6.2 (0x1CB1A000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/i686/libm-2.3.2.so (0x1CB31000) ==29239== object doesn't have any debug info ==29239== Reading syms from /proj/intel_lib/010/x86_linux2/libcprts.so.5 (0x1CB54000) ==29239== object doesn't have any debug info ==29239== Reading syms from /proj/intel_lib/010/x86_linux2/libcxa.so.5 (0x1CBD2000) ==29239== object doesn't have any debug info ==29239== Reading syms from /proj/intel_lib/010/x86_linux2/libunwind.so.5 (0x1CBFB000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/i686/libc-2.3.2.so (0x1CC02000) ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libX11.so.6.2 (0x1CD3C000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libdl-2.3.2.so (0x1CE1C000) ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXrender.so.1.2.2 (0x1CE21000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXft.so.1.1 (0x1CE2A000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXext.so.6.4 (0x1CE3B000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libSM.so.6.0 (0x1CE4A000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libICE.so.6.3 (0x1CE54000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXt.so.6.0 (0x1CE6C000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/lib/libfontconfig.so.1.0 (0x1CEBF000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/lib/libexpat.so.0.4.0 (0x1CEE7000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== TRANSLATE: 0x1CC75160 redirected to 0x1B903C90 ==29239== TRANSLATE: 0x1CC75950 redirected to 0x1B904618 ==29239== TRANSLATE: 0x1CC75320 redirected to 0x1B9041C8 ==29239== TRANSLATE: 0x1CC17D10 redirected to 0x1CAEECFA ==29239== TRANSLATE: 0x1CC753E0 redirected to 0x1B9046CA ==29239== TRANSLATE: 0x1CC7C680 redirected to 0x1B903658 ==29239== Reading syms from /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 (0x1C5F9000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== TRANSLATE: 0x1CC7E0E0 redirected to 0x1B903A94 ==29239== Reading syms from /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2 (0x1C604000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 (0x1D30B000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libnss_files-2.3.2.so (0x1D742000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libnss_nis-2.3.2.so (0x1D74F000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libnsl-2.3.2.so (0x1D759000) ==29239== object doesn't have any debug info ==29239== TRANSLATE: 0x1CCF4630 redirected to 0x1CAEEFA0 ==29239== Reading syms from /lib/libnss_dns-2.3.2.so (0x1D76F000) ==29239== object doesn't have any debug info ==29239== Reading syms from /lib/libresolv-2.3.2.so (0x1D775000) ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/libXcursor.so.1.0 (0x1D731000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== Reading syms from /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2 (0x1DB8C000) ==29239== object doesn't have a symbol table ==29239== object doesn't have any debug info ==29239== ==29239== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 9906 from 14) --29239-- --29239-- supp: 71 Ugly strchr error in /lib/ld-2.3.2.so --29239-- supp: 7 pthread_mutex_unlock/_IO_funlockfile --29239-- supp: 6 MySuppression25 --29239-- supp: 23 MySuppression24b --29239-- supp: 101 MySuppression24b --29239-- supp: 3042 MySuppression24 --29239-- supp: 4 MySuppression19c --29239-- supp: 40 MySuppression19b --29239-- supp: 708 MySuppression19 --29239-- supp: 12 MySuppression16 --29239-- supp: 5 MySuppression7 --29239-- supp: 80 MySuppression6 --29239-- supp: 2924 MySuppression4 --29239-- supp: 2883 MySuppression6 ==29239== malloc/free: in use at exit: 12762340 bytes in 173779 blocks. ==29239== malloc/free: 591744 allocs, 417965 frees, 59320371 bytes allocated. ==29239== --29239-- TT/TC: 0 tc sectors discarded. --29239-- 705435 tt_fast misses. --29239-- translate: new 97594 (1807501 -> 22924539; ratio 126:10) --29239-- discard 1 (23 -> 320; ratio 139:10). --29239-- chainings: 74640 chainings, 2 unchainings. --29239-- dispatch: 502650000 jumps (bb entries); of them 118805835 (23%) unchained. --29239-- 28759/20742502 major/minor sched events. --29239-- reg-alloc: 18762 t-req-spill, 4239953+121695 orig+spill uis, --29239-- 511747 total-reg-rank --29239-- sanity: 28164 cheap, 1127 expensive checks. --29239-- ccalls: 490841 C calls, 53% saves+restores avoided (1532382 bytes) --29239-- 673211 args, avg 0.86 setup instrs each (182504 bytes) --29239-- 0% clear the stack (1472523 bytes) --29239-- 172100 retvals, 34% of reg-reg movs avoided (116556 bytes) |