-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Zig build causes segfault when package manager depends on .url from github with https #15723
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
Maybe it's caused by the new package manager and when .url in the .dependencies for a package is unavailable, it would cause this problem. |
@edyu are you invoking |
On subsystem folder. |
Here is the config that would've have caused it. .{ .name = "My example project", .version = "0.0.1", .dependencies = .{ // zap release-0.0.20 .zap = .{ .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz", .hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da", } } } |
Can confirm that this is happening on WSL, when gdb is not present.
Builds as expected if I remove the zon file. |
on linux that yields the following, though it is also weird how there's an extra line between the caret and the message
|
As of zig version |
Now the error is |
And sometimes |
Still having the following error at
|
And I can confirm that if i replace the url with a localhost serving the tar.gz such as python and I change the |
btw, I'm running Ubuntu 22.04 LTS in WSL2 on an AMD 5800HS (not sure how relevant). |
zig build segfaults at least 33% of the time if it needs to fetch packages. it has done so for a while. this issue was shadowed by more frequent TLS bugs before. I can't poinpoint to where exactly it is crashing until we get zig debug builds. I run nightly CI builds and the chance of waking up to a segfaulted build is > 33% |
One thing I know that segfault happens is when network is spotty. I believe one of the reason is that when network is spotty, the package fetched is either incomplete or 0 bytes and somehow the code is trying to read that which would cause segfault. I've noticed I can make this happen on my computer when my network is crappy but if it run it enough times, network would be intermittent ok and then it would be ok. |
I want to show an example of the problem. This is from a new machine that was just setup so there is nothing in the zig cache. You can see
|
Can you reproduce the issue with a debug build of the compiler? |
If you can point me to what I need to do and I'll try. |
Check out the zig wiki on GitHub. I would start here: https://github.com/ziglang/zig/wiki/Contributing#editing-source-code - contains a link to building from source but focusses on editing and running your modified version, e.g. when you put print debug statements in there etc. BTW make sure you don't build release when you copy the command line flags 🙂. |
0.11.0-dev.3879+5804f3f75 is the version I'm running now |
Zig Version
0.11.0-dev.3879+5804f3f75
Steps to Reproduce and Observed Behavior
This is more of informational than exact step. I don't know enough of the internals to pinpoint where the error originated from but maybe someone who does can see what would cause this problem.
I have 2 laptops (one has intel and the other has amd). Both run windows 11 and I use both with Ubuntu 22.04 LTS WSL2.
On one of them when I call zig build on for example the zigzap/zap repository, it would cause the following error:
signal SIGSEGV (Address boundary error)
However, after I installed gdb with
sudo apt install gdb
the problem went away. SEE BELOWEDIT: It didn't go away as I now realized that once I download it once (using a workaround of localhost serving the package with http not https) and it gets cached.
EDIT2: The package IS available at the url as I can download the package manually.
Expected Behavior
Should compile ok without installing gdb first.
The text was updated successfully, but these errors were encountered: