Bug 11313 – std.process.ProcessException: Not an executable file on running unittests when /tmp is mounted noexec
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-21T04:45:40Z
Last change time
2019-11-18T15:44:36Z
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2013-10-21T04:45:40Z
As per summary, to reproduce run (assumes you have a line in /etc/fstab for /tmp):
mount -o remount,noexec /tmp
Then run the phobos unittests.
Unittests should *really* be creating the temp file on the same filesystem as where you are running ./unittest from for phobos.
Comment #1 by ibuclaw — 2013-10-21T04:46:38Z
s/ the temp file / any temp file /
Comment #2 by dlang-bugzilla — 2013-10-21T04:59:54Z
Possibly unrelated, but wouldn't a noexec /tmp completely break rdmd?
Comment #3 by code — 2013-10-21T05:05:34Z
Yes, it would also break RDMD.
Frankly, I don't think it is worth making active efforts to support such non-standard configurations. And if I remember correctly, having a noexec /tmp also breaks the installation scripts of random packages, so it's not like you could expect it to work without problems in other situations.
Comment #4 by ibuclaw — 2013-10-21T05:20:35Z
/tmp as noexec is a standard in general workplace environments.
The only packages that break because of noexec are typically third party packages or .bin installers, and is not the norm for packages through your standard distribution.
Comment #5 by alex — 2013-10-21T05:23:49Z
Ubuntu:
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
Debian:
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=718340k)
Comment #6 by code — 2013-10-21T05:35:43Z
(In reply to comment #5)
> Ubuntu:
>
> tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
>
> Debian:
>
> tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=718340k)
That's only /run resp. /run/shm, not /tmp. I actually checked the last couple of official Ubuntu EC2 images, none of them mounts /tmp noexec by default. And neither do the Debian instances on two of my boxes.
Comment #7 by code — 2013-10-21T05:40:05Z
(In reply to comment #4)
> /tmp as noexec is a standard in general workplace environments.
It might be common in hardened server environments, but I'd argue that's not where people usually do software development, or at least where they are supposed to. ;)
Comment #8 by dlang-bugzilla — 2013-10-21T05:48:46Z
Would setting the TMP environment variable qualify as a workaround? Looking at the implementation of tempDir (which is used in uniqueTempPath, used by std.process), that would work.
rdmd doesn't use tempDir, which is probably a bug.
Comment #9 by ibuclaw — 2013-10-21T06:14:43Z
(In reply to comment #6)
> (In reply to comment #5)
> > Ubuntu:
> >
> > tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
> >
> > Debian:
> >
> > tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=718340k)
>
> That's only /run resp. /run/shm, not /tmp. I actually checked the last couple
> of official Ubuntu EC2 images, none of them mounts /tmp noexec by default. And
> neither do the Debian instances on two of my boxes.
David has bots and rootkits running on his systems. :o)