Bug 333434

Summary: In some weird corner case Valgrind cannot execute executable files symlinked by /proc/self/fd
Product: [Developer tools] valgrind Reporter: Steven Stewart-Gallus <sstewartgallus00>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: minor CC: sam
Priority: NOR    
Version First Reported In: 3.9.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Steven Stewart-Gallus 2014-04-14 23:53:21 UTC
I open an executable file and then execute it using /proc/self/fd and posix_spawn.
Strangely, the child process exits with exit code 126 (a special exit status for when execve does not work correctly).
This bug resembles the feature that is supposedly not easily able to be implemented in https://bugs.kde.org/show_bug.cgi?id=331311 where extra Valgrind specific files are shown in /proc/self/fd but seems more serious because executing specific files in /proc/self/fd is used in GLibc's implementation of fexecve and this bug might also affect that functionality as well.
Oddly, the bug perfectly reproduces every time on my project at https://gitorious.org/linted/linted/commits/627342ab60501a8c205aebd36684bad8b564fc0e but cannot seem to be reproduced for a reduced test case.

Reproducible: Always