Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird BoundsError on threaded loops causes segfaults #27519

Closed
kozross opened this issue Jun 10, 2018 · 3 comments
Closed

Weird BoundsError on threaded loops causes segfaults #27519

kozross opened this issue Jun 10, 2018 · 3 comments
Labels
domain:multithreading Base.Threads and related functionality

Comments

@kozross
Copy link

kozross commented Jun 10, 2018

If I put this program in a file test.jl:

Threads.@threads for i in 13:33
    println(i)
end

And try to execute it with JULIA_NUM_THREADS=8 julia test.jl, I get this as output:

[koz@Sebastian complete]$ JULIA_NUM_THREADS=8 julia test.jl

Error thrown in threaded loop on thread 1: BoundsError(a=Array{Task, 1}[], i=1)
Error thrown in threaded loop on thread 3: BoundsError(a=Array{Task, 1}[], i=1)
Error thrown in threaded loop on thread 2: BoundsError(a=Array{Task, 1}[], i=1)
Error thrown in threaded loop on thread 6: BoundsError(a=Array{Task, 1}[], i=1)28
29
signal (11): Segmentation fault
while loading /home/koz/documents/uni/research/phd/simd-paper/data/complete/test.jl, in expression starting on line 1
jl_apply_generic at /usr/bin/../lib/libjulia.so.0.6 (unknown line)
unknown function (ip: 0x7ffff7740aa9)
unknown function (ip: 0xffffffffffffffff)
Allocations: 830190 (Pool: 829160; Big: 1030); GC: 0
Segmentation fault

I've never experienced this kind of issue before. What could be the cause? julia --version outputs 0.6.2, and I'm on Gentoo Linux.

@StefanKarpinski
Copy link
Sponsor Member

Unless I'm mistaken, I/O is still not threadsafe, so this is expected.

@ViralBShah ViralBShah added the domain:multithreading Base.Threads and related functionality label Jun 10, 2018
@kozross
Copy link
Author

kozross commented Jun 10, 2018

@StefanKarpinski That's extremely surprising to me, since I've done I/O in threaded loops before without these kinds of issues. Admittedly it was file I/O, but I had threaded loops with only file I/O start failing recently as well.

@yuyichao
Copy link
Contributor

Dup of #14494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:multithreading Base.Threads and related functionality
Projects
None yet
Development

No branches or pull requests

4 participants