Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2016 21:28:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 211123] Throw C++ exception from a signal handler.
Message-ID:  <bug-211123-8-UBjpXPixYC@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-211123-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-211123-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211123

Jilles Tjoelker <jilles@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles@FreeBSD.org
           Keywords|patch                       |

--- Comment #1 from Jilles Tjoelker <jilles@FreeBSD.org> ---
This could be because FreeBSD's signal trampoline does not have proper unwi=
nd
information since it is not part of a proper ELF object. Debuggers such as =
gdb
have a special case for this but the unwinder for C++ exceptions does not.

If you really want to do this, a workaround could be a sigjmp_buf in
thread-local storage.

The null pointer dereference does not raise SIGSEGV because clang detects i=
t as
undefined behaviour, replacing it with an ud2 instruction and deleting
everything after it.

Apart from that, throwing exceptions from arbitrary points in the code is
rather unsafe. Per gcc's documentation, even -fnon-call-exceptions will not
handle asynchronous exceptions. Safely interrupting code at any location
requires process isolation or severe restrictions on the code.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211123-8-UBjpXPixYC>