tech.lgbt is one of the many independent Mastodon servers you can use to participate in the fediverse.
We welcome all marginalized identities. This Mastodon instance is generally for folks who are LGBTQIA+ and Allies with an interest in tech work, academics, or technology in general.

Server stats:

3.1K
active users

Public

New blog post! Debugging a rustc segfault using some very cool illumos debugging tools.

Really excited about this one, it is a bit long but there was so much to cover, from how the stack and the heap works to virtual address permissions :D

sunshowers.io/posts/rustc-segf

Debugging a rustc segfault on illumos · Debugging a rustc segfault on illumos :: sunshowersUsing `mdb` and `pmap` to find the cause of a crash.
Public

@rain

Notably, the crash is while compiling a crate called cranelift-codegen, which suggests automatic code generation.

it’s funny you say this, because it’s a very reasonable assumption, but actually this is one of rustc’s codegen backends, as an alternative to llvm. the whole cranelift backend is actually optional, one easy hack would’ve been just to disable it in your config.toml

crates.io/crates/cranelift-cod

crates.iocrates.io: Rust Package Registry
Public

@jyn @rain cranelift-codegen and specifically the bits that seem like they were causing issues *are* code-generated code (they're part of isle, cranelift's instruction selection dsl). so cranelift-codegen does have parts that are code generated, even though "codegen" in the crate name refers to generating actual machine code

Public

@iximeow @rain right, isle.rs is definitely autogenerated, that was a good catch by rain. but the rest of the crate isn’t, to my knowledge.

@iximeow @rain (while we’re on this topic, one more good systemic fix would be for x.py to notice when the build fails on an optional component and suggest disabling it)

Quiet public

@jyn @iximeow Oh that would be fantastic

Quiet public

@rain @iximeow it would be pretty easy to implement tbh, —exclude already exists so someone just needs to write the diagnostic, and each Step knows the path used to trigger it (x.py calls it should_run internally)