[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8294370: Fix allocation bug in java_lang_Thread::async_get_stack_trace()
From:       Patricio Chilano Mateo <pchilanomate () openjdk ! org>
Date:       2022-09-29 15:38:49
Message-ID: 8SL4dWPsOCNogjLSsa0QFR9mh-n3n5TVbriMfmtXU1E=.616f0158-50f5-427d-927d-4577ef9a8251 () github ! com
[Download RAW message or body]

On Mon, 26 Sep 2022 14:23:38 GMT, Patricio Chilano Mateo <pchilanomate@openjdk.org> \
wrote:

> Please review this small fix in async_get_stack_trace(). The GrowableArrays created \
> to store the bci and Method* of each frame found while traversing the stack are \
> allocated in the resource area of the thread that calls async_get_stack_trace(). \
> But if the handshake is executed by the target and if the number of frames in the \
> stack exceeds the initial size of the GrowableArrays then we will hit an assertion \
> when trying to grow the size of the arrays (see bug description). Currently we \
> don't see any issues because the initial size of the GrowableArrays is 512 and our \
> tests don't test beyond that (the maximum value of DEPTH in the \
> vmTestbase/nsk/stress/strace/ tests is 500). The issue can be easily reproduced by \
> either decreasing the initial size of the GrowableArrays or by increasing the value \
> of DEPTH in those strace tests. To fix it I allocated the arrays in the C heap \
> instead. Also I lowered the initial size of the arrays since 512 seemed too much to \
> start with. Tested it by running all tests in the vmTestbase/nsk/stress/strace/ \
> directory. 
> Thanks,
> Patricio

This pull request has now been integrated.

Changeset: 5d48da45
Author:    Patricio Chilano Mateo <pchilanomate@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/5d48da4574f6aacb0db445dd5750566330aa383d
                
Stats:     11 lines in 1 file changed: 6 ins; 0 del; 5 mod

8294370: Fix allocation bug in java_lang_Thread::async_get_stack_trace()

Reviewed-by: dholmes, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/10424


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic