Company
Date Published
Author
Jan Michael Auer
Word count
908
Language
English
Hacker News points
None

Summary

The text discusses debugging a segmentation fault in Rust using the Sentry Native SDK. The authors initially thought it would be funny to crash Symbolicator, but eventually decided to fix the issue instead. They chose to introduce a segmentation fault by dereferencing a null pointer and tried to assign a value to it. Symbolicator is written in Rust and uses the Rust standard library's APIs for explicit error handling, making unchecked exceptions unlikely. However, the authors found that the SDK could not handle hard application crashes, so they used the Native SDK to create a minidump when the application crashed. They linked the dynamic library of the SDK to their Rust application using Cargo and compiled a small C file that initialized the SDK and exported a function to their Rust code. The authors were able to call the C function directly from Rust code and upload debug information to Sentry, which resolved the bug and pointed to the unsafe line of code causing the segmentation fault.