Earlier quoted context omitted.
No we removed many random crashes that the C++ code had. You cannot "simply" discard a crash report if something is slightly off because then you would discard most crash reports. And most debuginfo too. You can't expect "thing that runs when a process may have just experienced memory corruption" and "all builds of your application for all eternity" and "every toolchain you ever built your program with for all eterni…
Reminds me of "Your program shouldn't have bugs in it isn't an acceptable position to take for a debugger", from the rr folks. Unfortunately I can't find the source of the quote any more, but it stuck in my mind.
Everything Is Broken: Shipping Rust-Minidump at Mozilla
31–40 of 67 posts
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#32> You are reading part 1, wherein we build up our hubris.
Props to anyone willing to own their faults this readily:)
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#33Earlier quoted context omitted.
C++ has a series of issues. You can't trust pointers have a value, or that the value is valid, you can't trust that your enums have a value inside their interval, or in fact you can't trust that any value from any type is inside its interval at all. You also can't really trust that your values have the correct size. We choose some of those to ignore, otherwise we wouldn't be able to program at all, but C++ gives you…
> you can't trust that your enums have a value inside their interval If you don't set the underlying type, assigning a value that doesn't match an enumerator via `static_cast` is undefined behavior. See https://en.cppreference.com/w/cpp/language/enum . (Doing weird pointer casting things is also undefined behavior per the strict aliasing rule, though, come to think of it, I'm not sure whether memcpying an out-of-rang…
Choosing one just makes a difference because code has problems.
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#34Gankra is the most entertaining Rust author (Rust programmer who writes about Rust). Easily.
For example, Rust deliberately doesn't have the tertiary operator, and random other types don't get silently coerced as booleans - so you can't write a = x ? 1 : -1; however you can write a = if x != 0 { 1 } else { -1 }; with the same effect. But Mara isn't satisfied with this verbose yet sensible answer, and proposes you could instead, for example:
a = x.count_ones().count_ones().count_ones().count_ones() as i32 * 2 - 1;
Hilarious? Or maybe terrifying? Entertaining certainly. https://twitter.com/m_ou_se/status/1404034056405368833?lang=...
Aria is more informative but I'm not going to end up choking and spilling my beverage all over the desk.
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#35Now I know there's nice Rusty work happening with this stuff that I could maybe make use of for my next employer or a personal project. Neat.
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#36Thank you for this work! I've been involved with minidumps in one way or another since around 2010. Was at a startup at the time that had a browser based on Chromium and we needed crash reporting for our own app. So I wrote a pretty simply backend that received minidumps, ran them through the breakpad processor and shoved the output into Splunk. That was our crash-reporting system. Circa 2013 the company gets acquire…
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#37Thank you for this work! I've been involved with minidumps in one way or another since around 2010. Was at a startup at the time that had a browser based on Chromium and we needed crash reporting for our own app. So I wrote a pretty simply backend that received minidumps, ran them through the breakpad processor and shoved the output into Splunk. That was our crash-reporting system. Circa 2013 the company gets acquire…
I was recently looking into CoffeeCatch for Android. Are you saying that I'm losing my time? :-)
https://github.com/ivanarh/libcorkscrew-ndk
https://github.com/ivanarh/libbacktrace-ndk
https://github.com/ivanarh/libunwind-ndk
https://github.com/ivanarh/libunwindstack-ndk
Along with a wrapper that can use all of them:
https://github.com/ivanarh/ndcrash
It's been a while since I dealt with this and I don't recall why Android keeps changing unwinders. Looks like Sentry is using libunwindstack-ndk (well a fork of it anyway) on Android:
https://github.com/getsentry/sentry-native/tree/master/exter...
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#38Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#39I wonder how much of the benefits comes from the rewrite itself and not Rust. I have taken really bad hard to maintain very large code bases written in C++ and step-by-step refactored it into bug free maintainable code. In my experience bad code written in any language is hard to maintain. And good code written in any language is easy to maintain. I have worked with C code that was a joy to maintain and C code that w…
The great thing about Rust is that it reduces the knowledge and skill a developer needs in order to write a stable and (usually) performant program. This is a good thing.
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#40I wonder how much of the benefits comes from the rewrite itself and not Rust. I have taken really bad hard to maintain very large code bases written in C++ and step-by-step refactored it into bug free maintainable code. In my experience bad code written in any language is hard to maintain. And good code written in any language is easy to maintain. I have worked with C code that was a joy to maintain and C code that w…
All that being said, I would choose Rust over C++ for any new development anywhere. If my boss told me we had to use C++ for a new project I would actually quit. I've worked on plenty of C++ codebases (including Firefox) in my career. Sure, you can write bad code in any language, but C and C++ are just bad languages.
(I also ported Mozilla's sccache tool from the original Python implementation to Rust, which was a fun exercise. The Rust version is in production use in a wide variety of places, and AFAIK is still the only ccache-like tool that can cache Rust compilation.)