|
From: Philippe W. <phi...@sk...> - 2012-08-03 19:05:21
|
On Thu, 2012-08-02 at 18:21 -0400, Wonjoon Song wrote: ... > > valgrind: the 'impossible' happened: > Killed by fatal signal > ==24479== at 0x38059A25: vgPlain_do_syscall (m_syscall.c:72) > ==24479== by 0x3808E5E1: handle_syscall (scheduler.c:1057) ... > > I tried to search for examples using system call in tools but it seems > they(memcheck, massif, lackey) don't use it. Difficult to see what is going wrong without looking at (some of) the code. For sure, tools are e.g. calling VG_(getpid) without crashing :). For what concerns mmap, you should not use mmap syscall directly. Instead, you should use the interface of the Valgrind address space manager (i.e. pub_tool_aspacemgr.h). > > > My question is, is it allowed to use system call in a valgrind tool? > Is it recommended not to use system call? If it is allowed to use > system call in a tool, what should I do to make this thing work? You can use syscalls, but you must have the "interface" defined for it. See e.g. m_libcproc.c and similar to see how the "VG(xxxxxx)" are providing the equivalent of the xxxxxx syscall. Philippe |