problem with signal handling and parallel GC on linux#2813
problem with signal handling and parallel GC on linux#2813dlang-bot merged 1 commit intodlang:stablefrom
Conversation
|
Thanks for your pull request and interest in making D better, @ikod! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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#2813" |
src/gc/impl/conservative/gc.d
Outdated
|
|
||
| void scanBackground() nothrow | ||
| { | ||
| version (posix) |
rainers
left a comment
There was a problem hiding this comment.
Apart from nits, LGTM.
Please squash commits.
src/gc/impl/conservative/gc.d
Outdated
| version (Posix) | ||
| { | ||
| import core.sys.posix.signal; | ||
| // block all signals, scanThread inherits this mask. |
There was a problem hiding this comment.
I guess you mean scanBackground here.
test/gc/sigmaskgc.d
Outdated
| sigaddset(&m, SIGHUP); | ||
|
|
||
| auto x = new int[](10000); | ||
| for (int i=0; i<10000; i++) |
There was a problem hiding this comment.
code style nit: for (int i = 0; i < 10000; i++)
There was a problem hiding this comment.
Bonus for foreach (i; 0 .. 10000)
test/gc/sigmaskgc.d
Outdated
| auto parent_pid = getpid(); | ||
| auto child_pid = fork(); | ||
| assert(child_pid >= 0); | ||
| if ( child_pid == 0 ) |
|
Thanks! |
Issue https://issues.dlang.org/show_bug.cgi?id=20256
Conservative GC scan threads do not block signals when created, which can lead to unexpected behaviour if developer have to block signals for whole process.
This PR fix issue by blocking all signals in conservative GC scanThreads.