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

Returning thread from proc segfaults on Linux #17136

Open
konsumlamm opened this issue Feb 21, 2021 · 0 comments
Open

Returning thread from proc segfaults on Linux #17136

konsumlamm opened this issue Feb 21, 2021 · 0 comments

Comments

@konsumlamm
Copy link
Contributor

Example

proc newThread(tp: proc () {.thread.}): Thread[void] =
  createThread(result, tp)

proc test() {.thread.} = echo "test"

let tid = newThread(test)
tid.joinThread

Current Output

No stack traceback available
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)

Expected Output

test

Additional Information

$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-02-20
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: ac82be07d8ed9795caa0778f0f8577b3934d1d86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants