D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8849 - std.parallelism.executeInNewThread with thread priority segfaults
Summary: std.parallelism.executeInNewThread with thread priority segfaults
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-18 10:48 UTC by Ali Cehreli
Modified: 2012-10-18 23:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ali Cehreli 2012-10-18 10:48:51 UTC
import std.parallelism;

void foo()
{}

void main() {
   auto t = task!foo();
   t.executeInNewThread(1);
}

Output from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x0000003016e0839b in pthread_getschedparam () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.5.x86_64
(gdb) bt
#0  0x0000003016e0839b in pthread_getschedparam () from /lib64/libpthread.so.0
#1  0x0000000000458cd0 in core.thread.Thread.priority() ()
#2  0x0000000000000000 in ?? ()

Compiling with -m32 causes the same issue with better backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0011844d in pthread_getschedparam () from /lib/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.5.i686
(gdb) bt
#0  0x0011844d in pthread_getschedparam () from /lib/libpthread.so.0
#1  0x08095253 in core.thread.Thread.priority() ()
#2  0x08092f1e in std.parallelism.TaskPool.__ctor() ()
#3  0x080873df in std.parallelism.Task!(foo).Task.executeInNewThread (this=0xf7ee5fe0, priority=1) at /usr/include/d/dmd/phobos/std/parallelism.d:753
#4  0x08086ae1 in D main () at deneme.d:102585
#5  0x0808f564 in rt.dmain2.main() ()
#6  0x0808f074 in rt.dmain2.main() ()
#7  0x0808f5a6 in rt.dmain2.main() ()
#8  0x0808f074 in rt.dmain2.main() ()
#9  0x0808f024 in main ()
Comment 1 github-bugzilla 2012-10-18 23:19:38 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/d4cce7be56a76c117ded75829d69e6b8603944f9
Fixes Issue 8849:  std.parallelism.executeInNewThread with thread priority segfaults

https://github.com/D-Programming-Language/phobos/commit/f230a1653fdf412265d54e360563f64fb981abfd
Merge pull request #881 from dsimcha/master

Fix Issue 8849