Re:Mio – Cross-platform header-only C++11 library for memory...
by pradn on Saturday October 20, 2018 @01:53PM
(#18264481)
A library that helped manage MMAP errors would be extremely helpful.
[ Parent
| on HN ]
Re:Mio – Cross-platform header-only C++11 library for memory...
by quotemstr on Saturday October 20, 2018 @03:07PM
(#18264876)
I wanted to help address this problem with my signal sharing API proposal. Unfortunately, the glibc people have the attitude that nobody should be using signals, and so they refuse to improve the signals API at all. I strongly disagree.
https://www.facebook.com/notes/daniel-colascione/toward-shar...
Re:Mio – Cross-platform header-only C++11 library for memory...
by spc476 on Saturday October 20, 2018 @05:46PM
(#18265667)
There's a reason for that---signals are horribly abused as a general purpose signaling mechanism. Originally they were for signaling of actual problems in the code (SIGSEGV, SIGILL) but later signals were not (SIGWINCH I'm looking at you!).
I read the page you linked to, and just off the top of my head, trying to manage paging by catching SIGSEGV is how do you determine that it's in response to a real bug (say, dereferencing an undefined pointer)? In my opinion, by the time you get a SIGSEGV, you can't trust the program at all. While it might be nice to have a process handle page faults itself, I think a better API than signal() is required.
Re:Mio – Cross-platform header-only C++11 library for memory...
by quotemstr on Saturday October 20, 2018 @07:23PM
(#18265996)
To distinguish the SIGSEGVs that represent crashes from ones representing faults you care about, you look at the fault address. It works perfectly well: every high performance Java or C# runtime on Linux (e.g., HotSpot, ART) does it. You can trust the program, because SIGSEGV delivery isn't magic.
As I detailed in the doc and on libc-alpha, you really do need some kind of synchronous exception mechanism to match how real hardware behaves, and it would behoove libc authors to make this mechanism not suck instead of pretending that synchronous faults would just go away.