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

on x86-64-v1, orjson throws Illegal Instruction (core dumped) #383

Closed
CrystalSpore opened this issue May 6, 2023 · 4 comments
Closed

on x86-64-v1, orjson throws Illegal Instruction (core dumped) #383

CrystalSpore opened this issue May 6, 2023 · 4 comments

Comments

@CrystalSpore
Copy link

CrystalSpore commented May 6, 2023

Hello,

I was using a program that utilizes orjson, & with the update last week here, this seems to have made orjson incompatible on my VM.

With some help from the devs of the program, they helped create a Python script for reproducing the error:

import orjson

orjson.loads('{}')
orjson.loads('{"id": "170520363824971776", "username": "Example", "global_name": null, "display_name": null, "avatar": "c0314fca98279317b0b8d406539c5ec0", "discriminator": "1234", "public_flags": 0, "flags": 0, "bot": true, "banner": null, "banner_color": null, "accent_color": null, "bio": "", "locale": "en-US", "mfa_enabled": true, "premium_type": 0, "linked_users": [], "avatar_decoration": null, "email": null, "verified": true}')

Which has the core dump on line 4

Then using this script, we determined that my VM has only x86-64-v1 support:

#!/usr/bin/awk -f

BEGIN {
    while (!/flags/) if (getline < "/proc/cpuinfo" != 1) exit 1
    if (/lm/&&/cmov/&&/cx8/&&/fpu/&&/fxsr/&&/mmx/&&/syscall/&&/sse2/) level = 1
    if (level == 1 && /cx16/&&/lahf/&&/popcnt/&&/sse4_1/&&/sse4_2/&&/ssse3/) level = 2
    if (level == 2 && /avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/) level = 3
    if (level == 3 && /avx512f/&&/avx512bw/&&/avx512cd/&&/avx512dq/&&/avx512vl/) level = 4
    if (level > 0) { print "CPU supports x86-64-v" level; exit level + 1 }
    exit 1
}

OS: Ubuntu 22.04
VM CPU: kvm64
Host OS: Proxmox
Host CPU: Ryzen 5 5600G

Any chance for dual support of x86-64-v1 & x86-64-v2?

@ijl
Copy link
Owner

ijl commented May 7, 2023

x86-64-v2 is 2009-era hardware and your hardware supports it, the VM is just misconfigured.

@ijl ijl closed this as completed May 7, 2023
@Jackenmen
Copy link

Jackenmen commented May 11, 2023

I don't think my comment is really actionable but I must say that I was lowkey surprised to find that over just the last 3 days, I have already seen 3 different people that, unlike the reporter in this issue, are self-hosting things on their old hardware with CPUs and are now running into this. So far I've seen Intel Core 2 Duo T5670, Intel Pentium E2200, and an old OptiPlex with Intel Core 2 Duo E4400 😄

Edit: 4 now, got another person who has AMD Phenom II X6 1090T processor; apparently AMD was late and their first x86-64-v2 processors were released in late 2011
Edit 2: 5 now, got another person, this time with AMD Athlon LE-1660 processor :)

@andersk
Copy link
Contributor

andersk commented May 25, 2023

At Zulip we’ve had two independent reports of this crash on pre-2009 CPUs (not just misconfigured VMs—we checked). I’m normally a strong proponent of forward progress, but hardware isn’t cheap these days. How significant is the performance boost from dropping these older CPUs? Would it be reasonable to reconsider this for now?

@ijl
Copy link
Owner

ijl commented May 25, 2023

Hm, ok, I've reverted 3.8.14 to use x86-64. This wasn't for performance but because some distributions are moving to a x86-64-v2 baseline and well is 14 years enough to not restrict yourself to SSE2? I guess not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants