Bug 166355 - unshare syscall not supported
Summary: unshare syscall not supported
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.3.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: wanted3.6.0
Assignee: Nicholas Nethercote
URL:
Keywords:
: 324486 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-12 10:18 UTC by Michael Spang
Modified: 2015-04-11 22:56 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Spang 2008-07-12 10:18:37 UTC
--10797-- WARNING: unhandled syscall: 272
--10797-- You may be able to write your own handler.
--10797-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--10797-- Nevertheless we consider this a bug.  Please report
--10797-- it at http://valgrind.org/support/bug_reports.html.
fatal: unshare: Function not implemented
Comment 1 Bart Van Assche 2008-07-12 10:31:35 UTC
Platform: amd64. For more information about the unshare() system call, see also http://lwn.net/Articles/135321/.
Comment 2 Julian Seward 2008-11-06 11:31:04 UTC
Michael, can you supply a simple test case program?
Comment 3 Tom Hughes 2009-07-15 17:51:02 UTC
The unshare system call should be simple enough to implement in itself - it only has a single argument which is a bitmask of flags.

I just wonder what the interaction with other things may be though, as it effectively allows a thread to partially separate itself from it's parent so that they no longer share certain resources. We currently police what sets of flags we are prepared to allow to clone() and this call allows that to be changed later.
Comment 4 Tom Hughes 2013-09-05 13:39:24 UTC
*** Bug 324486 has been marked as a duplicate of this bug. ***
Comment 5 Alex Bligh 2015-04-11 15:46:58 UTC
I believe this bug is fixed in 3.11.0 (or before):

# /home/amb/valgrind/install/bin/valgrind --version
valgrind-3.11.0.SVN
# /home/amb/valgrind/install/bin/valgrind unshare -n /bin/true
==60198== Memcheck, a memory error detector
==60198== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==60198== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info
==60198== Command: unshare -n /bin/true
==60198==

whereas:

# valgrind --version
valgrind-3.10.0.SVN
# valgrind unshare -n /bin/true
==60187== Memcheck, a memory error detector
==60187== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==60187== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==60187== Command: unshare -n /bin/true
==60187==
--60187-- WARNING: unhandled syscall: 272
--60187-- You may be able to write your own handler.
--60187-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--60187-- Nevertheless we consider this a bug.  Please report
--60187-- it at http://valgrind.org/support/bug_reports.html.
unshare: unshare failed: Function not implemented
==60187==
==60187== HEAP SUMMARY:
==60187==     in use at exit: 0 bytes in 0 blocks
==60187==   total heap usage: 245 allocs, 245 frees, 22,384 bytes allocated
==60187==
==60187== All heap blocks were freed -- no leaks are possible
==60187==
==60187== For counts of detected and suppressed errors, rerun with: -v
==60187== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Comment 6 Tom Hughes 2015-04-11 22:56:27 UTC
Yes Julian appears to have committed it in r14494.

There's no validation of the argument so I suspect there may be ways to severely confuse valgrind but I guess we can deal with those as and when somebody finds them.