RFR: JDK-8145788: JVM crashes with -XX:+EnableTracing

David Holmes david.holmes at oracle.com
Wed Dec 23 04:20:49 UTC 2015


Hi Yasumasa,

On 23/12/2015 11:49 AM, Yasumasa Suenaga wrote:
> Hi David,
> 
> I've added callstack when JVM crashed:
>    https://bugs.openjdk.java.net/browse/JDK-8145788?focusedCommentId=13880225&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13880225

Thanks for that.

> This crash occurrs in Arguments::apply_ergo() in Threads::create_vm().
> apply_ergo() calls before JavaThread initialization.
> 
> I think that TraceEvent can avoid crash with two approach:
> 
>    1. Initialize JavaThread before calling apply_ergo() in create_vm().

That is not likely to be an option - it would likely be far too
disruptive to the initialization sequence.

>    2. Avoid crash at TraceEvent when it is called before JavaThread initialization.

Or don't call it at all.

We will have to wait for the tracing experts to have a good look at
this. We end up in code that is not expecting to be run before more of
the VM is initialized, so we have to look at what else may be being
assumed and then decide whether to handle the situation or avoid it.

Thanks,
David

> 
> Thanks,
> 
> Yasumasa
> 
> 
> On 2015/12/22 21:19, David Holmes wrote:
>> On 19/12/2015 1:50 AM, Yasumasa Suenaga wrote:
>>> Hi all,
>>>
>>> I encountered JVM crash when I passed -XX:+EnableTracing.
>>>
>>>     I checked core image, it crashed in EventBooleanFlagChanged::writeEvent()
>>>     which is called by Arguments::apply_ergo() because thread had not been
>>>     initialized. (JVM seems to log changing GC algorithm to G1.)
>>
>> This seems like a logic error to me - something is trying to happen too
>> early during VM initialization. We need to look at exactly what we are
>> trying to do here, not just work around the crash.
>>
>> David
>> -----
>>
>>>     writeEvent() uses ResourceMark. Default constructor of ResourceMark uses
>>>     ResourceArea in current thread. So ResourceMark in writeEvent() should
>>>     pass valid ResourceArea.
>>>
>>> I think this issue is in traceEventClasses.xsl .
>>> However, my environment (GCC 5.3.1 on Fedora23) cannot build it because
>>> -Werror=maybe-uninitialized was occurred.
>>> So I also fixed them together.
>>>
>>> I've uploaded webrev. Could you review it?
>>>      http://cr.openjdk.java.net/~ysuenaga/JDK-8145788/webrev.00/
>>>
>>> I'm jdk9 committer, however I cannot access JPRT.
>>> So I need a sponsor.
>>>
>>>
>>> Thanks,
>>>
>>> Yasumasa
>>>


More information about the serviceability-dev mailing list