[Issue 16955] New: std.process.spawnProcessImpl can crash due to alloca

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Dec 7 09:40:27 PST 2016


https://issues.dlang.org/show_bug.cgi?id=16955

          Issue ID: 16955
           Summary: std.process.spawnProcessImpl can crash due to alloca
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list