RFR(XS) 8087120: [GCC5] java.lang.StackOverflowError on Zero JVM initialization on non x86 platforms
sgehwolf at redhat.com
Wed Jun 10 13:49:21 UTC 2015
Could somebody please review this Zero only change? I'd also need a
sponsor who can push the change for me once reviewed.
The issue is that Zero relies on undefined behaviour for getting the
current stack pointer by allocating a variable on the stack and
returning its address. With GCC 5 returning an address of a local
variable will always be 0, thus causing the issue. It worked fine with
older GCC versions, because they returned the actual address of the
The fix is to use GCC's built-in function "__builtin_frame_address".
This also works on GCC 5. It's GCC specific, though. On the other hand,
I don't know if anybody builds Zero without GCC. An alternative would be
to use alloca, but that has strange semantics if the stack pointer
cannot be extended. Thoughts?
More information about the hotspot-dev