Bug 16955 – std.process.spawnProcessImpl can crash due to alloca
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-12-07T17:40:00Z
Last change time
2017-01-16T23:25:42Z
Assigned to
nobody
Creator
atila.neves
Comments
Comment #0 by atila.neves — 2016-12-07T17:40:27Z
in process.d:475:
pollfd* pfds = cast(pollfd*)alloca(pollfd.sizeof * maxToClose);
maxToClose is the maximum number of file descriptors - 3. Multiplied by pollfd.sizeof this is usually far lower than the size of the stack. On systems configured to be servers however...
There should at least be a check here and fall back to heap allocation.
The symptom of this bug is that functions like std.process.execute fail and it's hard to know why.
Comment #1 by john.loughran.colvin — 2016-12-07T18:17:18Z