profanity icon indicating copy to clipboard operation
profanity copied to clipboard

Change assert behavior

Open H3rnand3zzz opened this issue 1 year ago • 2 comments

Currently, we have many "asserts" in a code that would cause a crash and not every time it is possible to reproduce, as well as dump might be unavailable. I propose to use wrapper over a default "assert" (or even a custom solution) which would add logging, which can provide us additional data on the issues.

@sjaeckel @pasis , I would gladly hear your opinion on this considering your level of expertise in deep topics as such.

H3rnand3zzz avatar Oct 13 '23 10:10 H3rnand3zzz

wrappers around asserts or abort() calls is a common solution. Just a simple example which allows you to print any info: https://github.com/pasis/pppoat2/blob/master/src/trace.h#L101 . You can also print the stacktrace, but I don't have quick example atm.

pasis avatar Oct 17 '23 20:10 pasis

wrappers around asserts or abort() calls is a common solution. Just a simple example which allows you to print any info: https://github.com/pasis/pppoat2/blob/master/src/trace.h#L101 . You can also print the stacktrace, but I don't have quick example atm.

That's exactly what I was thinking. Printing a stack trace :) Thanks for sharing.

I am also thinking about wrapping the Profanity in something like breakpad in the future so we can reliably get crash data every time (ofc with users' consent, but even with manual data sending it would be ok).

H3rnand3zzz avatar Oct 17 '23 21:10 H3rnand3zzz

Not a big fan of this. And since noone else reviewed yet I'll close.

jubalh avatar Mar 21 '24 12:03 jubalh