www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11341] New: segfault in std.process.createEnv

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

           Summary: segfault in std.process.createEnv
           Product: D
           Version: D2
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: hans fugal.net



// On OSX this code causes a segfault. (dmd 2.063.2)
void sub() {
  import std.process;
  execute(["echo", "hello"]);
}

void main() {
  import std.concurrency;
  spawn(&sub);
}

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
[Switching to process 39151 thread 0x1203]
0x0000000100038a2c in D3std7process7environFNbNdNeZxPPa ()
(gdb) bt



D3std7process16spawnProcessImplFNexAAaS3std5stdio4FileS3std5stdio4FileS3std5stdio4FilexHAyaAyaE3std7process6ConfigZC3std7process3Pid
()

D3std7process12spawnProcessFNexAAaS3std5stdio4FileS3std5stdio4FileS3std5stdio4FilexHAyaAyaE3std7process6ConfigZC3std7process3Pid
()

D3std7process159__T15pipeProcessImplS129_D3std7process12spawnProcessFNexAAaS3std5stdio4FileS3std5stdio4FileS3std5stdio4FilexHAyaAyaE3std7process6ConfigZC3std7process3PidTAAyaZ15pipeProcessImplFNeAAyaE3std7process8RedirectxHAyaAyaE3std7process6ConfigZS3std7process12ProcessPipes
()

D3std7process11pipeProcessFNeAAyaE3std7process8RedirectxHAyaAyaE3std7process6ConfigZS3std7process12ProcessPipes
()

D3std7process138__T11executeImplS112_D3std7process11pipeProcessFNeAAyaE3std7process8RedirectxHAyaAyaE3std7process6ConfigZS3std7process12ProcessPipesTAAyaZ11executeImplFAAyaxHAyaAyaE3std7process6ConfigmZS3std7process138__T11executeImplS112_D3std7process11pipeProcessFNeAAyaE3std7process8RedirectxHAyaAyaE3std7process6ConfigZS3std7process12ProcessPipesTAAyaZ11executeImplFAAyaxHAyaAyaE3std7process6ConfigmZ13ProcessOutput
()

D3std7process7executeFNeAAyaxHAyaAyaE3std7process6ConfigmZS3std7process138__T11executeImplS112_D3std7process11pipeProcessFNeAAyaE3std7process8RedirectxHAyaAyaE3std7process6ConfigZS3std7process12ProcessPipesTAAyaZ11executeImplFAAyaxHAyaAyaE3std7process6ConfigmZ13ProcessOutput
()


D3std11concurrency16__T6_spawnTPFZvZ6_spawnFbPFZvZS3std11concurrency3Tid4execMFZv
()





Same thing happens with core.thread.Thread insead of std.concurrency.spawn, and
other variants like
std.process.{spawnProcess,spawnShell,pipeProcess,pipeShell}.

Works ok in linux. (2.063.2)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11341


Hans Fugal <hans fugal.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 11112 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2013