RFR: JDK-8160361: SEGV occurred at JNIHandleBlock::oops_do(OopClosure*)

Coleen Phillimore coleen.phillimore at oracle.com
Mon Jun 27 21:41:27 UTC 2016



On 6/27/16 2:24 PM, Kim Barrett wrote:
>> On Jun 27, 2016, at 1:02 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:
>>
>>
>>
>> On 6/27/16 11:25 AM, Yasumasa Suenaga wrote:
>>> Thanks Thomas!
>>>
>>> Yasumasa
>>>
>>> On 2016/06/28 0:17, Thomas Schatzl wrote:
>>>> Hi,
>>>>
>>>> On Mon, 2016-06-27 at 23:38 +0900, Yasumasa Suenaga wrote:
>>>>> Hi all,
>>>>>
>>>>> This review request relates to JDK-8160310: HotSpot cannot be built
>>>>> with GCC 6 .
>>>>>
>>>>> I encountered VM crash when I compiled OpenJDK 9 with GCC 6
>>>>> on Fedora 24 x64.
>>>>>
>>>>> This crash was occurred in fastdebug JVM which was built by GCC 6.
>>>>> I'm not sure this crash relates to GCC 6, but I think NULL check
>>>>> should be added
>>>>> at this point.
>>>>>
>>>>> I uploaded webrev.
>>>>> Could you review it?
>>>>>
>>>>>    http://cr.openjdk.java.net/~ysuenaga/JDK-8160361/webrev.00/
>>>>>
>>>>>
>>>>> I'm jdk 9 committer, but I cannot access JPRT.
>>>>> So I need a sponsor.
>>>>   looks good to me. Not sure why it did not crash earlier, as the
>>>> _handles member has always been allowed to be NULL (from what I
>>>> understand).
>> I was wondering this too.  If there are no resolved_references, and now modules, it should be null.  Maybe with modules, that's less likely?
> Me too.  The suggested change seems correct, but I’m concerned there’s
> something we're missing.  How did the existing code ever work, and what
> changed so that the reported error occurred?

It's the code in JNIHandleBlock::oops_do that's called for this, and 
NULL just quick exits.

Add this code:

145      if (_handles == NULL) {
146        tty->print_cr("NULL");
147      }
148      _handles->oops_do(f);

break at 146 then trace:

146        tty->print_cr("NULL");
(gdb) n
NULL
148      _handles->oops_do(f);
(gdb) s
JNIHandleBlock::oops_do (this=0x0, f=0x7fff28000ed8)
     at 
/home/cphillim/hg.local/jdk9.redef029/hotspot/src/share/vm/runtime/jniHandles.cpp:350
350    void JNIHandleBlock::oops_do(OopClosure* f) {
(gdb)
351      JNIHandleBlock* current_chain = this;
(gdb)
354      while (current_chain != NULL) {
(gdb)
375    }


The change is still an improvement, but now the question is why does it 
crash with GCC 6.

thanks,
Coleen

>
>> Coleen
>>
>>>> Thanks,
>>>>   Thomas
>



More information about the hotspot-dev mailing list