Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Handling Segfaults

Name: Anonymous 2016-09-09 22:18

What is the most portable way to catch segfaults together with their addresses and then resuming at the place where it happened? I.e. to handle array out of bounds exception by expanding array.

I know it is done with signal() on POSIX and with SetUnhandledExceptionFilter() on Windows. But you cant define signal() for Windows, because it has its own stripped down version, useful only for the purpose of handling CTRL-C.

Both don't signal() and SetUnhandledExceptionFilter() have no means of recovering from error.

Name: Anonymous 2016-09-20 4:47

>>40
Kernel32/User32/Crss/Gdi32 is just a layer over
https://en.wikipedia.org/wiki/Native_API

Name: Anonymous 2016-09-20 6:05

>>38
Exceptions-related boilerplate slow down startup time and pollute CPU caches.

Name: Anonymous 2016-09-20 6:10

Name: Anonymous 2016-09-20 6:12

>>41

In other words you have Python, which has bindings to C++/Boost, which wraps over libc, which wraps over kernel32, which wraps over ntdll, which wraps over ntoskrnl.exe, which wraps over device drivers, which wrap over some virtualization framework or Wine running on some OSX or Linux or even Windows. And so ad infinitum.

Name: Anonymous 2016-09-20 6:18

>>44
Not only that consider the complexity of CPUs executing microcode programs and firmware
https://github.com/jbangert/trapcc

Name: Anonymous 2016-09-20 8:27

>>42
Have you numbers to show me the difference? I suspect the difference is about 1000 cpu cycles in unneeded overhead and 1000 instances of cache misses for each time you run the program.

Name: Anonymous 2016-09-20 14:48

>>46

depends on how you use the executable. If you use it in a tight bash loop, then it counts or it is huge highly used executable, like Firefox, half of which consists of boilerplate.

Name: Anonymous 2016-09-20 19:31

>>40
Great job turbonerd, everyone now knows what a whizkid you are with your little shitsembler. Wow, no one cares! We were clearly talking about C, and the only thing you have shown is that you have nothing to offer anyone and you're going to die alone. Get a life, loser.

Name: Anonymous 2016-09-20 19:48

>>48
Rude.

Name: Anonymous 2016-09-20 20:51

>>41
RtlAdjustPrivilege
lol

Name: Anonymous 2016-09-20 21:27

>>49
I'm rude? >>40 chan just whipped out his cock and started beating off to his own self-image right in front of us. He's the rude obe!

Name: Anonymous 2016-09-21 7:44

>>48
you know it's disassembled C code, right? IHBT?

Name: Anonymous 2016-09-22 16:23

>>9
So you just run everything in debug mode. G-d, sometimes I think everyone but me is retarded.

Name: Anonymous 2016-09-22 16:54

>>53
Debug mode adds bloat.

Name: Anonymous 2016-09-22 17:27

>>52
No it isn't, stop slandering me. What makes you think that it's disassembly? What compiler would produce anything like that without startup\breakdown code, and not linking to kernel32 (you know, the entire point)? What disassembler even outputs FASM syntax? Just because you can't do something, don't assume no one can, /g/-kun.

Name: Anonymous 2016-09-22 18:50

>>41,48
Turds!

Name: Anonymous 2016-09-24 19:30

Name: Anonymous 2016-09-24 21:37

More like smegfaults, amirite

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List