signal hander patch

Boehm, Hans hans_boehm@hp.com
Tue Mar 26 09:06:00 GMT 2002


Sorry about that. Clearly I should have been more careful about PowerPC.
The problem with using syscall(SYS_sigaction ... ) is that it's using
effectively using a system call that's obsolete on Linux. I believe it
exists on X86 only for backward compatibility, and that's been the case for
quite a while. Glibc hasn't used it for a while. It doesn't exist on IA64.
It has been replaced by SYS_rt_sigaction, which has a different
(undocumented?) sequence of arguments. I would guess it won't exist in
other new Linux ports.
Thus abstractly, it still makes marginally more sense to me to use
__libc_sigaction, since libc seems to be the only piece of code that's
really supposed to understand the system call calling convention. But it
seems like we will have to end up doing both depending on the platform
unless someone fixes the glibc unwind information on all platforms. This is
really ugly.
Hans
> -----Original Message-----
> From: Andrew Haley [mailto:aph@cambridge.redhat.com]
> Sent: Tuesday, March 26, 2002 6:00 AM
> To: Bryce McKinlay
> Cc: java@gcc.gnu.org; Hans Boehm
> Subject: signal hander patch
>>> I don't have a PPC system convenient, so please try this ASAP.
>> Andrew.
>> 2002年03月26日 Andrew Haley <aph@cambridge.redhat.com>
>> (INIT_SEGV, INIT_FPE): Only use __libc_sigaction instead of
> syscall on IA-64 systems.
>> Index: include/dwarf2-signal.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/include/dwarf2-signal.h,v
> retrieving revision 1.3.20.1
> diff -c -2 -p -r1.3.20.1 dwarf2-signal.h
> *** dwarf2-signal.h	2002年03月26日 03:28:00	1.3.20.1
> --- dwarf2-signal.h	2002年03月26日 13:58:22
> *************** while (0)
> *** 69,72 ****
> --- 69,107 ----
> #endif
>> + #ifndef __ia64__
> + #define INIT_SEGV						\
> + do								\
> + {								\
> + nullp = new java::lang::NullPointerException (); 	\
> + struct sigaction act;					\
> + act.sa_sigaction = _Jv_catch_segv; 		
> 	\
> + sigemptyset (&act.sa_mask);				
> 	\
> + act.sa_flags = SA_SIGINFO;	 			
> 	\
> + syscall (SYS_sigaction, SIGSEGV, &act, NULL);		\
> + }								\
> + while (0) 
> + 
> + #define INIT_FPE						\
> + do								\
> + { 							
> 	\
> + arithexception = new java::lang::ArithmeticException 	\
> + (JvNewStringLatin1 ("/ by zero"));			\
> + struct sigaction act;					\
> + act.sa_sigaction = _Jv_catch_fpe;			
> 	\
> + sigemptyset (&act.sa_mask);				
> 	\
> + act.sa_flags = SA_SIGINFO;		 		
> 	\
> + syscall (SYS_sigaction, SIGFPE, &act, NULL);		\
> + }								\
> + while (0) 
> + 
> + /* We use syscall(SYS_sigaction) in INIT_SEGV and INIT_FPE 
> instead of
> + * sigaction() because on some systems the pthreads wrappers for
> + * signal handlers are not compiled with unwind information, so it's
> + * not possible to unwind through them. This is a problem that will
> + * go away once all systems have pthreads libraries that are
> + * compiled with full unwind info. */
> + 
> + #else /* __ia64__ */
> + 
> // FIXME: We shouldn't be using libc_sigaction here, since it should
> // be glibc private. But using syscall here would mean 
> translating to
> *************** do						
> 		\
> *** 103,113 ****
> }								\
> while (0) 
> ! 
> ! /* We use syscall(SYS_sigaction) in INIT_SEGV and INIT_FPE 
> instead of
> ! * sigaction() because on some systems the pthreads wrappers for
> ! * signal handlers are not compiled with unwind information, so it's
> ! * not possible to unwind through them. This is a problem that will
> ! * go away once all systems have pthreads libraries that are
> ! * compiled with full unwind info. */
> ! 
> #endif /* JAVA_SIGNAL_H */
> --- 138,141 ----
> }								\
> while (0) 
> ! #endif /* __ia64__ */
> #endif /* JAVA_SIGNAL_H */
>


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /