Trying to run npm on aarch64 raspberry pi 3, I'm running into a reliable asm-related crash with pretty much any use:
------ $ mkdir test $ cd test $ npm init This utility will walk you through creating a package.json file. [...] Press ^C at any time to quit. package name: (test) Segmentation fault (core dumped) ------ I ran into it on 7.6 and updated to -current with no change. Looking for a simpler reproducer I ran through "eopenssl33 speed" and I hit the same backtrace with "eopenssl33 speed rand". Also tried openssl 3.4 and see the same. It's a pretty weedy machine as far as crypto blocks are concerned, "cpu0: CRC32,ASID16". This doesn't happen on Apple M2. Any ideas please? Happy to do more focused tests to narrow it down further if there's anything that would be useful. The contents of registers referenced in the ldr look aligned. I'm not much good at debugging asm though. $ eopenssl33 speed rand Doing rand ops for 3s on 16 size blocks: 182858 rand ops in 2.61s Doing rand ops for 3s on 64 size blocks: 157128 rand ops in 2.69s Doing rand ops for 3s on 256 size blocks: Segmentation fault (core dumped) $ egdb -q eopenssl33 eopenssl33.core Reading symbols from eopenssl33... Reading symbols from /usr/local/bin/.debug/eopenssl33.dbg... [New process 393600] Core was generated by `eopenssl33'. Program terminated with signal SIGSEGV, Segmentation fault. #0 _bsaes_key_convert () at crypto/aes/bsaes-armv8.S:926 926 ldr q1, [x11] // .LM0 (gdb) bt #0 _bsaes_key_convert () at crypto/aes/bsaes-armv8.S:926 #1 0x0000000f07d89070 in ossl_bsaes_ctr32_encrypt_blocks () at crypto/aes/bsaes-armv8.S:1261 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) list 921 adr x11, .LM0_littleendian 922 #else 923 adr x11, .LM0_bigendian 924 #endif 925 ldr q0, [x9], #16 // load round 0 key 926 ldr q1, [x11] // .LM0 927 ldr q15, [x9], #16 // load round 1 key 928 929 movi v7.16b, #0x63 // compose .L63 930 movi v16.16b, #0x01 // bit masks (gdb) info registers x0 0x15812d9000 92361560064 x1 0x15812d9000 92361560064 x2 0x10 16 x3 0x14a7c30440 88713921600 x4 0x14a7c303a0 88713921440 x5 0x14a7c30390 88713921424 x6 0x64cc587bac 432925080492 x7 0x149c4d3030 88521650224 x8 0x149c4d3030 88521650224 x9 0x14a7c30450 88713921616 x10 0xe 14 x11 0x149c4d25f0 88521647600 x12 0xdf 223 x13 0x15812d90fc 92361560316 x14 0x64cc587ad0 432925080272 x15 0xe 14 x16 0x149c7ab1f0 88524632560 x17 0x64cc587430 432925078576 x18 0x0 0 x19 0x8845fcef 2286288111 x20 0x14a7c30390 88713921424 x21 0x15812d9000 92361560064 x22 0x15812d9000 92361560064 x23 0x14a7c303a0 88713921440 x24 0x10000000 268435456 x25 0x14a7c30440 88713921600 x26 0x10 16 x27 0x0 0 x28 0x100 256 x29 0x64cc587b30 432925080368 x30 0x149c4d3070 88521650288 sp 0x64cc587430 0x64cc587430 pc 0x149c4d2c48 0x149c4d2c48 <_bsaes_key_convert+8> cpsr 0x20000000 [ EL=0 BTYPE=0 C ] fpsr 0x10 [ IXC ] fpcr 0x0 [ Len=0 Stride=0 RMode=0 ] pauth_dmask 0xffffff8000000000 -549755813888 pauth_cmask 0xffffff8000000000 -549755813888 (Tried running directly under gdb, e.g. 'egdb -q -ex run --args eopenssl33 speed rand', to see if I'd get a better stack trace, but it doesn't go well because it runs into SIGILLs from the CPU feature detection code). $ sysctl machdep machdep.compatible=raspberrypi,3-model-b machdep.id_aa64isar0=65536 machdep.id_aa64isar1=0 machdep.id_aa64isar2=0 machdep.id_aa64mmfr0=0 machdep.id_aa64mmfr1=0 machdep.id_aa64mmfr2=0 machdep.id_aa64pfr0=0 machdep.id_aa64pfr1=0 machdep.id_aa64smfr0=0 machdep.id_aa64zfr0=0 machdep.lidaction=1 OpenBSD 7.7-beta (GENERIC.MP) #334: Sat Mar 8 14:30:23 MST 2025 dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP real mem = 970903552 (925MB) avail mem = 900571136 (858MB) random: good seed from bootblocks mainbus0 at root: Raspberry Pi 3 Model B Rev 1.2 efi0 at mainbus0: UEFI 2.8 efi0: Das U-Boot rev 0x20211000 smbios0 at efi0: SMBIOS 3.0 smbios0: vendor U-Boot version "2021.10" date 10/01/2021 smbios0: Unknown Unknown Product cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4 cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache cpu0: 512KB 64b/line 16-way L2 cache cpu0: CRC32,ASID16 cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4 cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache cpu1: 512KB 64b/line 16-way L2 cache cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4 cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache cpu2: 512KB 64b/line 16-way L2 cache cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4 cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache cpu3: 512KB 64b/line 16-way L2 cache "linux,cma" at mainbus0 not configured apm0 at mainbus0 simplefb0 at mainbus0: 656x416, 32bpp wsdisplay0 at simplefb0 mux 1 wsdisplay0: screen 0-5 added (std, vt100 emulation) "system" at mainbus0 not configured "axi" at mainbus0 not configured simplebus0 at mainbus0: "soc" bcmclock0 at simplebus0 bcmmbox0 at simplebus0 bcmgpio0 at simplebus0 bcmaux0 at simplebus0 bcmdmac0 at simplebus0: DMA0 DMA2 DMA4 DMA5 DMA8 DMA9 DMA10 DMA11 bcmintc0 at simplebus0 pluart0 at simplebus0: rev 2, 16 byte fifo pluart0: console bcmsdhost0 at simplebus0: 250 MHz base clock sdmmc0 at bcmsdhost0: 4-bit, sd high-speed, mmc high-speed, dma dwctwo0 at simplebus0 bcmdog0 at simplebus0 bcmrng0 at simplebus0 bcmtemp0 at simplebus0 "local_intc" at simplebus0 not configured sdhc0 at simplebus0 sdhc0: SDHC 3.00, 200 MHz base clock sdmmc1 at sdhc0: 4-bit, sd high-speed, mmc high-speed "firmware" at simplebus0 not configured "power" at simplebus0 not configured "mailbox" at simplebus0 not configured "gpiomem" at simplebus0 not configured "fb" at simplebus0 not configured "vcsm" at simplebus0 not configured "virtgpio" at simplebus0 not configured "clocks" at mainbus0 not configured "phy" at mainbus0 not configured "arm-pmu" at mainbus0 not configured agtimer0 at mainbus0: 19200 kHz gpioleds0 at mainbus0: "led0" "fixedregulator_3v3" at mainbus0 not configured "fixedregulator_5v0" at mainbus0 not configured usb0 at dwctwo0: USB revision 2.0 uhub0 at usb0 configuration 1 interface 0 "Broadcom DWC2 root hub" rev 2.00/1.00 addr 1 sdmmc0: can't enable card uhub1 at uhub0 port 1 configuration 1 interface 0 "Standard Microsystems product 0x9514" rev 2.00/2.00 addr 2 bwfm0 at sdmmc1 function 1 manufacturer 0x02d0, product 0xa9a6 at sdmmc1 function 2 not configured smsc0 at uhub1 port 1 configuration 1 interface 0 "Standard Microsystems SMSC9512/14" rev 2.00/2.00 addr 3 smsc0: address b8:27:eb:5d:c0:5e ukphy0 at smsc0 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x0001f0, model 0x000c umass0 at uhub1 port 4 configuration 1 interface 0 "SanDisk Ultra Fit" rev 2.10/1.00 addr 4 umass0: using SCSI over Bulk-Only scsibus0 at umass0: 2 targets, initiator 0 sd0 at scsibus0 targ 1 lun 0: <SanDisk, Ultra Fit, 1.00> removable serial.0781558381079d26fa39 sd0: 29340MB, 512 bytes/sector, 60088320 sectors vscsi0 at root scsibus1 at vscsi0: 256 targets softraid0 at root scsibus2 at softraid0: 256 targets root on sd0a (b2b4d0b998c15160.a) swap on sd0b dump on sd0b WARNING: CHECK AND RESET THE DATE! gpio0 at bcmgpio0: 54 pins "bootloader" at mainbus0 not configured