The sound distributed version control system

#923 [CRASH] make crashed command return non-zero code

Opened by tankf33der on April 1, 2024
tankf33der on April 1, 2024

Lets take a example from #911.

It returns zero on exit and test suite CAN NOT detect the crash! Is it standard behavior or only works like this in this case ?

pijul init p1
cd p1
pijul add -rf /dev/urandom
# CRASH!
echo $?
0
dblsaiko added a change on April 1, 2024
36OW3F4BW33NMPMFJZ5WWDMYGLBPTJ4LKWCXY5PSKMGC2J7HPW3AC
tankf33der on April 2, 2024

@dblsaiko: i found a double crash, is it you? :)

[mpech@lambda p1]$ pijul add -rf /dev/urandom 
Well, this is embarrassing.

pijul had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-8d2d0ee6-f092-4bfa-9c92-e9c8b8464abc.toml". Submit an issue or email with the subject of "pijul Crash Report" and include the report as an attachment.

- Authors: Pierre-Étienne Meunier <pe@pijul.org>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
Well, this is embarrassing.

pijul had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-ee9de63c-7b17-40cd-a2fb-b077d9f670b1.toml". Submit an issue or email with the subject of "pijul Crash Report" and include the report as an attachment.

- Authors: Pierre-Étienne Meunier <pe@pijul.org>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
[mpech@lambda p1]$ echo $?
101
dblsaiko on April 2, 2024

Yeah, that’s because the panic handler is installed for every thread. The inner thread panics, prints the message, then the outer thread panics because of that, and also prints the message. It looks better without the panic handler ;)

Not sure if that can be done better, I haven’t looked too closely at how the crate that prints this message (human_error) works.

dblsaiko on April 2, 2024

Oh sorry, the crate is called human-panic.

tankf33der on April 2, 2024

@dblsaiko: tell me the problem only in this case or related to all panics?

tankf33der on April 2, 2024

I want Test suite catch all panics.

dblsaiko on April 2, 2024

It’s only this case. If there’s other cases, they also need similar changes to make sure panics are propagated to the main thread.