|
From: Renato W. <ren...@gm...> - 2012-02-27 19:30:06
Attachments:
valgrind-setns.diff
|
Hello all, I tried to use valgrind in my code (a network daemon) and faced the following error: ... --19475-- WARNING: unhandled syscall: 346 --19475-- You may be able to write your own handler. --19475-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --19475-- Nevertheless we consider this a bug. Please report --19475-- it at http://valgrind.org/support/bug_reports.html. ... The unhandled syscall is setns(), introduced in linux-3.0 (http://linux.die.net/man/2/setns) . After reading the official documentation, I tried to add a wrapper to this syscall (patch attached) but I didn't manage to get it working. Even worse, I can't even compile valgrind with my patch: debian:~/valgrind/valgrind-3.7.0# make 2> log.txt debian:~/valgrind/valgrind-3.7.0# less log.txt m_syswrap/syswrap-generic.c:2379: warning: no previous prototype for ‘vgSysWrap_generic_sys_setns_before’ ../coregrind/libcoregrind-x86-linux.a(libcoregrind_x86_linux_a-syswrap-x86-linux.o):(.data+0xad0): undefined reference to `vgSysWrap_linux_sys_setns_before' collect2: ld returned 1 exit status make[3]: *** [memcheck-x86-linux] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Does anyone knows how to fix this problem? Any help would be appreciated. Regards, -- Renato Westphal |
|
From: Eliot M. <mo...@cs...> - 2012-02-27 22:27:36
|
I'm not super-familiar with this part of the code, but I wonder if the insertion you put in syswrap-generic.c needs to be in syswrap-linux.c, to match where you put things in syswrap-linux.h ... Eliot Moss |
|
From: Renato W. <ren...@gm...> - 2012-02-28 12:13:31
Attachments:
valgrind-unshare-setns.patch
|
2012/2/27 Eliot Moss <mo...@cs...>: > I'm not super-familiar with this part of the code, > but I wonder if the insertion you put in syswrap-generic.c > needs to be in syswrap-linux.c, to match where you > put things in syswrap-linux.h ... > > Eliot Moss Thanks, that did the trick ;) I also had to add a wrapper for the unshare() syscall. I'm sending a patch attached (x86 only) in case anyone is interested. I'm not sure if it's right but it's working for me. []s -- Renato Westphal |
|
From: Tom H. <to...@co...> - 2012-02-28 12:32:06
|
On 28/02/12 12:13, Renato Westphal wrote: > I also had to add a wrapper for the unshare() syscall. I'm sending a > patch attached (x86 only) in case anyone is interested. I'm not sure > if it's right but it's working for me. There is already a bug for unshare here: https://bugs.kde.org/show_bug.cgi?id=166355 Note that you simple wrapper is unlikely to be sufficient for unshare as I think we will need to police it to make sure it isn't about to unshare something that might break valgrind. Likewise some thought may be needed for setns as you're are not only changing the namespace in which the client program executes, but also the namesapce in which valgrind is executing. In any case your patches should be filed in the bug tracker so that they don't get lost. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |