I've been running an s390x docker image on a master build (with latest s390x commit from Apr 23) of user mode qemu-s390x-static with some debug logging on:
$ sudo docker run -e QEMU_CPU="qemu" -e QEMU_LOG="unimp,guest_errors" -e QEMU_LOG_FILENAME="/s390x/qemu_s390x.log"
Hi @davidhildenbrand, I'm on the same team as @nam121 and I've been looking at this issue as well.
I think this is the same issue as: https:/ /github. com/multiarch/ qemu-user- static/ issues/ 129
I've been running an s390x docker image on a master build (with latest s390x commit from Apr 23) of user mode qemu-s390x-static with some debug logging on:
$ sudo docker run -e QEMU_CPU="qemu" -e QEMU_LOG= "unimp, guest_errors" -e QEMU_LOG_ FILENAME= "/s390x/ qemu_s390x. log"
I ran a simple java program with:
$ java -Xcomp -XX:+UnlockDiag nosticVMOptions -XX:+PrintAssembly -XX:PrintAssemb lyOptions= hsdis-print- bytes -XX:+LogCompilation -XX:LogFile= java_compilatio n_log.log Main > java_out.txt
and the qemu log contained just one line:
unimplemented opcode 0x0000
Note that if the JIT is turned off with 'java -Xint', then all programs I've tried run without problem.
The hs_err file reports a SIGILL in the same spot as in the other comments:
--- SNIP 6d7680, pid=208, tid=211 9-Ubuntu- 0ubuntu1. 20.04) 9-Ubuntu- 0ubuntu1. 20.04, compiled mode, tiered, compressed oops, g1 gc, linux-s390x) String. hashCode( )I java.base (49 bytes) @ 0x00000040126d7680 [0x00000040126d 7640+0x00000000 00000040] 26d7680)
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x0000004012
#
# JRE version: OpenJDK Runtime Environment (11.0.10+9) (build 11.0.10+
# Java VM: OpenJDK 64-Bit Server VM (11.0.10+
# Problematic frame:
# J 9 c1 java.lang.
--- SNIP
--- SNIP
Instructions: (pc=0x000000401
0x00000040126d7580: 00000040 5f5f4140 00000040 5f5f4140
0x00000040126d7590: 00000040 5f5f4140 00000040 5f5f4140
0x00000040126d75a0: 00000040 5f5f4358 00000040 5f5f4358
0x00000040126d75b0: 00000040 5f5f4358 00000040 5f5f4358
0x00000040126d75c0: 00000040 5f5f4140 00000040 5f5f4140
0x00000040126d75d0: 00000000 00000000 ffffffff ffffffff
0x00000040126d75e0: 00000040 5f5f4140 00000000 00000000
0x00000040126d75f0: ffffffff ffffffff 00000040 5f3fb9d0
0x00000040126d7600: 00000040 12238c00 00000040 12232800
0x00000040126d7610: 00000040 5f3fef18 00000040 12238c00
0x00000040126d7620: 00000040 12235000 00000000 00000000
0x00000040126d7630: 00000000 00000000 00000000 00000000
0x00000040126d7640: b9040009 cc08ffff fff85500 2008a784 # <-- String.hashCode() entry point at 0x00000040126d7640
0x00000040126d7650: 0019a51d 0040c019 12167a80 07f10700
0x00000040126d7660: 07000700 07000700 07000700 07000700
0x00000040126d7670: 07000700 07000700 07000700 07000700
0x00000040126d7680: 0000f000 ec51e3e0 f0080024 b904000f # <-- note 0x0000 at 0x00000040126d7680
0x00000040126d7690: a7fbffa0 e300f000 0024c438 ffffff73
--- SNIP
The assembly printed by java looks like:
--- SNIP b9d0} 'hashCode' '()I' in 'java/lang/String' d7640: lgr %r0,%r9 ;...b9040009
; {no_reloc} d7644: aih %r0,-8 ;...cc08ffff fff8
[Entry Point]
# {method} {0x000000405f3f
# [sp+0x60] (sp of caller)
0x00000040126
0x00000040126
0x00000040126 d764a: cl %r0,8(%r2) ;...55002008
0x00000040126 d764e: je 0x00000040126d7680 ;...a7840019
0x00000040126 d7652: llihl %r1,64 ;...a51d0040
0x00000040126 d7656: iilf %r1,303463040 ;...c0191216 7a80
0x00000040126 d765c: br %r1 ;...07f1
0x00000040126 d765e: nopr ;...0700
0x00000040126 d7660: nopr ;...0700
0x00000040126 d7662: nopr ;...0700
0x00000040126 d7664: nopr ;...0700
0x00000040126 d7666: nopr ;...0700
0x00000040126 d7668: nopr ;...0700
0x00000040126 d766a: nopr ;...0700
0x00000040126 d766c: nopr ;...0700
0x00000040126 d766e: nopr ;...0700
0x00000040126 d7670: nopr ;...0700
0x00000040126 d7672: nopr ;...0700
0x00000040126 d7674: nopr ;...0700
0x00000040126 d7676: nopr ;...0700
0x00000040126 d7678: nopr ;...0700
0x00000040126 d767a: nopr ;...0700
0x00000040126 d767c: nopr ;...0700
0x00000040126 d767e: nopr ;...0700
[Verified Entry Point] d7680: tmy -81920(%r15),222 ;...ebdef000 ec51
0x00000040126
0x00000040126 d7686: stg %r14,8(%r15) ;...e3e0f008 0024
0x00000040126 d768c: lgr %r0,%r15 ;...b904000f
0x00000040126 d7690: aghi %r15,-96 ;...a7fbffa0
0x00000040126 d7694: stg %r0,0(%r15) ;...e300f000 0024
0x00000040126 d769a: lgrl %r3,0x000000401 26d7580
; ...c438ffff ff73
; {metadata(method data for {method} {0x000000405f3f b9d0} 'hashCode' '()I' in 'java/lang/ String' )}
--- SNIP
so IIUC java says its generating 0xebde at 0x00000040126d7680 instead of 0x0000.
Hope the above makes sense. I'm not sure where to go from here so any suggestions would be a great help.