-
-
Notifications
You must be signed in to change notification settings - Fork 421
fix Issue 20497 - thread with limited stackspace crashes depending on… #2904
Conversation
|
Thanks for your pull request, @rainers! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "stable + druntime#2904" |
|
The output of the test will hopefully show what platforms are actually using the stack for TLS. |
23fa0e0 to
dfbfcca
Compare
src/core/thread/osthread.d
Outdated
| // TLS uses the top of the stack, so add its size to the requested size | ||
| sz += externDFunc!("rt.sections_elf_shared.sizeOfTLS", | ||
| size_t function() @nogc nothrow)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it better to add version(CRuntime_Glibc) here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, as FreeBsd doesn't seem to have this issue. I've added the version check.
|
Nit: In glibc, we can use |
… size of TLS on Posix systems, add the TLS size to the requested stack size for new threads
Indeed, looks like a simpler solution. When searching for it I noticed a couple of bug reports due to undefined references to this symbol. Would it raise the libc version requirements for druntime? |
… size of TLS
on Posix systems, add the TLS size to the requested stack size for new threads
related issues: