title: c++ dynamic library segfault
body: <p>I'm writing network application in c++ and I want to enable making plugins, but I don't know what to do, to protect my application from errors like segfault. For example:
  I have interface:</p>
  
  <pre><code>class IPlugin{
  public:
    IPlugin();
    virtual ~IPlugin();
    virtual void callPlugin() = 0;
  }
  </code></pre>
  
  <p>And someone will write dynamic library:</p>
  
  <pre><code>class Plugin : public IPlugin{
  public:
    Plugin();
    virtual ~Plugin();
    virtual void callPlugin();
  }
  
  void Plugin::callPlugin(){
    int* a = NULL;
    *a = 5;
  }
  </code></pre>
  
  <p>Calling this function in my app will end with terminating everything. I know that I can use fork(), but functions in plugins will be short and will be used many times, so I think that fork() is too slow. Any ideas?</p>
  
  <p>PS. And sorry for my English.</p>