This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/67520] libmpx should abort() instead of exit(255) on bound violation detection
- From: "aivchenk at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Dec 2016 15:22:31 +0000
- Subject: [Bug other/67520] libmpx should abort() instead of exit(255) on bound violation detection
- Auto-submitted: auto-generated
- References: <bug-67520-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67520
Alexander Ivchenko <aivchenk at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aivchenk at gmail dot com
--- Comment #2 from Alexander Ivchenko <aivchenk at gmail dot com> ---
(In reply to Richard Biener from comment #1)
> IMHO libraries should have a way to specify a custom handler (and default
> that to abort maybe). Indeed exit (255) isn't very canonical.
Addressed in:
------------------------------------------------------------------------
r243928 | aivchenk | 2016-12-26 18:14:06 +0300 (Mon, 26 Dec 2016) | 14 lines
2016-12-26 Alexander Ivchenko <alexander.ivchenko@intel.com>
* mpxrt/libtool-version: New version.
* mpxrt/mpxrt-utils.c (set_mpx_rt_stop_handler): New function.
(print_help): Add help for CHKP_RT_STOP_HANDLER environment
variable.
(__mpxrt_init_env_vars): Add initialization of stop_handler.
(__mpxrt_stop_handler): New function.
(__mpxrt_stop): Ditto.
* mpxrt/mpxrt-utils.h (mpx_rt_stop_mode_handler_t): New enum.
* mpxrt/mpxrt.c (handler): Replace exit(255) with __mpxrt_stop
function call.
Now libmpx will call abort on bounds violations by default (User can restore
previous behavior with CHKP_RT_STOP_HANDLER env variable)