-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
SIGSEV encountered when creating threads in a loop w/ --gc:arc #13935
Comments
Hi, |
@cooldome - sure I'm using clang / clang++ and OS is macOS Mojave 10.14.6 (18G103) |
Hmm, I am using the same and it works for me. Looks like I can't help. |
@cooldome I can reproduce this behaviour with -d:release (or -d:danger), in debug build it just hangs forever, I'm on Linux amd64 (Bedrock Linux) on latest devel, maybe I can help you debug this? I compile and run like Seems like it hangs if I compile with --stacktrace:on and if I compile with --stacktrace:off (or with -d:release or -d:danger) it crashes. |
gdb backtrace after
|
@cooldome I just checked and I have the same behaviour with your #13897 :
And GDB:
|
Yes, I can replicate it now. I found that it works if you compile with cpp I also found it works with old nim 1.1.1 built on 2019-12-09 so it is some kind of regression likely exception handling related. |
Also tried running with
that sysassert comes from mmdisp.nim line 87:
P.S.: It just works (:tm: ) if I comment line 867 in alloc.nim: |
@Yardanico that assertion is simply wrong for ARC. |
@cooldome confirmed that if I compile with |
@Araq it still seems to be broken on devel - hangs without --stackTrace:off and crashed with it |
Some logs:
|
|
Simplified example: var threads: array[5, Thread[void]]
proc threadFn() {.thread.} =
discard
proc main =
for i in 0 ..< 5:
createThread(threads[i], threadFn)
joinThreads(threads)
main() |
With
Without it crashes with:
|
For me this works
But I'm on Windows. |
@Araq maybe we can add it as a test-case for ARC to see where it fails and where it works? |
SIGSEV encountered when creating threads in a loop w/
--gc:arc
.Example
Current output
Additional Information
https://gist.github.com/zacharycarter/dbee66c50a6c26e7f187512235c4ed1f
The text was updated successfully, but these errors were encountered: