This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[3.3 PATCH] Fix broken libgcj signal handling


Hello,

current gcc 3.3 libgcj fails to generate proper NullPointerException
exceptions when running under Linux 2.6 because it does not 
unblock SIGSEGV when throwing from inside catch_segv.

This appears to be due to a copy-and-paste error: catch_segv
unblocks SIGFPE while catch_fpe unblocks SIGSEGV instead of
the other way round ...

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.

OK for 3.3 (presumably after 3.3.2 was released ...)?

Bye,
Ulrich

ChangeLog:

	* prims.cc (catch_segv): Unblock correct signal.
	(catch_fpe): Likewise.

Index: libjava/prims.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/prims.cc,v
retrieving revision 1.76.2.3
diff -c -p -r1.76.2.3 prims.cc
*** libjava/prims.cc	20 Aug 2003 16:21:50 -0000	1.76.2.3
--- libjava/prims.cc	14 Oct 2003 16:23:42 -0000
*************** static java::lang::NullPointerException 
*** 153,159 ****
  
  SIGNAL_HANDLER (catch_segv)
  {
!   unblock_signal (SIGFPE);
    MAKE_THROW_FRAME (nullp);
    _Jv_ThrowSignal (nullp);
  }
--- 153,159 ----
  
  SIGNAL_HANDLER (catch_segv)
  {
!   unblock_signal (SIGSEGV);
    MAKE_THROW_FRAME (nullp);
    _Jv_ThrowSignal (nullp);
  }
*************** static java::lang::ArithmeticException *
*** 164,170 ****
  #ifdef HANDLE_FPE
  SIGNAL_HANDLER (catch_fpe)
  {
!   unblock_signal (SIGSEGV);
  #ifdef HANDLE_DIVIDE_OVERFLOW
    HANDLE_DIVIDE_OVERFLOW;
  #else
--- 164,170 ----
  #ifdef HANDLE_FPE
  SIGNAL_HANDLER (catch_fpe)
  {
!   unblock_signal (SIGFPE);
  #ifdef HANDLE_DIVIDE_OVERFLOW
    HANDLE_DIVIDE_OVERFLOW;
  #else
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]