Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

No description provided.

@graalvmbot graalvmbot force-pushed the github/chaeubl/GR-30765 branch 4 times, most recently from f4e32cd to bed7476 Compare July 9, 2021 16:57
@graalvmbot graalvmbot force-pushed the github/chaeubl/GR-30765 branch 3 times, most recently from 19dd112 to a0c943c Compare July 31, 2021 06:57
Copy link
Member

@peter-hofer peter-hofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a lot more useful than our current diagnostic output. Thank you!

Comment on lines +44 to +49
PosixUtils.checkStatusIs0(Pthread.pthread_getattr_np(Pthread.pthread_self(), attr), "LinuxStackOverflowSupport: pthread_getattr_np");

WordPointer stackaddrPtr = StackValue.get(WordPointer.class);
WordPointer stacksizePtr = StackValue.get(WordPointer.class);
PosixUtils.checkStatusIs0(Pthread.pthread_attr_getstack(attr, stackaddrPtr, stacksizePtr), "LinuxStackOverflowSupport: pthread_attr_getstack");
PosixUtils.checkStatusIs0(Pthread.pthread_attr_destroy(attr), "LinuxStackOverflowSupport: pthread_attr_destroy");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be more fault-tolerant in the context of an segfault handler -- this method may return 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't be an issue as the stack boundaries are cached in thread-local values during thread startup. The segfault handler only accesses those thread-local values.

Comment on lines +44 to +49
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
@Override
public UnsignedWord lookupStackBase() {
int sizeOfMInfo = SizeOf.get(MemoryAPI.MEMORY_BASIC_INFORMATION.class);
MemoryAPI.MEMORY_BASIC_INFORMATION minfo = StackValue.get(sizeOfMInfo);
MemoryAPI.VirtualQuery(minfo, minfo, WordFactory.unsigned(sizeOfMInfo));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VirtualQuery can fail, we should handle that.

@graalvmbot graalvmbot force-pushed the github/chaeubl/GR-30765 branch from 58cdb66 to 7c55d0f Compare August 10, 2021 07:52
@graalvmbot graalvmbot merged commit 6ae6359 into master Aug 11, 2021
@graalvmbot graalvmbot deleted the github/chaeubl/GR-30765 branch February 8, 2022 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants