#Are debug builds of the compiler available anywhere?

1 messages · Page 1 of 1 (latest)

gaunt mural
#

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.

charred fulcrum
#

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

fiery bone
charred fulcrum
#

i am litearlly blind and missed the line where you said you dont have enough memory 🤣

#

you shouldnt need more than ~7gb of ram

gaunt mural
fiery bone
#

oof

charred fulcrum
#

damn, impressive

gaunt mural
#

yeah :P

fiery bone
#

you might have better luck building without llvm?

#

will be much faster to build too lol

charred fulcrum
#

we've gotta make the switch to ReleaseSafe binaries soon
mlugg was talking about it

fiery bone
#

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

fiery bone
charred fulcrum
#

@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

gaunt mural
#

Ill try building without llvm and try to go from there

fiery bone
#

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

charred fulcrum
worn cliff
#

what about bootstrap.c

fiery bone
#

don't need it if you already have a zig compiler

gaunt mural
#

Okay, I don't have the time to do all this atm, but will report back. Thanks y'all

warm silo
#

we don't need to do the whole cmake or zig bootstrap song and dance anymore? I can just zig build the compiler? 😮

fiery bone
#

You may still need to bootstrap in some cases

warm silo
#

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

tepid axle
#

anyone can obtain a stack trace, what we really need is a reproducer

warm silo
#

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 🙂

bronze ether
#

zig build didn't work for me out of the box:

#

not sure if I'm missing something- probably

#

master source with master compiler

tepid axle
#

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

bronze ether
#

0.13.0-dev.46+3648d7df1 building 16d368d0d28b1654dae5e405b9e6e067f833e1cf

tepid axle
#

3648d7df1 != 16d368d0d28b1654dae5e405b9e6e067f833e1cf

bronze ether
#

I didn't realise it was the commit id

#

hum zvm seems to fail to install master

warm silo
#

zigup master worked for me 🤷

tepid axle
#

0.13.0-dev.46+3648d7df1 is the latest nightly, which is on a 6 hour delay from actual master

bronze ether
#

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

tepid axle
#

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

bronze ether
#

decided to just checkout to 3648d7df19642b6902b3f75538a826a322211673, zig build - how's 1 minute and 47 seconds?

gaunt mural
#

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!