title: Oracle Pro*C/OCI install handlers for SIGSEGV/SIGABRT and friends - why, and how to disable?
body: <p>When using Pro*C (a embedded SQL preprocessor from Oracle for C-Code) or OCI I noticed that the connect/init routine installs some signal handlers.</p>
  
  <p>That means before a</p>
  
  <pre><code>EXEC SQL CONNECT :username IDENTIFIED BY :password USING :dbspec ;
  </code></pre>
  
  <p>or a</p>
  
  <pre><code>OCIEnvNlsCreate()
  </code></pre>
  
  <p>I can verify that for example those signals have following handlers:</p>
  
  <pre><code>No              NAME                Pointer   SA_SIGINFO   SIG_DFL   SIG_IGN
  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
   1            SIGHUP                  (nil)        false      true     false
   2            SIGINT                  (nil)        false      true     false
   3           SIGQUIT                  (nil)        false      true     false
   4            SIGILL                  (nil)        false      true     false
   5           SIGTRAP                  (nil)        false      true     false
   6           SIGABRT                  (nil)        false      true     false
   7            SIGBUS                  (nil)        false      true     false
   8            SIGFPE                  (nil)        false      true     false
   9           SIGKILL                  (nil)        false      true     false
  10           SIGUSR1                  (nil)        false      true     false
  11           SIGSEGV                  (nil)        false      true     false
  12           SIGUSR2                  (nil)        false      true     false
  13           SIGPIPE                  (nil)        false      true     false
  14           SIGALRM                  (nil)        false      true     false
  </code></pre>
  
  <p>After the connect/init statement the table looks like:</p>
  
  <pre><code>No              NAME                Pointer   SA_SIGINFO   SIG_DFL   SIG_IGN
  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
   1            SIGHUP                  (nil)        false      true     false
   2            SIGINT         0x7eff9e60bdac         true     false     false
   3           SIGQUIT         0x7eff9ea17f9c         true     false     false
   4            SIGILL         0x7eff9ea17f9c         true     false     false
   5           SIGTRAP         0x7eff9ea17f9c         true     false     false
   6           SIGABRT         0x7eff9ea17f9c         true     false     false
   7            SIGBUS         0x7eff9ea17f9c         true     false     false
   8            SIGFPE         0x7eff9ea17f9c         true     false     false
   9           SIGKILL                  (nil)        false      true     false
  10           SIGUSR1                  (nil)        false      true     false
  11           SIGSEGV         0x7eff9ea17f9c         true     false     false
  12           SIGUSR2                  (nil)        false      true     false
  13           SIGPIPE                    0x1         true     false      true
  14           SIGALRM                  (nil)        false      true     false
  </code></pre>
  
  <p>where 0x7eff9e60bdac denotes <code>sslsshandler()</code> and 0x7eff9ea17f9c denotes <code>skgesig_sigactionHandler()</code> - both symbols defined in <code>libclntsh.so.11.1</code> - the Oracle runtime library.</p>
  
  <p>I am concerned about those Oracle signal handlers because it seems that they introduce quite some non-deterministic behaviour. That means depending on the OS, hardware and kind of segfault/abort I've observed following behaviour:</p>
  
  <ul>
  <li>an ugly stacktrace that does not contain much useful information</li>
  <li>direct program exit with exit-status 1 - without any core file writing and no error message</li>
  <li>direct program exit with exit-status 0 (sic!)</li>
  </ul>
  
  <p>Especially the last behaviour is grotesque.</p>
  
  <p>Thus, I am interested in:</p>
  
  <ul>
  <li>the motivation - why are those signal handlers installed by Oracle?</li>
  <li>how to disable them? - at least for signals that yield a core file by default - because for my use-case I want a core under those circumstances (during development) or a reliable and informative exit status in production</li>
  <li>is it safe to overwrite the Oracle signal-handler via e.g. <code>act.sa_handler = SIG_DFL; sigaction(SIGABRT, &amp;act, 0);</code> ?</li>
  <li>what are the disadvantages of resetting SIGABRT/SIGSEGV and friends to SIG_DFL after connect?</li>
  </ul>