title: How to diagnose/trace "sendsig: useracc failed." problem in HP-UX
body: <p>I am trying to compile Ruby 1.9.1-p0 on HP-UX.  After a small change to ext/pty.c it compiles successfully, albeit with a <em>lot</em> of warning messages (about 5K).  When I run the self-tests using &quot;make test&quot; it crashes and core-dumps with the following error:</p>
  <blockquote>
  <p>sendsig: useracc failed. 0x9fffffffbf7dae00 0x00000000005000</p>
  <p>Pid 3044 was killed due to failure in writing the signal context - possible stack overflow.</p>
  <p>Illegal instruction</p>
  </blockquote>
  <p>From googling this problem the Illegal instruction is just a signal that the system uses to kill the process, and not related to the problem.  It would seem that there is a problem with the re-establishing the context when calling the signal handler.  Bringing the core up in gdb doesn't show a particularly deep stack, so I don't think the &quot;possible stack overflow&quot; is right either.</p>
  <p>The gdb stack backtrace output looks like this:</p>
  <pre><code>#0  0xc00000000033a990:0 in __ksleep+0x30 () from /usr/lib/hpux64/libc.so.1
  #1  0xc0000000001280a0:0 in __mxn_sleep+0xae0 ()
      from /usr/lib/hpux64/libpthread.so.1
  #2  0xc0000000000c0f90:0 in &lt;unknown_procedure&gt; + 0xc50 ()
      from /usr/lib/hpux64/libpthread.so.1
  #3  0xc0000000000c1e30:0 in pthread_cond_timedwait+0x1d0 ()
      from /usr/lib/hpux64/libpthread.so.1
  </code></pre>