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

Increase the signal stack size on AArch64 #14700

Merged
merged 2 commits into from
Jan 20, 2016
Merged

Increase the signal stack size on AArch64 #14700

merged 2 commits into from
Jan 20, 2016

Conversation

yuyichao
Copy link
Contributor

The default size is too small for libunwind and causes a stack overflow. (The symptom is error/segfault on exit due to random corruption of heap memory, a lot of the time a segfault in __cxa_finalize).

Also add a guard page to the signal stack making it easier to detect such problems in the future. (Segfault instead of weird corruption...)

P.S. The default size for linux x86_64 is also quite small (8k), I'm a little surprised that our signal handler works fine in such a shallow stack....

c.c. @vtjnash

@yuyichao
Copy link
Contributor Author

The new value (64k) is simply copied from JL_USE_INTEL_JITEVENTS and it seems to be big enough. I'm wondering if we should just make this the default everywhere....

@yuyichao yuyichao added the system:arm ARMv7 and AArch64 label Jan 17, 2016
@ViralBShah
Copy link
Member

With all the work on Aarch64, is there a way to at least test the build regularly? Perhaps we should set up cross compilation on travis? Through qemu we can at least have a couple of simple tests run.

Is anyone aware of a service like @scaleway that will provide Aarch64 machines? Scaleway only seems to have 32-bit, although I suspect they should add 64-bit at some point naturally.

@yuyichao
Copy link
Contributor Author

Also use a separate function to unblock the signal in order to save some stack space (sigset_t is quite large (128bytes)). Note that this alone doesn't really solve the stack overflow on AArch64 though.

@ViralBShah Maybe https://www.datacentred.co.uk/ ? Not quite the same and more expensive than scaleway if you want to use it all the time (even for the cheapest option). Also couldn't find what hardware they are using.

With this patch merged (which somehow mainly causes issue with parallel testing....) the compilation takes ~20min and the whole test suite (with a few tests disabled) takes ~30min to run on my board so it's not too bad for me to run it every night right now.

The default size is too small for libunwind and causes a stack overflow.
Also add a guard page to the signal stack making it easier to detect such
problems in the future. (Segfault instead of weird corruption...)

[av skip]
This should save some stack space by creating the sigset_t in a separate scope.

[av skip]
yuyichao added a commit that referenced this pull request Jan 20, 2016
Increase the signal stack size on AArch64
@yuyichao yuyichao merged commit a75d03c into master Jan 20, 2016
@yuyichao yuyichao deleted the yyc/sigstack branch January 20, 2016 05:15
@tkelman
Copy link
Contributor

tkelman commented Jan 20, 2016

broken on mac?

In file included from /Users/osx/buildbot/slave/build_osx10_9-x64/build/src/signal-handling.c:46:
./signals-unix.c:297:58: error: use of undeclared identifier 'MAP_ANONYMOUS'
                           MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jan 20, 2016

mac uses the other name (MAP_ANON), although it looks like 10.11 may have added MAP_ANONYMOUS as a synonym

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:arm ARMv7 and AArch64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants