Dear all,
I read the sgcheck's doc and know it's a experimental tool, but it seems found
no error even a very simple program.
Does this still work or need to wait for another version?
Below is from my script and experiment, and fail in
Valgrind-3.8.1/3.9.0/3.10.0/3.11.0/3.12.0
E.g.
>$ cat test_valgrind.c
#include<stdio.h>
#include<stdlib.h>
int main()
{
int val[10] = {0};
int tmp = val[1], i = 0;
tmp += val[15]; // array overrun
tmp *= val[20]; // array overrun
for (i=0; i<20; ++i) { int tmp = val[i]; } // array overrun
return 0;
}
When I run above version of Valgrind mentioned, it always comes out following
message.
==11673== exp-sgcheck, a stack and global array overrun detector
==11673== NOTE: This is an Experimental-Class Valgrind Tool
==11673== Copyright (C) 2003-2015, and GNU GPL'd, by OpenWorks Ltd et al.
==11673== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==11673== Command: ./run
==11673==
exp-sgcheck: sg_main.c:2332 (sg_instrument_IRStmt): the 'impossible' happened.
host stacktrace:
==11673== at 0x3800CC09: show_sched_status_wrk (m_libcassert.c:343)
==11673== by 0x3800CEF4: report_and_quit (m_libcassert.c:415)
==11673== by 0x3800D127: vgPlain_assert_fail (m_libcassert.c:481)
==11673== by 0x38004A03: sg_instrument_IRStmt (sg_main.c:2332)
==11673== by 0x380003B3: h_instrument (h_main.c:683)
==11673== by 0x3802968D: tool_instrument_then_gdbserver_if_needed
(m_translate.c:238)
==11673== by 0x380D3290: LibVEX_Translate (main_main.c:934)
==11673== by 0x380271BF: vgPlain_translate (m_translate.c:1765)
==11673== by 0x3805F857: vgPlain_scheduler (scheduler.c:1048)
==11673== by 0x38090445: run_a_thread_NORETURN (syswrap-linux.c:102)
sched status:
running_tid=1
Thread 1: status = VgTs_Runnable (lwpid 11673)
==11673== at 0x40169EA: _dl_runtime_resolve_xsave (in /usr/lib64/ld-2.17.so)
==11673== by 0x1B: ???
==11673== by 0x40057F: ??? (in /PATH/peihung/test/run)
==11673== by 0xFFEFFF517: ???
Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.
My machine environment is Centos7 and x86_64
Thanks.
Best regards,
Pahome
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users