Bug 271730 - [arm64] tools/test/avx_sig sporadically fails
Summary: [arm64] tools/test/avx_sig sporadically fails
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Many People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-30 18:57 UTC by Dmitry Chagin
Modified: 2024-01-19 14:36 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Chagin freebsd_committer freebsd_triage 2023-05-30 18:57:05 UTC
dchagin@aarch64:/usr/obj/usr/home/dchagin/freebsd/arm64.aarch64/tools/test/avx_sig % ./avx_sig
thr 100344
%q16
d7 21 f7 e5 c7 95 33 ec a5 d5 a7 64 34 77 6b d1
01 04 10 40 01 04 10 40 01 04 10 40 01 04 10 40
%q17
49 32 9d 07 d5 1e 30 a8 38 f2 19 10 e9 bc 61 28
00 a0 00 00 00 a0 aa aa 00 00 01 01 00 00 00 00
Abort (core dumped)

  2554 100621 avx_sig  0.002402877 RET   F64  thr_new 0
  2554 100621 avx_sig  0.002466918 CALL  F64  sigfastblock(0x1,0x3bec88303738)
  2554 100621 avx_sig  0.002473335 RET   F64  sigfastblock 0
  2554 100621 avx_sig  0.002495627 CALL  F64  mmap(0,0x458,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0)
  2554 100621 avx_sig  0.002499335 RET   F64  mmap 65887154843648/0x3bec8c75b000
  2554 100621 avx_sig  0.002510043 CALL  F64  minherit(0x3bec8c75b000,0x458,INHERIT_ZERO)
  2554 100621 avx_sig  0.002511043 RET   F64  minherit 0
  2554 100621 avx_sig  0.002516919 CALL  F64  getrandom(0x3bec8ac87a80,0x28,0)
  2554 100621 avx_sig  0.002528085 RET   F64  getrandom 40/0x28
  2554 100621 avx_sig  0.002556710 CALL  F64  nanosleep(0x3bec8ac87b38,0)
  2554 100621 avx_sig  0.015871137 RET   F64  nanosleep 0
  2554 100621 avx_sig  0.015927137 CALL  F64  fstat(0x1,0x3bec8ac86ce8)
  2554 100621 avx_sig  0.015935054 STRU  F64  struct stat {dev=1895890688, ino=37, mode=020600, nlink=1, uid=0, gid=4, rdev=37, atime=1685154551, mtime=1685154551, ctime=1685154551, birthtime=-1, size=0, blksize=4096, blocks=0, flags=0x0 }
  2554 100621 avx_sig  0.015936096 RET   F64  fstat 0
  2554 100621 avx_sig  0.015979763 CALL  F64  mmap(0,0x200000,0x3<PROT_READ|PROT_WRITE>,0x15001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21)>,0xffffffff,0)
  2554 100621 avx_sig  0.015984971 RET   F64  mmap 65887319097344/0x3bec96400000
  2554 100621 avx_sig  0.016055971 PSIG  F64  SIGUSR1 caught handler=0x3bec86274c0c mask=0x0 code=SI_LWP
  2554 100621 avx_sig  0.016060721 CALL  F64  sigreturn(0x3bec8ac822c0)
  2554 100621 avx_sig  0.016061971 RET   F64  sigreturn JUSTRETURN
  2554 100621 avx_sig  0.016112596 CALL  F64  getcontext(0x3bec8ac82590)
  2554 100621 avx_sig  0.016114054 RET   F64  getcontext 0
  2554 100621 avx_sig  0.016116763 CALL  F64  sigprocmask(SIG_SETMASK,0x3bec8ac829cc,0)
  2554 100621 avx_sig  0.016117846 RET   F64  sigprocmask 0
  2554 100621 avx_sig  0.016118929 CALL  F64  sigreturn(0x3bec8ac82180)
  2554 100621 avx_sig  0.016119929 RET   F64  sigreturn JUSTRETURN
  2554 100621 avx_sig  0.016128513 CALL  F64  mmap(0,0x200000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0)
  2554 100621 avx_sig  0.016130929 RET   F64  mmap 65887328157696/0x3bec96ca4000
  2554 100621 avx_sig  0.016229263 CALL  F64  ioctl(0x1,TIOCGETA,0x3bec8ac86dac)
  2554 100621 avx_sig  0.016231721 RET   F64  ioctl 0
  2554 100621 avx_sig  0.016255096 CALL  F64  write(0x1,0x3bec96ca4000,0xb)
  2554 100621 avx_sig  0.017257222 GIO   F64  fd 1 wrote 11 bytes
       "thr 100621
  2554 100621 avx_sig  0.017261764 RET   F64  write 11/0xb
  2554 100621 avx_sig  0.017273847 CALL  F64  write(0x1,0x3bec96ca4000,0x6)
  2554 100621 avx_sig  0.017276055 GIO   F64  fd 1 wrote 6 bytes
  2554 100621 avx_sig  0.017276722 RET   F64  write 6
  2554 100621 avx_sig  0.017287639 CALL  F64  write(0x1,0x3bec96ca4000,0x30)
  2554 100621 avx_sig  0.017289014 GIO   F64  fd 1 wrote 48 bytes
  2554 100621 avx_sig  0.017289722 RET   F64  write 48/0x30
  2554 100621 avx_sig  0.017298222 CALL  F64  write(0x1,0x3bec96ca4000,0x30)
  2554 100621 avx_sig  0.017299430 GIO   F64  fd 1 wrote 48 bytes
  2554 100621 avx_sig  0.017300139 RET   F64  write 48/0x30
  2554 100621 avx_sig  0.017301555 CALL  F64  write(0x1,0x3bec96ca4000,0x6)
  2554 100621 avx_sig  0.017302680 GIO   F64  fd 1 wrote 6 bytes
  2554 100621 avx_sig  0.017303389 RET   F64  write 6
  2554 100621 avx_sig  0.017311722 CALL  F64  write(0x1,0x3bec96ca4000,0x30)
  2554 100621 avx_sig  0.017312847 GIO   F64  fd 1 wrote 48 bytes
  2554 100621 avx_sig  0.017313514 RET   F64  write 48/0x30
  2554 100621 avx_sig  0.017322430 CALL  F64  write(0x1,0x3bec96ca4000,0x30)
  2554 100621 avx_sig  0.017323555 GIO   F64  fd 1 wrote 48 bytes
  2554 100621 avx_sig  0.017324222 RET   F64  write 48/0x30
  2554 100621 avx_sig  0.017336180 CALL  F64  sigprocmask(SIG_SETMASK,0x3bec8ac87ab0,0)
  2554 100621 avx_sig  0.017337139 RET   F64  sigprocmask 0
  2554 100621 avx_sig  0.017341555 CALL  F64  thr_self(0x3bec8ac87b00)
  2554 100621 avx_sig  0.017342305 RET   F64  thr_self 0
  2554 100621 avx_sig  0.017343847 CALL  F64  thr_kill(0x1890d,SIGABRT)
  2554 100621 avx_sig  0.017348972 RET   F64  thr_kill 0
  2554 100621 avx_sig  0.017350430 PSIG  F64  SIGABRT SIG_DFL code=SI_LWP
  2554 100621 avx_sig  0.018046889 NAMI  F64  "avx_sig.core"
Comment 1 John F. Carr 2023-05-30 20:57:44 UTC
This passes for me on 13.2-STABLE (Ampere) but fails immediately on 14.0-CURRENT (A-57), also with mismatches in registers 16 and 17.
Comment 2 Dmitry Chagin freebsd_committer freebsd_triage 2023-05-30 21:28:36 UTC
(In reply to John F. Carr from comment #1)
btw, test succed in the Linuxulator, so looks like the problem in the signal related libc/libthr code
Comment 3 Andrew Turner freebsd_committer freebsd_triage 2023-05-31 10:46:32 UTC
This is allowed behaviour based on the ABI.

avx_sig sets q0-q31 in simd_to_cpu, however as q16-q31 are caller saved (named v16-v31 in the ABI doc) we can't rely on my_pause not changing them. It looks like rtld might be where they are trashed as I can get it working reliably by putting a call to my_pause early in main to ensure any needed symbols have been resolved. This is only a work around however as it doesn't fix the ABI issue.
Comment 4 Dmitry Chagin freebsd_committer freebsd_triage 2023-05-31 17:20:40 UTC
(In reply to Andrew Turner from comment #3)

Thank you! Indeed, lazy binding, Im confused by strange ktrace output, with 2 sigreturns. 
btw, on x86 rtld does not use simd, may be am64 will follow this too?
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2024-01-19 14:36:23 UTC
^Triage: issue does not seem to be "In Progress" although there was an active discussion.