tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Translate signal to C++ exception



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 10.04.2016 09:07, Martin Husemann wrote:
> On Sat, Apr 09, 2016 at 11:06:56PM +0200, Kamil Rytarowski wrote:
>>> Are we talking about sync or async signals? For sync signals,
>>> it is no big issue. Async signals are a whole lot different and
>>>  sigaltstack is difficult to avoid for them.
>>> 
>> 
>> SIGSEGV from the code, I assume it's synchronous one from the
>> program point of view.
> 
> What about FP exceptions?
> 
> It probably would help if you post the complete list of exceptions 
> generated and the siginfo details (there must be a mapping in the 
> code), as from windows background I would expect it to be very
> limited and far away from the general case.
> 

For now all exceptions to handle is bad memory address write or read.
I expect also division by 0 - but it will pop up in tests with running
the managed code.

Ithers like stack overflow are to be ignored.

> Couldn't we arrange for a special return trampoline that is
> registered upfront with a per thread exception object for each
> mapping, then fill it in the handler with usefull information and
> have the trampoline return it as the exception object? And have the
> application abort on recursive exceptions of the same type?
> 

Is it doable with 7.0 (if not in 7.0.1/7.1?)? If so how? I was looking
at API to register new trampoline, it's available in the GNU world but
I missed this possibility in our case.

I also noted that our trampoline isn't recognized by GDB, I wasn't
investigating it deeply.. but shouldn't the code use CFI markers? I
will try to research it prepare a patch and see what happens.

> Martin
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXCkQmAAoJEEuzCOmwLnZshYkQAJNSxa0Ha1fdYPF30hFdVrK4
0GiGwQYRFR/rnQ31HzIh+bIiL7zb7L6DL+Ii6QNvyuvFjXVaCYhpi84LVBryUNWL
lkvVQI+Ve4VawdV65jEafZse/Kirp2jsuLlR7HMXePkBWUIEUdma/Zrem/iy6JVk
SptFjTGtxM1kydco8m94lGFDxASArNKgmrTMm6mBfulK4Ht/aEUwgaNIw3wpYo/W
S1I04CaC1G8WHhNU/PB7CE4bzCGnQZpDoG+0ZPYkeWYiQsA7dKiJhI4sB0NGKPWG
mXBG0GpwpiFUQmjsxLxBY4oDeRGLGnPCd5y9yQdhicMTP1RmQr3YAOQCZkXnMhPL
w3eVZIqzY0cf7B+RjLYKqNyDciX8i4F/pW/BNb2zdohE9qC2ANyf0Pdo5QVwBH62
O+cQOtTFRN/nGSBbgSNWJbtN5UdOl6BJogNR6Tk7HDSUrwaXTby94IK/pkDgJ5AZ
T2tx43phiD6T+ld2I1QLKs+ovqDTAVLs8fOvW+HXT9lp4NeWqA5rApr6bLdFg/DX
PC+WpUQxSGVzACZOYvfREr0HNfx8ip+l6PwQVe4BStdWN/F2m4eTD+hEc9SsI0DF
LQXMYoUHAjFLm7JAZuo3aiDaVsMwyvqwFuu9lBMPZqfU/rxUouwntrhfSNiMy+44
TfBhqbZjAkTh8s00v5XX
=4gyT
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index