test/basic/thread_attr: increase the stack size #294
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems that 8 KB ULT stack used in
test/basic/thread_attr.c
is too little on some platforms. As far as I checked, 32-bit CentOS + clang 3.4.2 + some debugging options can sometimes cause SEGV because of stack overflow whenABT_thread_get_attr()
is called in a ULT if (seemingly) the underlying execution stream has not executedposix_memalign()
before and thusposix_memalign()
internally called byABT_thread_get_attr()
takes a slow and deep execution path. I checked the function stack and$esp
.In any case, this SEGV is annoying and should be fixed. This patch increases the size to 262144.
Note that the stack canary (#293) could not detect this issue since SEGV occurred first. We need a page protection mechanism for debugging (though it is complicated and potentially heavier).