Comments (18)
We will fix this in Bun v1.1.19. Not sure how yet, but we'll try some things
from bun.
After some reading, it looks like Raspberry Pi 4 (ARMv8-A) is old enough to not support atomic instructions. It was added in ARMv8.1-A. That also explains why our test suite ran successfully on Linux arm64 and why I'm unable to reproduce this on our AWS machines that use Linux aarch64.
I'm not sure why this started in Bun v1.1.16. I think we can set -mcpu
to the ARM Cortex A72 on Linux and that would address this. Another option is introducing a linux-baseline build when targeting linux arm64. That is what we do to support older CPUs on x64.
@eslym this stacktrace was helpful, thank you:
* thread #1, name = 'bun', stop reason = signal SIGILL: illegal instruction
frame #0: 0x00000055582094a0 bun`src.http.HTTPThread.init at atomic.zig:48:39
(lldb) bt all
* thread #1, name = 'bun', stop reason = signal SIGILL: illegal instruction
* frame #0: 0x00000055582094a0 bun`src.http.HTTPThread.init at atomic.zig:48:39
frame #1: 0x0000005558209494 bun`src.http.HTTPThread.init at http.zig:773
frame #2: 0x0000005558322788 bun`src.cli.install_command.InstallCommand.exec [inlined] initWithCLI__anon_62747(ctx=0x000000555addc900, cli=src.install.install.PackageManager.CommandLineArguments @ 0x00000000216ce020) at install.zig:8246:33
frame #3: 0x0000005558322784 bun`src.cli.install_command.InstallCommand.exec [inlined] init__anon_62404(ctx=0x000000555addc900) at install.zig:8237
frame #4: 0x0000005558322680 bun`src.cli.install_command.InstallCommand.exec at install.zig:11204
frame #5: 0x0000005558322680 bun`src.cli.install_command.InstallCommand.exec(ctx=<unavailable>) at install_command.zig:7
frame #6: 0x000000555812c6cc bun`src.cli.Cli.start at cli.zig:1494:40
frame #7: 0x000000555812b7f4 bun`src.cli.Cli.start at cli.zig:62
frame #8: 0x000000555812ad04 bun`start.main [inlined] main at main.zig:50:22
frame #9: 0x000000555812acc4 bun`start.main [inlined] callMain at start.zig:514
frame #10: 0x000000555812acc4 bun`start.main at start.zig:482
frame #11: 0x000000555812abe4 bun`start.main(c_argc=2, c_argv=0x0000007ffffff4f8, c_envp=0x0000007ffffff510) at start.zig:497
frame #12: 0x0000007ff7e78e18 libc.so.6`__libc_start_main(main=(bun`start.main at start.zig:485), argc=2, argv=0x0000007ffffff4f8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=<unavailable>) at libc-start.c:308:16
frame #13: 0x000000555812aa34 bun`_start + 52
from bun.
Still an issue in 1.1.18.
Hope this can be fixed soon!
from bun.
same here
(lldb) target create "bun"
run install
Current executable set to 'bun' (aarch64).
(lldb) run install
Process 3799310 launched: '/home/engshun/.bun/bin/bun' (aarch64)
Process 3799310 stopped
* thread #1, name = 'bun', stop reason = signal SIGILL: illegal instruction
frame #0: 0x00000055582094a0 bun`src.http.HTTPThread.init at atomic.zig:48:39
(lldb) bt all
* thread #1, name = 'bun', stop reason = signal SIGILL: illegal instruction
* frame #0: 0x00000055582094a0 bun`src.http.HTTPThread.init at atomic.zig:48:39
frame #1: 0x0000005558209494 bun`src.http.HTTPThread.init at http.zig:773
frame #2: 0x0000005558322788 bun`src.cli.install_command.InstallCommand.exec [inlined] initWithCLI__anon_62747(ctx=0x000000555addc900, cli=src.install.install.PackageManager.CommandLineArguments @ 0x00000000216ce020) at install.zig:8246:33
frame #3: 0x0000005558322784 bun`src.cli.install_command.InstallCommand.exec [inlined] init__anon_62404(ctx=0x000000555addc900) at install.zig:8237
frame #4: 0x0000005558322680 bun`src.cli.install_command.InstallCommand.exec at install.zig:11204
frame #5: 0x0000005558322680 bun`src.cli.install_command.InstallCommand.exec(ctx=<unavailable>) at install_command.zig:7
frame #6: 0x000000555812c6cc bun`src.cli.Cli.start at cli.zig:1494:40
frame #7: 0x000000555812b7f4 bun`src.cli.Cli.start at cli.zig:62
frame #8: 0x000000555812ad04 bun`start.main [inlined] main at main.zig:50:22
frame #9: 0x000000555812acc4 bun`start.main [inlined] callMain at start.zig:514
frame #10: 0x000000555812acc4 bun`start.main at start.zig:482
frame #11: 0x000000555812abe4 bun`start.main(c_argc=2, c_argv=0x0000007ffffff4f8, c_envp=0x0000007ffffff510) at start.zig:497
frame #12: 0x0000007ff7e78e18 libc.so.6`__libc_start_main(main=(bun`start.main at start.zig:485), argc=2, argv=0x0000007ffffff4f8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=<unavailable>) at libc-start.c:308:16
frame #13: 0x000000555812aa34 bun`_start + 52
(lldb)
raspberry pi 4 rasbian OS 64 bit
p/s: i have a friend help test with his raspberry pi 4, can confirmed this will happens on pi4
from bun.
are you sure you're running on arm64 and not arm32?
from bun.
I believe I am but admittedly I'm not as familiar with Linux as I should be.
Below is the output of lscup
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Cortex-A72
Model: 3
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r0p3
CPU(s) scaling MHz: 87%
CPU max MHz: 1500.0000
CPU min MHz: 600.0000
BogoMIPS: 108.00
Flags: fp asimd evtstrm crc32 cpuid
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 192 KiB (4 instances)
L2: 1 MiB (1 instance)
Vulnerabilities:
Gather data sampling: Not affected
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec rstack overflow: Not affected
Spec store bypass: Vulnerable
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Vulnerable
Srbds: Not affected
Tsx async abort: Not affected
from bun.
Happens on my Pi 3 64-bit too. If I try to run bun serve or bun upgrade, it just returns "Illegal Instruction". Also got the same illegal instruction message during install. Had to downgrade
from bun.
Same here. Running on a Raspberry Pi 4 with Ubuntu Server 64 bit.
from bun.
same here
Linux xxxxxxxx 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux
from bun.
Same issue for me with :
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1800.0000
CPU min MHz: 1200.0000
BogoMIPS: 16.00
NUMA node0 CPU(s): 0-3
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
The only way is to downgrade to version 1.1.15
@Jarred-Sumner
from bun.
I'd be up for having a baseline build for arm64.
What is the impact (if any) of not using atomic instructions?
Interesting how it only appeared as an issue in 1.1.16...
from bun.
same on Raspberry Pi 4 Model B Rev 1.4
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Cortex-A72
Model: 3
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r0p3
CPU(s) scaling MHz: 67%
CPU max MHz: 1500.0000
CPU min MHz: 600.0000
BogoMIPS: 108.00
Flags: fp asimd evtstrm crc32 cpuid
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 192 KiB (4 instances)
L2: 1 MiB (1 instance)
Vulnerabilities:
Gather data sampling: Not affected
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Reg file data sampling: Not affected
Retbleed: Not affected
Spec rstack overflow: Not affected
Spec store bypass: Vulnerable
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Vulnerable
Srbds: Not affected
Tsx async abort: Not affected
from bun.
Another one...
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Cortex-A72
Model: 3
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r0p3
CPU(s) scaling MHz: 100%
CPU max MHz: 1800.0000
CPU min MHz: 600.0000
BogoMIPS: 108.00
Flags: fp asimd evtstrm crc32 cpuid
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 192 KiB (4 instances)
L2: 1 MiB (1 instance)
Vulnerabilities:
Gather data sampling: Not affected
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Reg file data sampling: Not affected
Retbleed: Not affected
Spec rstack overflow: Not affected
Spec store bypass: Vulnerable
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Vulnerable
Srbds: Not affected
Tsx async abort: Not affected
from bun.
Same problem on my raspi64. problem occurs with bun 1.1.16 and newer. bun 1.1.15 works fine.
The last syscalls before SIGILL
strace:
futex(0x556da951d4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da951bc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f84607000
mmap(NULL, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f84602000
rt_sigaction(SIGRT_1, {sa_handler=0x7f8449c080, sa_mask=[], sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8454144, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f3b7f0000
mprotect(0x7f3b800000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
clone(child_stack=0x7f3bfa1e40, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[87333], tls=0x7f3bfa2cc0, child_tidptr=0x7f3bfa2650) = 87333
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0x7f3c00e7c0, FUTEX_WAKE_PRIVATE, 1) = 1
mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f397f0000
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 4
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=125001024, rlim_max=RLIM64_INFINITY}) = 0
newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(4, "5567a30000-556a603000 r--p 00000"..., 1024) = 1024
read(4, "aarch64-linux-gnu/libm.so.6\n7f84"..., 1024) = 1024
read(4, "libpthread.so.0\n7f84410000-7f844"..., 1024) = 1024
read(4, " [vdso]\n7f8460e000-7f84610000 "..., 1024) = 335
close(4) = 0
sched_getaffinity(87332, 32, [0 1 2 3]) = 32
getpid() = 87332
gettid() = 87332
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=125001024, rlim_max=RLIM64_INFINITY}) = 0
gettid() = 87332
rt_sigprocmask(SIG_UNBLOCK, [USR1], NULL, 8) = 0
futex(0x556da95164, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4
read(4, "0-3\n", 1024) = 4
close(4) = 0
madvise(0x7f84602000, 20480, MADV_DODUMP) = 0
futex(0x556da98628, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mmap(NULL, 536879104, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f197ee000
madvise(0x7f197ee000, 536879104, MADV_HUGEPAGE) = -1 EINVAL (Invalid argument)
futex(0x556da986a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da953bc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da95540, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da97e30, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da986e4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da9880c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x556da984cc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=125001024, rlim_max=RLIM64_INFINITY}) = 0
prlimit64(0, RLIMIT_STACK, {rlim_cur=RLIM64_INFINITY, rlim_max=RLIM64_INFINITY}, NULL) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=10241024}) = 0
prlimit64(0, RLIMIT_NOFILE, {rlim_cur=10241024, rlim_max=10241024}, NULL) = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x556a647a24} ---
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, NULL, 8) = 0
from bun.
+1 I encountered it too on my Raspberry Pi 4 model B with a standard Raspberry Pi 64 bit installation.
Downgrading to 1.1.14 fixes the issue.
from bun.
and more for completeness than anything (as cpu not OS related), same issue with RPi4 using Ubuntu 23.04 or 24.04
from bun.
and standard 1.1.18 install works on later cpu RPi5
from bun.
Also experiencing this with an Nvidia Jetson (tegra). Can confirm using bun 1.1.14 works (with bun build --compile --target=bun-linux-arm64 ...
).
`lscpu` output
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 6
On-line CPU(s) list: 0-5
Thread(s) per core: 1
Core(s) per socket: 3
Socket(s): 2
Vendor ID: ARM
Model: 3
Model name: Cortex-A57
Stepping: r1p3
CPU max MHz: 2035.2000
CPU min MHz: 345.6000
BogoMIPS: 62.50
L1d cache: 32K
L1i cache: 48K
L2 cache: 2048K
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32
from bun.
Related Issues (20)
- Crash during long looping test data insertion HOT 1
- Can not build single-file-executable with specified target on Bun v1.1.23 HOT 1
- --inspect with browser on different machine
- Shell fails with interpolated variable HOT 2
- TypeError: Socket2 is not a function HOT 3
- Bun.file:Memory observation mode【文件加载到内存并监视变化】
- crawlee playwright bun : Running crawlee's playwright crawler with bun causes Protocol mismatch error
- Fail to upgrade bun
- Next.js standalone with edge - Segmentation fault
- add glob matching to Bun.build
- Bun issue in dockerized NextJS
- AbortSignal,timeout and fetch bug when i cant reach server HOT 5
- Foldable JSON in VSCode debugger
- SQLIte named parameter ORDER BY not working
- Bun fails to update correctly through winget
- Bun crashed when handeling with LevelDD and RocksDB HOT 3
- Unexpected Segmentation fault HOT 3
- String.prototype.matchAll incorrectly fails for non-global RegExp HOT 1
- panic(main thread): Segmentation fault HOT 2
- llint_call_javascript CRASH HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.