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

Arm64/Sve: Sve_Multiply tests failing #105736

Closed
a74nh opened this issue Jul 31, 2024 · 4 comments · Fixed by #105948
Closed

Arm64/Sve: Sve_Multiply tests failing #105736

a74nh opened this issue Jul 31, 2024 · 4 comments · Fixed by #105948
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@a74nh
Copy link
Contributor

a74nh commented Jul 31, 2024

When I run all the SVE tests, the Sve_Multiply cause a segfault.

This is on Ubuntu Linux.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 31, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 31, 2024
@a74nh a74nh added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Priority:2 Work that is important, but not critical for the release and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 31, 2024
@a74nh a74nh self-assigned this Jul 31, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@JulieLeeMSFT JulieLeeMSFT added this to the 9.0.0 milestone Jul 31, 2024
@JulieLeeMSFT JulieLeeMSFT added the arm-sve Work related to arm64 SVE/SVE2 support label Jul 31, 2024
@SwapnilGaikwad
Copy link
Contributor

Adding a failure log for reference

Beginning scenario: RunBasicScenario_UnsafeRead
Process terminated. InternalError
   at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, System.Runtime.CompilerServices.ObjectHandleOnStack, System.String)
   at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, System.String)
   at System.Environment.FailFast(System.String)
   at System.Runtime.EH.FallbackFailFast(System.Runtime.RhFailFastReason, System.Object)
   at System.Runtime.EH.RhThrowHwEx(UInt32, ExInfo ByRef)
   at JIT.HardwareIntrinsics.Arm._Sve.SimpleBinaryOpTest__Sve_Multiply_sbyte.RunBasicScenario_UnsafeRead()
   at JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Multiply_sbyte()
   at Program.<<Main>$>g__TestExecutor3399|0_3400(System.IO.StreamWriter, System.IO.StreamWriter, <>c__DisplayClass0_0 ByRef)
   at Program.<Main>$(System.String[])
Aborted (core dumped)

@a74nh
Copy link
Contributor Author

a74nh commented Aug 2, 2024

❯ gdb --args $CORE_ROOT/corerun ./artifacts/tests/coreclr/linux.arm64.Checked/JIT/HardwareIntrinsics/HardwareIntrinsics_Arm_ro/HardwareIntrinsics_Arm_ro.dll Sve_Multiply_sbyte
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/alahay01/dotnet/runtime_sve/artifacts/tests/coreclr/linux.arm64.Checked/Tests/Core_Root/corerun...
(gdb) r
Starting program: /home/alahay01/dotnet/runtime_sve/artifacts/tests/coreclr/linux.arm64.Checked/Tests/Core_Root/corerun ./artifacts/tests/coreclr/linux.arm64.Checked/JIT/HardwareIntrinsics/HardwareIntrinsics_Arm_ro/HardwareIntrinsics_Arm_ro.dll Sve_Multiply_sbyte
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0xfffff6f1f100 (LWP 3134350)]
[New Thread 0xfffff670f100 (LWP 3134351)]
[New Thread 0xfffff5eff100 (LWP 3134352)]
[New Thread 0xfffff56ef100 (LWP 3134353)]
[New Thread 0xfffff4ecf100 (LWP 3134354)]
[New Thread 0xffffa7fff100 (LWP 3134355)]
[New Thread 0xffffa77ef100 (LWP 3134357)]
[New Thread 0xffffa57ff100 (LWP 3134358)]
[New Thread 0xffbef73ff100 (LWP 3134375)]
16:09:25.711 Running test: _Sve_ro::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Multiply_sbyte()
Supported ISAs:
  AdvSimd:   True
  Aes:       True
  ArmBase:   True
  Crc32:     True
  Dp:        True
  Rdm:       True
  Sha1:      True
  Sha256:    True
  Sve:       True

Beginning scenario: RunBasicScenario_UnsafeRead

Thread 1 "corerun" received signal SIGILL, Illegal instruction.
0x0000ffffaaf4998c in ?? ()
(gdb) bt
#0  0x0000ffffaaf4998c in ?? ()
#1  0x0000ffffaaf47988 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) disassemble 0x0000ffffaaf4996c,0x0000ffffaaf4999c
Dump of assembler code from 0xffffaaf4996c to 0x0000ffffaaf4999c:
   0x0000ffffaaf4996c:	add	x0, x0, #0x50
   0x0000ffffaaf49970:	mov	x1, #0x4b58                	// #19288
   0x0000ffffaaf49974:	movk	x1, #0xab21, lsl #16
   0x0000ffffaaf49978:	movk	x1, #0xffff, lsl #32
   0x0000ffffaaf4997c:	ldr	x1, [x1]
   0x0000ffffaaf49980:	blr	x1
   0x0000ffffaaf49984:	ldr	q16, [x0]
   0x0000ffffaaf49988:	ldr	q17, [x29, #48]
=> 0x0000ffffaaf4998c:	mul	z17.b, z17.b, z16.b
   0x0000ffffaaf49990:	str	q17, [x29, #64]
   0x0000ffffaaf49994:	ldr	x0, [x29, #88]
   0x0000ffffaaf49998:	ldrsb	wzr, [x0]
   0x0000ffffaaf4999c:	ldr	x0, [x29, #88]

Strange - generates a SIGILL, but gdb still thinks it is a valid instruction.

@a74nh
Copy link
Contributor Author

a74nh commented Aug 2, 2024

This is because the unpredicated version of multiply is SVE2:
https://docsmirror.github.io/A64/2023-09/mul_z_zz.html

Instead, we should use the predicated version:
https://docsmirror.github.io/A64/2023-09/mul_z_p_zz.html

@a74nh a74nh removed their assignment Aug 5, 2024
SwapnilGaikwad added a commit to SwapnilGaikwad/runtime that referenced this issue Aug 5, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Aug 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants