Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failed at omr/compiler/codegen/CodeGenRA.cpp:106: !regsAreLive #20824

Open
cjjdespres opened this issue Dec 12, 2024 · 3 comments
Open

Comments

@cjjdespres
Copy link
Contributor

I was attempting to build the acmeair sample application with a debug compiler build, and got:

+ featureUtility installServerFeatures --acceptLicense defaultServer --noCache
Assertion failed at /home/despresc/dev/openj9-openjdk-jdk21/omr/compiler/codegen/CodeGenRA.cpp:106: !regsAreLive
VMState: 0x0005ff04
	Virtual or real registers are live at end of method
compiling java/util/Arrays.hashCode([B)I at level: warm

Unhandled exception
Type=Unhandled trap vmState=0x0005ff04
J9Generic_Signal_Number=00000108 Signal_Number=00000005 Error_Value=00000000 Signal_Code=fffffffa
Handler1=00007F73B94E3840 Handler2=00007F73B9053520
RDI=000000000000000E RSI=0000000000000014 RAX=0000000000000000 RBX=00007F73B39EE8DA
RCX=00007F73BA356A6C RDX=0000000000000005 R8=00007F73B39EE8CD R9=00007F73BA47BD40
R10=00007F73BA47BC40 R11=0000000000000246 R12=0000000000000005 R13=0000000000000004
R14=00007F73B39EE8CD R15=00007F73B39EE882
RIP=00007F73BA356A6C GS=0000 FS=0000 RSP=00007F73A823BB30
EFlags=0000000000000246 CS=0033 RBP=0000000000000014 ERR=0000000000000000
TRAPNO=0000000000000000 OLDMASK=0000000000000000 CR2=0000000000000000
xmm0=0000003000000020 (f: 32.000000, d: 1.018558e-312)
xmm1=0000003000000010 (f: 16.000000, d: 1.018558e-312)
xmm2=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm3=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm4=4000000000000000 (f: 0.000000, d: 2.000000e+00)
xmm5=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm6=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm7=00007f73a8240e48 (f: 2820935168.000000, d: 6.923575e-310)
xmm8=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm9=6c6c131fc46c3a45 (f: 3295427072.000000, d: 1.890262e+214)
xmm10=070f032018020d1e (f: 402787616.000000, d: 1.119661e-274)
xmm11=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm12=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm13=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm14=0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm15=0000000000000000 (f: 0.000000, d: 0.000000e+00)
Module=/lib64/libc.so.6
Module_base_address=00007F73BA2CB000

Method_being_compiled=java/util/Arrays.hashCode([B)I
Target=2_90_20241210_000000 (Linux 4.18.0-553.27.1.el8_10.x86_64)
CPU=amd64 (8 logical CPUs) (0x7c7916000 RAM)
----------- Stack Backtrace -----------
__pthread_kill_implementation+0x11c (0x00007F73BA356A6C [libc.so.6+0x8ba6c])
raise+0x16 (0x00007F73BA309686 [libc.so.6+0x3e686])
_ZN2TR4trapEv+0x4c (0x00007F73B356C09C [libj9jit29.so+0x58809c])
 (0x00007F73B356C1AB [libj9jit29.so+0x5881ab])
 (0x00007F73B356C197 [libj9jit29.so+0x588197])
_ZN3OMR12CodeGenPhase32performInstructionSelectionPhaseEPN2TR13CodeGeneratorEPNS1_12CodeGenPhaseE+0x10c (0x00007F73B350877C [libj9jit29.so+0x52477c])
_ZN3OMR12CodeGenPhase10performAllEv+0xcd (0x00007F73B350980D [libj9jit29.so+0x52580d])
_ZN3OMR13CodeGenerator12generateCodeEv+0x89 (0x00007F73B3501AE9 [libj9jit29.so+0x51dae9])
_ZN3OMR11Compilation7compileEv+0x94c (0x00007F73B352567C [libj9jit29.so+0x54167c])
_ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadPNS_11CompilationEP17TR_ResolvedMethodR11TR_J9VMBaseP19TR_OptimizationPlanRKNS_16SegmentAllocatorE+0xbe4 (0x00007F73B312E674 [libj9jit29.so+0x14a674])
_ZN2TR28CompilationInfoPerThreadBase14wrappedCompileEP13J9PortLibraryPv+0x6d2 (0x00007F73B312B422 [libj9jit29.so+0x147422])
omrsig_protect+0x398 (0x00007F73B9051FB8 [libj9prt29.so+0x25fb8])
_ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadP21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x47b (0x00007F73B3124A5B [libj9jit29.so+0x140a5b])
_ZN2TR24CompilationInfoPerThread12processEntryER21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x2fc (0x00007F73B3123BAC [libj9jit29.so+0x13fbac])
_ZN2TR24CompilationInfoPerThread14processEntriesEv+0x2b4 (0x00007F73B3122A84 [libj9jit29.so+0x13ea84])
_ZN2TR24CompilationInfoPerThread3runEv+0x69 (0x00007F73B3122789 [libj9jit29.so+0x13e789])
_Z30protectedCompilationThreadProcP13J9PortLibraryPN2TR24CompilationInfoPerThreadE+0x13a (0x00007F73B312259A [libj9jit29.so+0x13e59a])
omrsig_protect+0x398 (0x00007F73B9051FB8 [libj9prt29.so+0x25fb8])
_Z21compilationThreadProcPv+0x2bc (0x00007F73B31208EC [libj9jit29.so+0x13c8ec])
thread_wrapper+0x237 (0x00007F73B8E22277 [libj9thr29.so+0xb277])
start_thread+0x2d2 (0x00007F73BA354D22 [libc.so.6+0x89d22])
clone+0x44 (0x00007F73BA3D9034 [libc.so.6+0x10e034])

This happened while building a docker container, sadly, so none of the dumps were created. I'll try building outside of containers to see if I can get something useful.

Copy link

Issue Number: 20824
Status: Open
Recommended Components: comp:jit, comp:vm, comp:gc

@cjjdespres
Copy link
Contributor Author

The jit dump was saved outside of containers, and I can see (logs abbreviated)

============================================================
; Live regs: GPR=2 FPR=0 VRF=0 {GPR_0x7fed5010dba0, &GPR_0x7fed5010d480}
------------------------------
 n35n     (  0)  treetop                                                                              [0x7fed50005330] bci=[-1,56,4516] rc=0 vc=212 vn=- li=7 udi=- nc=1
 n34n     (  2)    icall  jdk/internal/util/ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I[#423  static Method] [flags 0x500 0x0 ] ()  [0x7fed500052e0] bci=[-1,56,4516] rc=2 vc=212 vn=- li=7 udi=- nc=5 flg=0x20
 n71n     (  1)      ==>aRegLoad (in &GPR_0x7fed5010d480) (X!=0 SeenRealReference )
 n28n     (  1)      iconst 0 (X==0 X>=0 X<=0 )                                                       [0x7fed50005100] bci=[-1,50,4516] rc=1 vc=212 vn=- li=7 udi=- nc=0 flg=0x302
 n30n     (  1)      ==>iloadi (in GPR_0x7fed5010dba0) (X>=0 cannotOverflow )
 n32n     (  1)      iconst 1 (X!=0 X>=0 )                                                            [0x7fed50005240] bci=[-1,53,4516] rc=1 vc=212 vn=- li=7 udi=- nc=0 flg=0x104
 n33n     (  1)      iconst 8 (X!=0 X>=0 )                                                            [0x7fed50005290] bci=[-1,54,4516] rc=1 vc=212 vn=- li=7 udi=- nc=0 flg=0x104
------------------------------
------------------------------
 n35n     (  0)  treetop                                                                              [0x7fed50005330] bci=[-1,56,4516] rc=0 vc=212 vn=- li=7 udi=- nc=1
 n34n     (  1)    icall  jdk/internal/util/ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I[#423  static Method] [flags 0x500 0x0 ] (in GPR_0x7fed5010e160) ()  [0x7fed500052e0] bci=[-1,56,4516] rc=1 vc=212 vn=- li=7 udi=57696 nc=5 flg=0x20
 n71n     (  0)      ==>aRegLoad (in &GPR_0x7fed5010d480) (X!=0 SeenRealReference )
 n28n     (  0)      iconst 0 (X==0 X>=0 X<=0 )                                                       [0x7fed50005100] bci=[-1,50,4516] rc=0 vc=212 vn=- li=7 udi=- nc=0 flg=0x302
 n30n     (  0)      ==>iloadi (in GPR_0x7fed5010dba0) (X>=0 cannotOverflow )
 n32n     (  0)      iconst 1 (in GPR_0x7fed5010df10) (X!=0 X>=0 )                                    [0x7fed50005240] bci=[-1,53,4516] rc=0 vc=212 vn=- li=7 udi=57104 nc=0 flg=0x104
 n33n     (  0)      iconst 8 (X!=0 X>=0 )                                                            [0x7fed50005290] bci=[-1,54,4516] rc=0 vc=212 vn=- li=7 udi=- nc=0 flg=0x104
------------------------------

................

 [0x7fed501a4560]       assocreg                        # assocreg
        POST: [&GPR_0x7fed5010d480 : eax]
 [0x7fed501a4320]       Label L0078:                    # label
        POST: [GPR_0x7fed5010e160 : NoReg] [&GPR_0x7fed5010d480 : NoReg] [GPR_0x7fed5010e0a0 : NoReg] [GPR_0x7fed5010e220 : NoReg] [GPR_0x7fed5010df10 : NoReg] [GPR_0x7fed5010dba0 : NoReg]

============================================================
; Live regs: GPR=1 FPR=0 VRF=0 {GPR_0x7fed5010e160}     
------------------------------
 n60n     (  0)  ireturn                                                                              [0x7fed50080280] bci=[-1,59,4513] rc=0 vc=212 vn=- li=7 udi=- nc=1
 n34n     (  1)    ==>icall (in GPR_0x7fed5010e160) ()
------------------------------
------------------------------  
 n60n     (  0)  ireturn                                                                              [0x7fed50080280] bci=[-1,59,4513] rc=0 vc=212 vn=- li=7 udi=- nc=1
 n34n     (  0)    ==>icall (in GPR_0x7fed5010e160) ()  
------------------------------  
 
 [0x7fed501a5f50]       assocreg                        # assocreg
        POST: [&GPR_0x7fed5010d480 : eax]
 [0x7fed501a5d30]       ret                             # RET
         PRE: [GPR_0x7fed5010e160 : eax]
 
============================================================
; Live regs: GPR=1 FPR=0 VRF=0 {GPR_0x7fed5010e160}
------------------------------  
 n62n     (  0)  BBEnd </block_7> =====                                                               [0x7fed50080320] bci=[-1,59,4513] rc=0 vc=212 vn=- li=7 udi=- nc=0
------------------------------  
------------------------------  
 n62n     (  0)  BBEnd </block_7> =====                                                               [0x7fed50080320] bci=[-1,59,4513] rc=0 vc=212 vn=- li=7 udi=- nc=0
------------------------------

 [0x7fed501a6090]       fence Relative [ 00007FED500501D4 ]     # fence BBEnd </block_7>
 [0x7fed501a62c0]       assocreg                        # assocreg
        POST: [GPR_0x7fed5010e160 : eax]
 [0x7fed501a63a0]       Label L0080:                    # label

................

Virtual register GPR_0x7fed5010e160 (for node [0x7fed500052e0], ref count=0) is live at end of method
Assertion failed at /home/despresc/dev/openj9-openjdk-jdk21/omr/compiler/codegen/CodeGenRA.cpp:106:!regsAreLive:
Virtual or real registers are live at end of method

The register GPR_0x7fed5010e160 remains live in the instruction selection logs but is otherwise unmentioned.

I think support for jdk/internal/util/ArraysSupport.vectorizedHashCode was added in #20031. @BradleyWood Do you think this might be specific to this one function?

@BradleyWood
Copy link
Member

Yes. Its a minor issue with a simple fix. node->setRegister(result); was accidentally called twice, causing the CodeGen to think two nodes own that register.

BradleyWood added a commit to BradleyWood/openj9 that referenced this issue Dec 16, 2024
The result register from inline vectorizedHashCode
implementation is marked as live at the end of the method.
The call node->setRegister(result) should not happen twice.

Issue: eclipse-openj9#20824

Signed-off-by: Bradley Wood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants