oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.07k stars 2.76k forks source link

Illegal instruction errors on old ThinkPad (popcnt, pcmpestri) #4124

Closed Akuli closed 1 year ago

Akuli commented 1 year ago

What version of Bun is running?

0.7.3

What platform is your computer?

Linux 5.10.0-24-amd64 x86_64 unknown

What steps can reproduce the bug?

Download bun-linux-x64-baseline and run various commands on my old thinkpad:

bun-linux-x64-baseline/bun install
bun-linux-x64-baseline/bun dev

What is the expected behavior?

Not sure. Maybe at least baseline version should work. If not, just close this issue.

What do you see instead?

akuli@Akuli-ThinkPad:~/piirimaker$ bun-linux-x64-baseline/bun --version
0.7.3
akuli@Akuli-ThinkPad:~/piirimaker$ bun-linux-x64-baseline/bun install
Illegal instruction
akuli@Akuli-ThinkPad:~/piirimaker$ bun-linux-x64-baseline/bun dev
[6.00ms] bun!! v0.7.3 (a9b3d583)

  Link: http://localhost:3001

Illegal instruction

With gdb (after switching to the right thread) I see this happens at a popcount instruction:

s

Similarly bun dev crashes at a pcmpestri instruction when the first request comes.

Additional information

Content of `/proc/cpuinfo` ``` processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz stepping : 10 microcode : 0xa0c cpu MHz : 2095.461 cache size : 3072 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl cpuid aperfmperf pni dtes64 monitor ds_cpl smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm pti dtherm ida bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown bogomips : 4521.91 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz stepping : 10 microcode : 0xa0c cpu MHz : 1977.552 cache size : 3072 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl cpuid aperfmperf pni dtes64 monitor ds_cpl smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm pti dtherm ida bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown bogomips : 4521.91 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: ```

Note that I have sse4_1 but not sse4_2. If I googled correctly, both missing instructions are new in sse4_2.

circlescodes commented 1 year ago

Hi man, i'm having the same issue like yours, i was changing cpus, and then i saw this on gdb: image

so, i was changing cpus from core 2 duo e6850, to xeon e5450, my linux kernel (uname -mrs) is Linux 5.15.0-79-generic x86_64

eclairevoyant commented 1 year ago

see https://github.com/oven-sh/bun/issues/67#issuecomment-1205545144, use one of the baseline builds

also this is a duplicate

Akuli commented 1 year ago

As far as I can tell, I am using the latest baseline build.

Electroid commented 1 year ago

We are unlikely to support very old CPUs like ThinkPad, sorry.