D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1960 - Thread Class Causes SEGV If Not Started
Summary: Thread Class Causes SEGV If Not Started
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2008-03-30 16:43 UTC by Brian White
Modified: 2015-11-03 19:11 UTC (History)
4 users (show)

See Also:


Attachments
Fix SEGV in std.thread (574 bytes, patch)
2010-05-15 13:00 UTC, Iain Buclaw
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Brian White 2008-03-30 16:43:40 UTC
Creating and destructing an instance of Thread will cause a SEGV if nothing is done in between.

--------------------
import std.thread;
void main(char[][] argv)
{
    scope Thread t = new Thread();
    printf("never mind...\n");
}
--------------------

dragon:~/tmp> dmd dtest.d
dragon:~/tmp> ./dtest
never mind...
Segmentation fault
Comment 1 Iain Buclaw 2010-05-15 13:00:29 UTC
Created attachment 630 [details]
Fix SEGV in std.thread

This bug is present in the D1 Phobos library too. The fix is trivial in both cases, and attaching a patch.

See also Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581700
Comment 2 Lars T. Kyllingstad 2010-08-13 04:14:15 UTC
This is now D1 only.  D2 doesn't have std.thread anymore, and the problem doesn't seem to exist in core.thread.

Also:  There is no ICE (Internal Compiler Error) here, so I'm removing the ice-on-valid-code keyword.
Comment 3 Andrei Alexandrescu 2015-11-03 19:11:53 UTC
It's unlikely this D1 issue will get worked on. If it applies to D2 as well and/or if anyone plans to work on it, please reopen.