When test case exp-sgcheck/tests/hackedbz2 is compiled with gcc 4.8.1 it produces the following stack trace of the reported sgcheck error: at 0x........: add_to_myprintf_buf (hackedbz2.c:1006) by 0x........: vex_printf (hackedbz2.c:1155) by 0x........: BZ2_compressBlock (hackedbz2.c:4039) by 0x........: handle_compress (hackedbz2.c:4761) by 0x........: BZ2_bzCompress (hackedbz2.c:4831) by 0x........: BZ2_bzBuffToBuffCompress (hackedbz2.c:5638) by 0x........: main (hackedbz2.c:6484) The rest of information in reported sgcheck error is correct. With gcc 4.7 or older, the stack trace matches that in existing file hackedbz2.stderr.exp-glibc28-amd64. The difference is that the first function "vex_strlen" is not reported: - at 0x........: vex_strlen (hackedbz2.c:1006) - by 0x........: add_to_myprintf_buf (hackedbz2.c:1284) + at 0x........: add_to_myprintf_buf (hackedbz2.c:1006) The culprit here is gcc 4.8 which optimizes away the call to vex_strlen. This can be simply seen in 'nm hackedbz2 | grep vex_strlen' which produces empty output. When compiling with '-fno-inline-functions-called-once', vex_strlen is not inlined. But in that case there are more stack frames in the produced stack trace: at 0x........: vex_strlen (hackedbz2.c:1006) by 0x........: add_to_myprintf_buf (hackedbz2.c:1284) - by 0x........: vex_printf (hackedbz2.c:1155) + by 0x........: vprintf_wrk (hackedbz2.c:1155) + by 0x........: vex_printf (hackedbz2.c:1300) by 0x........: BZ2_compressBlock (hackedbz2.c:4039) by 0x........: handle_compress (hackedbz2.c:4761) by 0x........: BZ2_bzCompress (hackedbz2.c:4831) by 0x........: BZ2_bzBuffToBuffCompress (hackedbz2.c:5638) by 0x........: main (hackedbz2.c:6484) At this point I am unsure whether the correct fix would be: - compile hackedbz2 with '-fno-inline-functions-called-once' and fix the expected output - supply another expected output for gcc48
Now inline support is commited, it is also possible to add the option "--read-inline-info=yes" and adjust stderr.exp for all.
Created attachment 87260 [details] patch
The proposed patch implements Matthias's suggestion.
On second thoughts, this doesn't seem sgcheck-specific.
exp-sgcheck has been removed.