RFR: 8038925: Java 7 with G1 crashes in dump_instance_fields using jmap or jcmd without fullgc

Vladimir Kempik vladimir.kempik at oracle.com
Mon Apr 28 14:04:00 UTC 2014


Hello

I've had a similar bug with G1 a while ago (Crash in build 1.7.0_40-b43 
when using g1 and heapdumpbeforefullgc. ).
I did lots of hotspot builds to find out when it started and stopped to 
appear.
The changeset to introduce my bug was 
http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/aaf61e68b25
  and the changeset to stop the crash were - 
http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/da91efe96a93

That's permgen removal.

Also the workaround was - -XX:-ResizePLAB.

I have a reproducer for my bug and this fix for 8038925 does fix it.

Thanks.
On 25.04.2014 17:57, Andreas Eriksson wrote:
> I saw no obvious reason why it doesn't reproduce on jdk8 or jdk9.
> Maybe someone with better knowledge of G1 can say.
> Could it have something to do with the metaspace rewrites?
>
> /Andreas
>
> On 2014-04-25 15:21, Andreas Eriksson wrote:
>> In addition, this particular test doesn't reproduce on jdk8 or jdk9 
>> for some reason.
>> I will take a quick look and see if I can spot why.
>>
>> /Andreas
>>
>> On 2014-04-25 15:14, Mikael Gerdin wrote:
>>> On Friday 25 April 2014 14.53.29 Thomas Schatzl wrote:
>>>> Hi,
>>>>
>>>> On Fri, 2014-04-25 at 14:17 +0200, Andreas Eriksson wrote:
>>>>> Hi,
>>>>>
>>>>> Could I have a review for this G1 jdk7 only fix please?
>>>>    why is this change only necessary for jdk7?
>>> The idea was that for 9 and 8u40+ we will need a separate way to 
>>> handle this
>>> anyway due to class unloading (as previously discussed).
>>>
>>> We may or may not want to get this fix into 8u20, I'd like to hear 
>>> your input
>>> on that Thomas.
>>>
>>> /Mikael
>>>
>>>>> Description:
>>>>> When using G1 and doing a heap dump while no fullgc has been done,
>>>>> hotspot crashes.
>>>>> This is because G1CollectedHeap::safe_object_iterate uses
>>>>> ContiguousSpace::object_iterate_from, which does not avoid dead 
>>>>> objects
>>>>> that can still be on the heap when using G1.
>>>>>
>>>>> The fix adds a G1 specific safe_object_iterate code path that avoids
>>>>> dead objects.
>>>>>
>>>>> http://cr.openjdk.java.net/~aeriksso/8038925/webrev.00/
>>>>> https://bugs.openjdk.java.net/browse/JDK-8038925
>>>>>
>>>>> Thanks to Mikael Gerdin for his help with this.
>>>> Thanks,
>>>> Thomas
>>
>




More information about the hotspot-gc-dev mailing list