(9) RFR: 8064815 Zero+PPC64: Stack overflow when running Maven
Severin Gehwolf
sgehwolf at redhat.com
Mon Nov 17 17:00:19 UTC 2014
Hi Vladimir,
On Fri, 2014-11-14 at 09:25 -0800, Vladimir Kozlov wrote:
> So this code assumes that 'stack_used' local is allocated on stack and
> uses its address to calculated used space. But where is a guarantee
> that passed 'thread' is the current thread?
Yes, in src/cpu/zero/vm/stubGenerator_zero.cpp the stack is alloca'ed. I
don't think there is currently a guarantee that the passed thread is the
current thread. What kind of guarantee are you looking for? Any
suggestions?
Cheers,
Severin
> Thanks,
> Vladimir
>
> On 11/14/14 5:46 AM, Volker Simonis wrote:
> > Hi Severin,
> >
> > I can sponsor this change if we get one more review.
> >
> > The only comment I have is that in ZeroStack::suggest_size() there
> > doesn't seem to be a handling for the potentially negative values
> > returned by ZeroStack::abi_stack_available().
> >
> > Regards,
> > Volker
> >
> >
> > On Fri, Nov 14, 2014 at 2:18 PM, Severin Gehwolf <sgehwolf at redhat.com> wrote:
> >> Hi,
> >>
> >> Could I please get a review and sponsor for the following fix:
> >>
> >> bug: https://bugs.openjdk.java.net/browse/JDK-8064815
> >> webrev:
> >> https://jerboaa.fedorapeople.org/bugs/openjdk/JDK-8064815/webrev.0/
> >>
> >> When running Maven ("mvn") on a Zero variant build on PPC/PPC64 hardware
> >> it throws a StackOverflowError. This is because the stack bound
> >> calculation does not account for red and yellow pages.
> >>
> >> The bug has a slightly different patch attached. The changes to
> >> hotspot/src/os/linux/vm/os_linux.cpp aren't needed for this bug.
> >>
> >> Testing done: A Zero variant build of OpenJDK 9 on PPC/PPC64 throws
> >> StackOverflowError without this fix and works fine with this fix
> >> applied.
> >>
> >> Note that this problem seems to surface on architectures where pages are
> >> large. PPC is one such instance. Page size there is 64KB and Zero
> >> initially sets its minimal stack allowance to 64KB (one page),
> >> src/os_cpu/linux_zero/vm/os_linux_zero.cpp. In os::init_2 this gets
> >> potentially increased if min_stack_allowed is small. The case on PPC
> >> Zero.
> >>
> >> However, then later at runtime the calculation of available stack is
> >> wrong since it does not account for red and yellow pages. Thus it thinks
> >> there is too little stack available where in fact more stack is
> >> available.
> >>
> >> Thanks,
> >> Severin
> >>
More information about the hotspot-dev
mailing list