From: Henrik Gramner via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Henrik Gramner <henrik@gramner.com> Subject: Re: [FFmpeg-devel] [PATCH] checkasm: Generalize crash handling Date: Fri, 22 Dec 2023 22:30:07 +0100 Message-ID: <CAFGUN0o+bcFz8c7na_fVhc9y9c=HpQmizR6XanoN2BZ_n3BHxQ@mail.gmail.com> (raw) In-Reply-To: <DBADCB30-339F-4D82-93C8-AF96C0EEF1EF@remlab.net> On Fri, Dec 22, 2023 at 7:20 AM Rémi Denis-Courmont <remi@remlab.net> wrote: > >> > + checkasm_fail_func("%s", > >> > + s == SIGFPE ? "fatal arithmetic error" : > >> > + s == SIGILL ? "illegal instruction" : > >> > + s == SIGBUS ? "bus error" : > >> > + "segmentation fault"); > >> > >> The current code for the error print-out is both simpler and more versatile, > >> so I don't get this. > > > >IMO "illegal instruction" is a far better error message than "fatal > >signal 4" (with an implementation-defined number which nobody knows > >the meaning of without having to look it up). > > The current code prints the number and the name. Not on all supported systems. And even when it does it's in an implementation-defined and locale-dependent form, which isn't great. > >> + const struct sigaction sa = { > >> + .sa_handler = signal_handler, > >> + .sa_flags = SA_NODEFER, > > > >That does not look very sane to me. If a recursive signal occurs, processing > >it recursively is NOT a good idea. > > Following that, it actually seems safer to automatically reset the handler, using `signal()` or equivalently passing the `SA_RESETHAND` flag. Then the handler can rearm its own self if and *only* if it was able to actually handle the signal by observing a long jump. Resetting to default explicitly is no longer useful then. Sure, that approach sounds fine. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2023-12-22 21:30 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-19 12:02 Martin Storsjö 2023-12-21 11:37 ` Henrik Gramner via ffmpeg-devel 2023-12-21 12:06 ` Rémi Denis-Courmont 2023-12-21 12:30 ` Martin Storsjö 2023-12-21 20:16 ` Rémi Denis-Courmont 2023-12-21 22:03 ` Henrik Gramner via ffmpeg-devel 2023-12-22 5:55 ` Rémi Denis-Courmont 2023-12-22 6:20 ` Rémi Denis-Courmont 2023-12-22 21:30 ` Henrik Gramner via ffmpeg-devel [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAFGUN0o+bcFz8c7na_fVhc9y9c=HpQmizR6XanoN2BZ_n3BHxQ@mail.gmail.com' \ --to=ffmpeg-devel@ffmpeg.org \ --cc=henrik@gramner.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git