Error handler patch

Alex Waugh alex at alexwaugh.com
Sat Apr 17 03:02:48 PDT 2004


In message <200404162136.16080 at zamez.strcprstskrzkrk.co.uk>
          James Bursa <bursa at users.sourceforge.net> wrote:

> Hi,
> 
> This patch makes some improvements to the handler for RISC OS errors.
> 
> 1. Print the error message for non-serious errors, as long as there is no 
> signal handler for SIGOSERROR (currently the only output is "Termination 
> signal received: RISC OS error").
> 2. Print the pc that RISC OS stored with the error.
> 3. Dump floating point registers for FP errors.
> 
> However, I'm not sure that this is correct for pthreads, because I
> notice that  the error buffer is copied for some reason in
> __h_error_entry.

The error buffer is copied so that _kernel_last_oserror is thread safe.
Your patch is OK as context switching is disabled during the signal
handler. However, what happens if a SIGEMT is manually raised, e.g.
when the stack extension code runs out of memory? I think it will print
an out of date or uninitialised error message in this case.

Alex

-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/





More information about the gcc mailing list