JDK-8160363: assert(discovered->is_oop_or_null()) failed: Expected an oop or NULL for discovered field at 0x0000000000000000

Kim Barrett kim.barrett at oracle.com
Mon Jun 27 20:24:43 UTC 2016


> On Jun 27, 2016, at 10:41 AM, Yasumasa Suenaga <yasuenag at gmail.com> 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.
> 
> Address of pointer was expected (0x0), however is_oop_or_null() did not work.
> I do not understand why current code did not work, however it works fine as below:
> 
>  http://cr.openjdk.java.net/~ysuenaga/JDK-8160363/webrev.00/

The change consists of:
src/share/vm/oops/oop.inline.hpp
 542   return this == NULL ? true : is_oop(ignore_mark_word);
replaced by
 542   return (this == NULL) || is_oop(ignore_mark_word);

The expression "this == NULL" can be assumed to be false, since
invocation of the member function on a null pointer is undefined
behavior.

I have no idea why the code change affects behavior.  I would expect
in either case that this would be treated as just calling is_oop.
Indeed, the whole concept of is_oop_or_null seems broken.  I filed:
https://bugs.openjdk.java.net/browse/JDK-8160399

I suspect this problem is also arising due to the missing build system
changes for gcc 6 from Andrew Hughes that I mentioned in the
discussion of JDK-8160357. I suspect a missing
-fno-delete-null-pointer-checks is the problem here.



More information about the hotspot-dev mailing list