I'm attempting to update to 0.12.0 for a personal project and got a compiler crash hitting a breakpoint trap (Same on the latest master 0.13.0-dev.46+3648d7df1). Since the compiler is stripped I can't get a stack trace to know where the crash happens and my computer doesn't have enough memory to build Zig myself. I'd like to report a more useful issue than "compiler crashed. halp," but this project is a little large (~30k lines) so I can't easily pin down the cause unless there are some compiler options I don't know about.
#Are debug builds of the compiler available anywhere?
1 messages · Page 1 of 1 (latest)
you can just compile a debug build yourself, there arent any debug builds to download that i know of
if you'd like i can run it
how much ram do you have? there were OOM issues in stage1, but afaik the self-hosted compiler should be pretty okay on memory usage
i am litearlly blind and missed the line where you said you dont have enough memory 🤣
you shouldnt need more than ~7gb of ram
About 4G, my computer is over a decade old
oof
damn, impressive
yeah :P
you might have better luck building without llvm?
will be much faster to build too lol
we've gotta make the switch to ReleaseSafe binaries soon
mlugg was talking about it
and if the crash happens in sema it should still trigger just fine, even if your project doesn't work properly with the self-hsoted backends yet
yeah, I'm sad this didn't make it into 0.12 :(
@gaunt mural i could run your project and give you the strace trace so you can open an issue if you'd like though
or maybe i could send you a tarball of a debug build
although those are pretty large
Ill try building without llvm and try to go from there
another option you could try is using zig reduce to reduce the issue, though I've not used it so can't provide much guidance, and it might take a while on such a large project
you'll clone the zig repo and do zig build -Denable-llvm=false -Duse-llvm=false
what about bootstrap.c
don't need it if you already have a zig compiler
Okay, I don't have the time to do all this atm, but will report back. Thanks y'all
we don't need to do the whole cmake or zig bootstrap song and dance anymore? I can just zig build the compiler? 😮
You may still need to bootstrap in some cases
those cases being needing to change or fix things in stage{Not-last}?
I don't have brain cycles to actually work on the compiler, just occasionally wanted to put a breakpoint in there to help figure out an error, or even to just get a debug build for a good trace when there's an unexpected error
anyone can obtain a stack trace, what we really need is a reproducer
for sure, my aim would be to give myself someplace to start paring down a repro for y'all a little faster than just incrementally removing code
I haven't needed to do this lately though since all my really inscrutable bugs were caught by the comptime memory changes 🙂
zig build didn't work for me out of the box:
not sure if I'm missing something- probably
master source with master compiler
you need a compatible compiler, aka from the same (or close enough) commit
this is not close enough
although maybe it will work if you add --zig-lib-dir lib
0.13.0-dev.46+3648d7df1 building 16d368d0d28b1654dae5e405b9e6e067f833e1cf
3648d7df1 != 16d368d0d28b1654dae5e405b9e6e067f833e1cf
zigup master worked for me 🤷
0.13.0-dev.46+3648d7df1 is the latest nightly, which is on a 6 hour delay from actual master
the master on ziglang.org (zig-windows-x86_64-0.13.0-dev.46+3648d7df1.zip) says 2024-04-26
is the date wrong or is it just not master?
crikey that commit is from 10 days ago, 3648d7df19642b6902b3f75538a826a322211673
sorry I'm being silly, likely just pushed recently
it's been broken since yesterday because of me, who knows why it was broken before that
aha, yeah it's not working because we are in the middle of an llvm upgrade
decided to just checkout to 3648d7df19642b6902b3f75538a826a322211673, zig build - how's 1 minute and 47 seconds?
Okay, I was able to build without llvm (still had to set --maxrss to 7gig, but it didn't actually use that much), and got a stack trace for the compiler crash. Going to try reducing it now for a report. Thanks y'all!