www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11736] New: segfault combining std.parallelism.parallel and std.process.executeShell

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11736

           Summary: segfault combining std.parallelism.parallel and
                    std.process.executeShell
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: nikhil.padmanabhan gmail.com


--- Comment #0 from nikhil.padmanabhan gmail.com 2013-12-13 10:17:09 PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2013
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11736


Jared Miller <jared economicmodeling.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry
                 CC|                            |jared economicmodeling.com


--- Comment #1 from Jared Miller <jared economicmodeling.com> 2014-02-11
14:00:52 PST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2014