[jdk8u-dev] RFR: 8250825: C2 crashes with assert(field != __null) failed: missing field [v2]

SendaoYan syan at openjdk.org
Wed Aug 28 03:22:24 UTC 2024


On Wed, 28 Aug 2024 00:31:07 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:

>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   implement Unsafe.getUnsafe() in jdk8u
>
> hotspot/src/share/vm/opto/type.cpp line 2561:
> 
>> 2559:             BasicType basic_elem_type = field->layout_type();
>> 2560:             _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
>> 2561:                                                        basic_elem_type == T_ARRAY);
> 
> This line hasn't been adjusted to line up with the one above.
> 
> Are you not backporting from the 11u patch? That also doesn't have JDK-8230505 and would match your patch exactly if not for this misaligned line.
> 
> This is the 11u version:
> 
> ~~~
> -          assert(field != NULL, "missing field");
> -          BasicType basic_elem_type = field->layout_type();
> -          _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
> -                                                       basic_elem_type == T_ARRAY);
> +          if (field != NULL) {
> +            BasicType basic_elem_type = field->layout_type();
> +            _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
> +                                                         basic_elem_type == T_ARRAY);
> +          } else {
> +            // unsafe access
> +            _is_ptr_to_narrowoop = UseCompressedOops;
> +          }
> ~~~

No, I was backported from jdk trunk repo. But I think line 2561 is not misaligned line, it just a github code display style issue. The below screenshot can explain the difference. The left side shows this PR change, the right side shows the jdk11u-dev change of JDK-8250825. I think the change is equivalent.

![image](https://github.com/user-attachments/assets/479e94da-7984-4d8a-9b2c-5a6832e5c2e2)

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

PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/552#discussion_r1733922166


More information about the jdk8u-dev mailing list