Note that there are some explanatory texts on larger screens.

plurals
  1. POWriting Signal handlers for Shared libraries or DLL?
    text
    copied!<p>I have a Application A(by some company X). This application allows me to extend the functionality by allowing me to write my own functions.</p> <p>I tell the Application A to call my user functions in the Applications A's configuration file (this is how it knows that Appl A must call user written Functions). The appl A uses Function pointers which I must register with Application A prior to calling my user written functions.</p> <p>If there is a bug or fault in my user written functions in production, the Appl A will stop functioning. For example, if I have a segmentation fault in my User written functions.</p> <p>So Application A will load my user written function from a shared DLL file. This means that my user written functions will be running in Application A' Process address space.</p> <p>I wish to handle certain signals like Segmentation fault, divide by zero and stack overflow, but applications A has its own signal handlers written for this, </p> <p>How can I write my own signal handlers to catch the exceptions in my user written functions, so that I can clean up gracefully w/o affecting much of Application A? Since my user functions will be called in Applications A's process, the OS will call signal handlers written in Application A and not my user functions.</p> <p>How can I change this? I want OS to call signal handlers written in my functions but only for signal raised by my functions, which is asynchronous in nature.</p> <p>Note: I do not have the source code of Application A and I cannot make any changes to it, because it's controlled by a different company.</p> <p>I will be using C , and only C on a Linux, solaris and probably windows platforms.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload