Bug 11736 – segfault combining std.parallelism.parallel and std.process.executeShell

Status
NEW
Severity
critical
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2013-12-13T10:17:09Z
Last change time
2024-12-01T16:19:30Z
Keywords
industry
Assigned to
No Owner
Creator
nikhil.padmanabhan
Moved to GitHub: phobos#10019 →

Comments

Comment #0 by nikhil.padmanabhan — 2013-12-13T10:17:09Z
The following code dies with a segfault : import std.stdio, std.parallelism, std.process; void main() { auto a=["hello","world","goodbye"]; foreach(s; parallel(a,1)) { auto ls=executeShell("echo "~s); writeln(ls.output); } } both in ldc and dmd. Removing either the "parallel" or running something other than executeShell (eg. just doing a writeln) works, which suggests to me that it's something about the way executeShell is interacting with parallel. Pulling it up in lldb, I get : * thread #2: tid = 0x16738e6, 0x0000000100039198 test`D3std7process7environFNbNdNeZxPPa + 20, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000100039198 test`D3std7process7environFNbNdNeZxPPa + 20 This appears to only be a problem on OS X (I've tried 10.8.5); I've run both dmd 2.064.2 and ldc 0.12.1
Comment #1 by jared — 2014-02-11T14:00:52Z
Also affecting me. OSX 10.8.5 (DMD 2.063.2, 2.064.2) - segfault Debian 7.3 (DMD 2.063.2) - works correctly Related (regression? dup?): #11112 or #11341.
Comment #2 by szymon.gatner — 2015-01-29T09:42:03Z
Also affected by this but found that replacing std.process.executeShell() with deprecated std.process.system() does not cause crash so I suspect it probably has to do with executeShell() capturing process output? Im on Win7 x64, using DMD 2.066.1
Comment #3 by robert.schadek — 2024-12-01T16:19:30Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10019 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB