On Tue, Mar 25, 2014 at 12:28:51PM +0100, Mathieu Malaterre wrote: > Package: valgrind > Version: 1:3.9.0-5 > > I have extracted a section of code from openjpeg which seems to be > driving valgrind/exp-sgcheck nuts. See attached demo.c file. > > Steps (dwarf-4 and stack-protector are important): > > $ gcc -gdwarf-4 -fstack-protector demo.c > $ valgrind --tool=exp-sgcheck ./a.out > ==17451== exp-sgcheck, a stack and global array overrun detector > ==17451== NOTE: This is an Experimental-Class Valgrind Tool > ==17451== Copyright (C) 2003-2013, and GNU GPL'd, by OpenWorks Ltd et al. > ==17451== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info > ==17451== Command: ./a.out > ==17451== > > exp-sgcheck: sg_main.c:560 (add_blocks_to_StackTree): Assertion > '!already_present' failed. > ==17451== at 0x380278CC: report_and_quit (m_libcassert.c:260) > ==17451== by 0x38027A26: vgPlain_assert_fail (m_libcassert.c:340) > ==17451== by 0x3801EE00: add_blocks_to_StackTree (sg_main.c:560) > ==17451== by 0x38020321: shadowStack_new_frame.isra.12 (sg_main.c:1875) > ==17451== by 0x806427FDC: ??? > ==17451== by 0x8034DBECF: ??? > > sched status: > running_tid=1 > > Thread 1: status = VgTs_Runnable > ==17451== at 0x4005B7: main (demo.c:39)
The gcc version seems to be relevant as well (i.e. I can't reproduce with gcc-4.8). Maybe a bug in gcc? There seems to be a whole bunch of (apparently) dwarf-related bugs fixed in gcc-4.8 [0] (also, DWARF4 is the default since gcc-4.8). Cheers [0] http://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&limit=0&order=bug_status%2Cpriority%2Cassigned_to%2Cbug_id&query_format=advanced&resolution=FIXED&target_milestone=4.8.0 -- perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
signature.asc
Description: Digital signature

