I just got a free(): invalid pointer in a rust program (while unwinding) so, yeah, I need a quick break
-
-
ooh, LLDB shows more deets, looks like it crashes when dropping `delf::ProgramHeader`pic.twitter.com/UeSoWrYsSG
Prikaži ovu nit -
my current working theory is that one of my `mmap` calls is accidentally unmapping a previously-mapped region used as backing memory for a `Vec`, and when dropping the `Vec`, well, all hell breaks loose This only happens with large enough Vecs, so it didn't happen beforepic.twitter.com/QGyNt7TpiY
Prikaži ovu nit -
-
lessons learned: - don't write articles while extremely tired
- mmap with MAP_FIXED is *way dangerous*
- using LLDB for day-to-day stuff sounds worth it
Prikaži ovu nit -
Okay, after some additional bug-hunting, https://fasterthanli.me/blog/2020/dynamic-symbol-resolution/ … is all fixed up and our codebase should *not* blow up the minute we run it on real-world executables
Prikaži ovu nit -
There was another subtle bug btw: malloc/free misuse is SO EASY to identify as compared to mmap misuse. The memory manager will happily unmap crucial stuff from under you and it'll blow up way later.pic.twitter.com/Z4UANRnq6g
Prikaži ovu nit -
The worst part is that you can't really write a sanitizer for mmap mis-use because remapping regions is 100% legitimate usage and something the dynamic linker does a bunch
Prikaži ovu nit -
tl;dr we need a "unfuckingsafe" keyword for the https://crates.io/crates/mmap crate
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
This probably would have been a good application for rr, actually. It has features like "when did this variable last get set?"
-
I did install rr, but I don't think it would've saved me - do the write barriers trigger if someone remaps a region from under you?
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
rust, go, compilers, music, gamedev
donate:
watch:
he/him
