[Issue 10364] Mac OS 10.8 program crash

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 28 08:37:04 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10364



--- Comment #3 from Gary Willoughby <spam at kalekold.net> 2013-07-28 08:37:03 PDT ---
(In reply to comment #2)
> I can not reproduce this on Linux.  It would be great to get confirmation from
> someone else on OSX, to verify that it isn't a local issue.
> 
> One thing I've noticed is that you call exit() in the parent process after a
> successful fork().  You should call _exit() instead, to avoid double-flushing
> buffers etc.  This probably won't fix your problem, but it's worth a try.

I've reduced it to this:

import std.stdio;
import std.string;
import std.process;

extern (C)
{
    int daemon(int nochdir, int noclose);
}

void main(string[] args)
{
    daemon(0, 0);

    auto logFile = File("/Users/gary/Desktop/test.log", "a");
    logFile.writeln("Opened file");

    string command = format("logger -t %s %s", "Hello", "This is a test.");
    executeShell(command); // Crash dump logged at /var/log/system.log

    logFile.writeln("Done!"); // Never executes.
}

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


More information about the Digitalmars-d-bugs mailing list