I've been trying to get to the bottom of a bug for a couple of days
arising in AST_TRANN when I try to convert used-supplied polar
co-ordinates to the Base Frame to check that they're valid.
When the SEGV reproduced with different NDFs and different current WCS
frames (AXIS or a SkyFrame) I suspected AST. However, given the
supplied mapping and argument values, David doesn't find the crash and
obtains sensible transformed co-ordinates.
Trying valgrind doesn't reveal (to me) any obvious problem with my code
(follows this message). The only possible leaks mention are in AST,
and I'm not sure if those are relevant because I had to break in to
complete the valgrind o/p.
Are there other valgrind tools that I should be using or vital clues
that I've missed from valgrind's report?
Malcolm
rlsul1.bnsc.rl.ac.uk> valgrind -v --leak-check=yes --tool=memcheck
/home/mjc/classic/bin/kapp
a/beamfit ndf=dsbo mode=i beams=2 pos='"5:35:14,-5:22:20"' pos2='"0:0:8,190"' > valdump
==10189== Memcheck, a memory error detector for x86-linux.
==10189== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==10189== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==10189== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==10189== Valgrind library directory: /usr/local/lib/valgrind
==10189== Command line
==10189== /home/mjc/classic/bin/kappa/beamfit
==10189== ndf=dsbo
==10189== mode=i
==10189== beams=2
==10189== pos="5:35:14,-5:22:20"
==10189== pos2="0:0:8,190"
==10189== Startup, with flags:
==10189== -v
==10189== --leak-check=yes
==10189== --tool=memcheck
==10189== Contents of /proc/version:
==10189== Linux version 2.4.20-43.9.legacysmp
([log in to unmask])
(gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 SMP Sat Apr 30 19:07:33 EDT
2005
==10189== Reading syms from /home/mjc/classic/bin/kappa/kappa_mon (0x8048000)
==10189== Reading syms from /lib/ld-2.3.2.so (0x1B8E4000)
==10189== object doesn't have any debug info
==10189== Reading syms from /usr/local/lib/valgrind/stage2 (0xB0000000)
==10189== Reading syms from /lib/ld-2.3.2.so (0xB1000000)
==10189== object doesn't have any debug info
==10189== Reading syms from /lib/libdl-2.3.2.so (0xB1028000)
==10189== object doesn't have any debug info
==10189== Reading syms from /lib/tls/libc-2.3.2.so (0xB102C000)
==10189== object doesn't have any debug info
==10189== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so (0xB1262000)
==10189== Reading suppressions file: /usr/local/lib/valgrind/default.supp
==10189== REDIRECT soname:libc.so.6(__GI___errno_location) to
soname:libpthread.so.0(__errno_
location)
==10189== REDIRECT soname:libc.so.6(__errno_location) to
soname:libpthread.so.0(__errno_locat
ion)
==10189== REDIRECT soname:libc.so.6(__GI___h_errno_location) to
soname:libpthread.so.0(__h_er
rno_location)
==10189== REDIRECT soname:libc.so.6(__h_errno_location) to
soname:libpthread.so.0(__h_errno_l
ocation)
==10189== REDIRECT soname:libc.so.6(__GI___res_state) to
soname:libpthread.so.0(__res_state)
==10189== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state)
==10189== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==10189== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen)
==10189== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==10189== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr)
==10189==
==10189== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x1B8FD000)
==10189== Reading syms from /usr/local/lib/valgrind/vgpreload_memcheck.so (0x1B900000)
==10189== TRANSLATE: 0x1B8F5BB0 redirected to 0x1B903498
==10189== Reading syms from /home/mjc/classic/lib/libard_adam.so.0.0.0 (0x1B907000)
==10189== Reading syms from /home/mjc/classic/lib/libkpg_grf_adam.so.0.0.0 (0x1B925000)
==10189== Reading syms from /home/mjc/classic/lib/libkpg_adam.so.0.0.0 (0x1B933000)
==10189== Reading syms from /home/mjc/classic/lib/libkpg_grf.so.0.0.0 (0x1B95C000)
==10189== Reading syms from /home/mjc/classic/lib/libkpg.so.0.0.0 (0x1B99B000)
==10189== Reading syms from /home/mjc/classic/lib/libira_adam.so.0.0.0 (0x1BB06000)
==10189== Reading syms from /home/mjc/classic/lib/libira.so.0.0.0 (0x1BB0A000)
==10189== Reading syms from /home/mjc/classic/lib/libirq_adam.so.0.0.0 (0x1BB19000)
==10189== Reading syms from /home/mjc/classic/lib/libirq.so.0.0.0 (0x1BB1C000)
==10189== Reading syms from /home/mjc/classic/lib/liblpg.so.0.0.0 (0x1BB2E000)
==10189== Reading syms from /home/mjc/classic/lib/libctg.so.0.0.0 (0x1BB39000)
==10189== Reading syms from /home/mjc/classic/lib/libfts_adam.so.0.0.0 (0x1BB42000)
==10189== Reading syms from /home/mjc/classic/lib/libfts.so.0.0.0 (0x1BB4C000)
==10189== Reading syms from /home/mjc/classic/lib/libaif_adam.so.0.0.0 (0x1BB67000)
==10189== Reading syms from /home/mjc/classic/lib/libaif.so.0.0.0 (0x1BB6A000)
==10189== Reading syms from /home/mjc/classic/lib/libkapgrf.so.0.0.0 (0x1BB6E000)
==10189== Reading syms from /home/mjc/classic/lib/libcat_adam.so.0.0.0 (0x1BB75000)
==10189== Reading syms from /home/mjc/classic/lib/libcat.so.0.0.0 (0x1BB79000)
==10189== Reading syms from /home/mjc/classic/lib/libsla.so.7.0.0 (0x1C307000)
==10189== Reading syms from /home/mjc/classic/lib/libndg_adam.so.0.0.0 (0x1C346000)
==10189== Reading syms from /home/mjc/classic/lib/libndg.so.0.0.0 (0x1C354000)
==10189== Reading syms from /home/mjc/classic/lib/libndf_adam.so.0.0.0 (0x1C361000)
==10189== Reading syms from /home/mjc/classic/lib/libndf.so.0.0.0 (0x1D369000)
==10189== Reading syms from /home/mjc/classic/lib/libary.so.0.0.0 (0x1E36C000)
==10189== Reading syms from /home/mjc/classic/lib/libagp_adam.so.0.0.0 (0x1E60F000)
==10189== Reading syms from /home/mjc/classic/lib/libtrn.so.0.0.0 (0x1E62E000)
==10189== Reading syms from /home/mjc/classic/lib/libprm.so.0.0.0 (0x1E645000)
==10189== Reading syms from /home/mjc/classic/lib/libprm_a.so.0.0.0 (0x1E66B000)
==10189== Reading syms from /home/mjc/classic/lib/libmag_adam.so.0.0.0 (0x1E670000)
==10189== Reading syms from /home/mjc/classic/lib/libmag.so.0.0.0 (0x1E676000)
==10189== Reading syms from /home/mjc/classic/lib/libpda.so.0.0.0 (0x1E69D000)
==10189== Reading syms from /home/mjc/classic/lib/libpgppar_adam.so.0.0.0 (0x1E708000)
==10189== Reading syms from /home/mjc/classic/lib/libpgplot_star.so.0.0.0 (0x1E70C000)
==10189== Reading syms from /usr/lib/libpng12.so.0.1.2.2 (0x1E7BB000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /home/mjc/classic/lib/libgwm.so.0.0.0 (0x1E7E1000)
==10189== Reading syms from /usr/X11R6/lib/libSM.so.6.0 (0x1E7EA000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /usr/X11R6/lib/libICE.so.6.3 (0x1E7F4000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /usr/X11R6/lib/libX11.so.6.2 (0x1E80C000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /home/mjc/classic/lib/libatl_adam.so.0.0.0 (0x1E8EC000)
==10189== Reading syms from /home/mjc/classic/lib/libgrp_adam.so.0.0.0 (0x1E8F6000)
==10189== Reading syms from /home/mjc/classic/lib/libast.so.0.0.0 (0x1E91D000)
==10189== Reading syms from /home/mjc/classic/lib/libast_wcslib.so.0.0.0 (0x1EBAB000)
==10189== Reading syms from /home/mjc/classic/lib/libast_pal.so.0.0.0 (0x1EBBA000)
==10189== Reading syms from /home/mjc/classic/lib/libast_grf_2.0.so.0.0.0 (0x1EBCA000)
==10189== Reading syms from /home/mjc/classic/lib/libast_grf_3.2.so.0.0.0 (0x1EBCD000)
==10189== Reading syms from /home/mjc/classic/lib/libast_ems.so.0.0.0 (0x1EBD0000)
==10189== Reading syms from /usr/lib/libg2c.so.0.0.0 (0x1EBD5000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /lib/tls/libm-2.3.2.so (0x1EBF4000)
==10189== object doesn't have any debug info
==10189== Reading syms from /home/mjc/classic/lib/libshl_adam.so.0.0.0 (0x1EC17000)
==10189== Reading syms from /home/mjc/classic/lib/libshl.so.0.0.0 (0x1EC1A000)
==10189== Reading syms from /home/mjc/classic/lib/libfio_adam.so.0.0.0 (0x1EC1F000)
==10189== Reading syms from /home/mjc/classic/lib/libfio.so.0.0.0 (0x1EC23000)
==10189== Reading syms from /home/mjc/classic/lib/libone.so.0.0.0 (0x1EC2D000)
==10189== Reading syms from /home/mjc/classic/lib/libref.so.0.0.0 (0x1EC31000)
==10189== Reading syms from /home/mjc/classic/lib/libhdspar_adam.so.0.0.0 (0x1EC36000)
==10189== Reading syms from /home/mjc/classic/lib/libpar_adam.so.0.0.0 (0x1EC39000)
==10189== Reading syms from /home/mjc/classic/lib/libdtask_adam.so.0.0.0 (0x1EC4F000)
==10189== Reading syms from /home/mjc/classic/lib/libtask_adam.so.0.0.0 (0x1EC5C000)
==10189== Reading syms from /home/mjc/classic/lib/liberr_adam.so.0.0.0 (0x1EC66000)
==10189== Reading syms from /home/mjc/classic/lib/libsubpar_adam.so.0.0.0 (0x1EC70000)
==10189== Reading syms from /home/mjc/classic/lib/liblex_adam.so.0.0.0 (0x1EE5E000)
==10189== Reading syms from /home/mjc/classic/lib/libams_adam.so.0.0.0 (0x1EE67000)
==10189== Reading syms from /home/mjc/classic/lib/libmsp.so.0.0.0 (0x1EE6E000)
==10189== Reading syms from /home/mjc/classic/lib/libsock.so.0.0.0 (0x1EE73000)
==10189== Reading syms from /home/mjc/classic/lib/libatimer.so.0.0.0 (0x1EE78000)
==10189== Reading syms from /home/mjc/classic/lib/libmisc_adam.so.0.0.0 (0x1EE7B000)
==10189== Reading syms from /usr/lib/libncurses.so.5.3 (0x1EE82000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /home/mjc/classic/lib/libstring_adam.so.0.0.0 (0x1EEC2000)
==10189== Reading syms from /home/mjc/classic/lib/libhdsf.so.0.0.0 (0x1EEC6000)
==10189== Reading syms from /home/mjc/classic/lib/libhds.so.0.0.0 (0x1EEE3000)
==10189== Reading syms from /home/mjc/classic/lib/libchr.so.0.0.0 (0x1EF14000)
==10189== Reading syms from /home/mjc/classic/lib/libhlp.so.0.0.0 (0x1EF1D000)
==10189== Reading syms from /home/mjc/classic/lib/libpsx.so.0.0.0 (0x1EF26000)
==10189== Reading syms from /home/mjc/classic/lib/libemsf.so.0.0.0 (0x1EF2B000)
==10189== Reading syms from /home/mjc/classic/lib/libems.so.0.0.0 (0x1EF30000)
==10189== Reading syms from /home/mjc/classic/lib/libcnf.so.0.0.0 (0x1EF3F000)
==10189== Reading syms from /home/mjc/classic/lib/libstarmem.so.0.0.0 (0x1EF46000)
==10189== Reading syms from /lib/libgcc_s-3.2.2-20030225.so.1 (0x1EF4D000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /lib/tls/libc-2.3.2.so (0x42000000)
==10189== object doesn't have any debug info
==10189== Reading syms from /usr/lib/libz.so.1.1.4 (0x1EF56000)
==10189== object doesn't have a symbol table
==10189== object doesn't have any debug info
==10189== Reading syms from /lib/libdl-2.3.2.so (0x1EF67000)
==10189== object doesn't have any debug info
==10189== TRANSLATE: 0x1B8E4C00 redirected to 0x52BFF040
==10189== TRANSLATE: 0x42073700 redirected to 0x1B903C90
==10189== TRANSLATE: 0x42073880 redirected to 0x1B9041C8
==10189== TRANSLATE: 0x42073940 redirected to 0x1B9046CA
==10189== TRANSLATE: 0x42073DC0 redirected to 0x1B904618
==10189== TRANSLATE: 0x4207A920 redirected to 0x1B903658
==10194==
==10194== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 171 from 1)
--10194--
--10194-- supp: 171 Ugly strchr error in /lib/ld-2.3.2.so
==10194== malloc/free: in use at exit: 85485 bytes in 889 blocks.
==10194== malloc/free: 1648 allocs, 759 frees, 373786 bytes allocated.
==10194==
==10194== searching for pointers to 889 not-freed blocks.
==10194== checked 60625784 bytes.
==10194==
==10194== 336 bytes in 1 blocks are possibly lost in loss record 1 of 6
==10194== at 0x1B904792: realloc (vg_replace_malloc.c:197)
==10194== by 0x1EAB241A: astRealloc_ (memory.c:1305)
==10194== by 0x1EAB213B: astGrow_ (memory.c:904)
==10194== by 0x1EAB6B19: astMakeId_ (object.c:5075)
==10194==
==10194==
==10194== 27589 bytes in 527 blocks are possibly lost in loss record 5 of 6
==10194== at 0x1B903D1C: malloc (vg_replace_malloc.c:131)
==10194== by 0x1EAB2230: astMalloc_ (memory.c:987)
==10194== by 0x1EAB693D: InitContext (object.c:4928)
==10194== by 0x1EAB6520: astBegin_ (object.c:4341)
==10194==
==10194== LEAK SUMMARY:
==10194== definitely lost: 0 bytes in 0 blocks.
==10194== possibly lost: 27925 bytes in 528 blocks.
==10194== still reachable: 57560 bytes in 361 blocks.
==10194== suppressed: 0 bytes in 0 blocks.
==10194== Reachable blocks (those to which a pointer was found) are not shown.
==10194== To see them, rerun with: --show-reachable=yes
--10194-- TT/TC: 0 tc sectors discarded.
--10194-- 51650 tt_fast misses.
--10194-- translate: new 28242 (510499 -> 7157810; ratio 140:10)
--10194-- discard 1 (23 -> 320; ratio 139:10).
--10194-- chainings: 20102 chainings, 3 unchainings.
--10194-- dispatch: 29804755 jumps (bb entries); of them 7447166 (24%) unchained.
--10194-- 1169/55572 major/minor sched events.
--10194-- reg-alloc: 5268 t-req-spill, 1307489+43306 orig+spill uis,
--10194-- 149709 total-reg-rank
--10194-- sanity: 902 cheap, 37 expensive checks.
--10194-- ccalls: 159332 C calls, 51% saves+restores avoided (482366 bytes)
--10194-- 212315 args, avg 0.89 setup instrs each (44796 bytes)
--10194-- 0% clear the stack (477669 bytes)
--10194-- 50470 retvals, 33% of reg-reg movs avoided (33022 bytes)
--10189-- adding signal 11 to pending set
==10189==
==10189== Process terminating with default action of signal 2 (SIGINT)
==10189== at 0x42027896: kill (in /lib/tls/libc-2.3.2.so)
==10189== by 0x52BFEFFF: ???
==10189== by 0x1EAA31C6: astTransform_ (mapping.c:21951)
==10189== by 0x1E94E30E: Transform (cmpmap.c:2714)
==10189==
==10189== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 171 from 1)
--10189--
--10189-- supp: 171 Ugly strchr error in /lib/ld-2.3.2.so
==10189== malloc/free: in use at exit: 114644 bytes in 918 blocks.
==10189== malloc/free: 1648 allocs, 730 frees, 373786 bytes allocated.
==10189==
==10189== searching for pointers to 918 not-freed blocks.
==10189== checked 62018840 bytes.
==10189==
==10189== 336 bytes in 1 blocks are possibly lost in loss record 1 of 8
==10189== at 0x1B904792: realloc (vg_replace_malloc.c:197)
==10189== by 0x1EAB241A: astRealloc_ (memory.c:1305)
==10189== by 0x1EAB213B: astGrow_ (memory.c:904)
==10189== by 0x1EAB6B19: astMakeId_ (object.c:5075)
==10189==
==10189==
==10189== 27589 bytes in 527 blocks are possibly lost in loss record 6 of 8
==10189== at 0x1B903D1C: malloc (vg_replace_malloc.c:131)
==10189== by 0x1EAB2230: astMalloc_ (memory.c:987)
==10189== by 0x1EAB693D: InitContext (object.c:4928)
==10189== by 0x1EAB6520: astBegin_ (object.c:4341)
==10189==
==10189== LEAK SUMMARY:
==10189== definitely lost: 0 bytes in 0 blocks.
==10189== possibly lost: 27925 bytes in 528 blocks.
==10189== still reachable: 86719 bytes in 390 blocks.
==10189== suppressed: 0 bytes in 0 blocks.
==10189== Reachable blocks (those to which a pointer was found) are not shown.
==10189== To see them, rerun with: --show-reachable=yes
--10189-- TT/TC: 0 tc sectors discarded.
--10189-- 50169 tt_fast misses.
--10189-- translate: new 26853 (491929 -> 6894248; ratio 140:10)
--10189-- discard 1 (23 -> 320; ratio 139:10).
--10189-- chainings: 19711 chainings, 3 unchainings.
--10189-- dispatch: 29504755 jumps (bb entries); of them 7409572 (25%) unchained.
--10189-- 1122/54004 major/minor sched events.
--10189-- reg-alloc: 5184 t-req-spill, 1258580+42808 orig+spill uis,
--10189-- 143197 total-reg-rank
--10189-- sanity: 875 cheap, 35 expensive checks.
--10189-- ccalls: 153484 C calls, 51% saves+restores avoided (461064 bytes)
--10189-- 204794 args, avg 0.89 setup instrs each (42642 bytes)
--10189-- 0% clear the stack (460200 bytes)
--10189-- 48529 retvals, 33% of reg-reg movs avoided (31728 bytes)
Earlier when there was one insignificant initialisation I didn't have to
interrupt and valgrind ended its report thus:
==23010== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==23010== Bad permissions for mapped region at address 0x8228228
==23010== at 0x1EB47D81: Transform (winmap.c:2321)
==23010== by 0x1EAA31C6: astTransform_ (mapping.c:21951)
==23010== by 0x1E94E30E: Transform (cmpmap.c:2714)
==23010== by 0x1EAA31C6: astTransform_ (mapping.c:21951)
==23010==
==23010== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 171 from 1)
==23010==
==23010== 1 errors in context 1 of 1:
==23010== Use of uninitialised value of size 8
==23010== at 0x1B940C8E: kpg1_gtaxv_ (kpg1_gtaxv.f:156)
==23010== by 0x80BE090: beamfit_ (beamfit.f:968)
==23010== by 0x8057B22: kappa_mon_ (kappa_mon.f:228)
==23010== by 0x8057738: dtask_applic_ (dtask_applic.f:66)
--23010--
--23010-- supp: 171 Ugly strchr error in /lib/ld-2.3.2.so
==23010==
==23010== IN SUMMARY: 1 errors from 1 contexts (suppressed: 171 from 1)
==23010==
==23010== malloc/free: in use at exit: 114644 bytes in 918 blocks.
==23010== malloc/free: 1654 allocs, 736 frees, 374044 bytes allocated.
==23010==
==23010== searching for pointers to 918 not-freed blocks.
==23010== checked 62018792 bytes.
==23010==
==23010==
==23010== 336 bytes in 1 blocks are possibly lost in loss record 1 of 8
==23010== at 0x1B904792: realloc (vg_replace_malloc.c:197)
==23010== by 0x1EAB241A: astRealloc_ (memory.c:1305)
==23010== by 0x1EAB213B: astGrow_ (memory.c:904)
==23010== by 0x1EAB6B19: astMakeId_ (object.c:5075)
==23010==
==23010==
==23010== 27565 bytes in 526 blocks are possibly lost in loss record 6 of 8
==23010== at 0x1B903D1C: malloc (vg_replace_malloc.c:131)
==23010== by 0x1EAB2230: astMalloc_ (memory.c:987)
==23010== by 0x1EAB693D: InitContext (object.c:4928)
==23010== by 0x1EAB6520: astBegin_ (object.c:4341)
==23010==
==23010== LEAK SUMMARY:
==23010== definitely lost: 0 bytes in 0 blocks.
==23010== possibly lost: 27901 bytes in 527 blocks.
==23010== still reachable: 86743 bytes in 391 blocks.
==23010== suppressed: 0 bytes in 0 blocks.
==23010== Reachable blocks (those to which a pointer was found) are not shown.
==23010== To see them, rerun with: --show-reachable=yes
--23010-- TT/TC: 0 tc sectors discarded.
--23010-- 50253 tt_fast misses.
--23010-- translate: new 26921 (493101 -> 6910621; ratio 140:10)
--23010-- discard 1 (23 -> 320; ratio 139:10).
--23010-- chainings: 19778 chainings, 3 unchainings.
--23010-- dispatch: 29414451 jumps (bb entries); of them 7410060 (25%) unchained.
--23010-- 1101/54106 major/minor sched events.
--23010-- reg-alloc: 5195 t-req-spill, 1261686+42916 orig+spill uis,
--23010-- 143572 total-reg-rank
--23010-- sanity: 879 cheap, 36 expensive checks.
--23010-- ccalls: 153798 C calls, 51% saves+restores avoided (462042 bytes)
--23010-- 205210 args, avg 0.89 setup instrs each (42752 bytes)
--23010-- 0% clear the stack (461139 bytes)
--23010-- 48666 retvals, 33% of reg-reg movs avoided (31814 bytes)
Segmentation fault
|