RFR: 8326936: RISC-V: Shenandoah GC crashes due to incorrect atomic memory operations [v2]

MaxXing duke at openjdk.org
Thu Feb 29 14:21:43 UTC 2024


On Thu, 29 Feb 2024 07:10:17 GMT, MaxXing <duke at openjdk.org> wrote:

>> Hi, When I use this patch, it doesn't compile, and reports the following error msg:
>> 
>> /home/zifeihan/jdk/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp:190:27: note: the comparison reduces to ‘(1 >= 8)’
>>   190 |   STATIC_ASSERT(byte_size >= 8);
>> /home/zifeihan/jdk/src/hotspot/share/utilities/debug.hpp:289:44: note: in definition of macro ‘STATIC_ASSERT’
>>    ... (rest of output omitted)
>> * For target hotspot_variant-server_libjvm_objs_arraycopynode.o:
>> In file included from /home/zifeihan/jdk/src/hotspot/share/memory/allocation.hpp:29,
>>                  from /home/zifeihan/jdk/src/hotspot/share/classfile/classLoaderData.hpp:28,
>>                  from /home/zifeihan/jdk/src/hotspot/share/precompiled/precompiled.hpp:34:
>> /home/zifeihan/jdk/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp: In instantiation of ‘T Atomic::PlatformCmpxchg<byte_size>::operator()(volatile T*, T, T, atomic_memory_order) const [with T = unsigned char; long unsigned int byte_size = 1]’:
>> /home/zifeihan/jdk/src/hotspot/share/runtime/atomic.hpp:1026:40:   required from ‘T Atomic::CmpxchgImpl<T, T, T, typename std::enable_if<std::is_integral<_Tp>::value, void>::type>::operator()(volatile T*, T, T, atomic_memory_order) const [with T = unsigned char; typename std::enable_if<std::is_integral<_Tp>::value, void>::type = void]’
>> /home/zifeihan/jdk/src/hotspot/share/runtime/atomic.hpp:1002:32:   required from ‘static D Atomic::cmpxchg(volatile D*, U, T, atomic_memory_order) [with D = unsigned char; U = unsigned char; T = unsigned char]’
>> /home/zifeihan/jdk/src/hotspot/share/oops/methodData.hpp:216:46:   required from here
>> /home/zifeihan/jdk/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp:190:27: error: static assertion failed: byte_size >= 8
>>   190 |   STATIC_ASSERT(byte_size >= 8);
>> /home/zifeihan/jdk/src/hotspot/share/utilities/debug.hpp:289:44: note: in definition of macro ‘STATIC_ASSERT’
>>   289 | #define STATIC_ASSERT(Cond) static_assert((Cond), #Cond)
>>       |                                            ^~~~
>> /home/zifeihan/jdk/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp:190:27: note: the comparison reduces to ‘(1 >= 8)’
>>   190 |   STATIC_ASSERT(byte_size >= 8);
>> /home/zifeihan/jdk/src/hotspot/share/utilities/debug.hpp:289:44: note: in definition of macro ‘STATIC_ASSERT’
>>    ... (rest of output omitted)
>> * For target hotspot_variant-server_libjvm_objs_assembler.o:
>> In file included from /home/zifeihan/jdk/src/hotspot/share/memory/alloc...
>
> @zifeihan 
> 
> Sorry for that, I fixed this assertion in the latest commit. Now it should compile. Please let me know if not.

> @MaxXSoft Thanks for fix that. I tried the latest version and everything works well with the build. And the tier1 test is working fine.

@zifeihan Happy to hear that. Thanks for your testing!

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

PR Comment: https://git.openjdk.org/jdk/pull/18039#issuecomment-1971243990


More information about the hotspot-runtime-dev mailing list