-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Zig crashes on LoongArch64 #22859
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
Comments
a reduction: zig build-exe hello.zig
trace from debug zig
I used the following steps to get
diff --git a/build b/build
index fb259b0ff..c9f67f491 100755
--- a/build
+++ b/build
@@ -5,9 +5,10 @@ set -eu
TARGET="$1" # Example: riscv64-linux-gnu
MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
+MCMODEL_FLAGS="-mcmodel=medium"
ROOTDIR="$(pwd)"
-ZIG_VERSION="0.14.0-dev.2257+e6d2e1641"
+ZIG_VERSION="0.14.0-dev.3205+6dc1a4db7"
TARGET_OS_AND_ABI=${TARGET#*-} # Example: linux-gnu
@@ -98,6 +99,7 @@ $ZIG build-lib \
--name zstd \
-target $TARGET \
-mcpu=$MCPU \
+ $MCMODEL_FLAGS \
-fstrip -OReleaseFast \
-lc \
"$ROOTDIR/zstd/lib/decompress/zstd_ddict.c" \
@@ -197,8 +199,8 @@ $ZIG build \
--search-prefix "$ROOTDIR/out/$TARGET-$MCPU" \
-Dflat \
-Dstatic-llvm \
- -Doptimize=ReleaseFast \
- -Dstrip \
+ -Doptimize=Debug \
+ -Dstrip=false \
-Dtarget="$TARGET" \
-Dcpu="$MCPU" \
-Dversion-string="$ZIG_VERSION"
|
$ git bisect bad
f278038923c33ddf710f0328a07ce18613a94130 is the first bad commit
commit f278038923c33ddf710f0328a07ce18613a94130 (HEAD)
Author: David Rubin <daviru007@icloud.com>
AuthorDate: Sat Nov 30 16:08:26 2024 -0800
Commit: Andrew Kelley <andrew@ziglang.org>
CommitDate: Fri Jan 17 12:34:15 2025 -0800
replace `compiler_rt` memcpy with a better version
lib/compiler_rt.zig | 1 -
lib/compiler_rt/memcpy.zig | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
lib/compiler_rt/memmove.zig | 25 ----------------
3 files changed, 130 insertions(+), 39 deletions(-)
delete mode 100644 lib/compiler_rt/memmove.zig |
#22606 crashes in ReleaseFast. Debug, ReleaseSmall, ReleaseSafe not crash. ReleaseFast crashes on another place:
|
There seems to be some race conditions (or miscomp?). By repeating starting Zig, it sometimes worked well! |
All analysis on this so far indicates that we're hitting multiple LLVM bugs. The plan is to ship 0.14.0 with this regression and hope that the situation has improved in LLVM 20. |
#22780 seems to have fixed this and the latest dev version is working. |
Uh oh!
There was an error while loading. Please reload this page.
Zig Version
0.14.0-dev.3187+d4c85079c
Steps to Reproduce and Observed Behavior
zig init
thenzig build
, got'zig build' terminated by signal SIGSEGV (Address boundary error)
On earlier versions,
zig init
build successfully but building the currentmaster
zig crashes (SIGBUS or SIGSEGV).On latest versions,
zig init
-projects also could not be built.Expected Behavior
It should build.
The text was updated successfully, but these errors were encountered: