SA_SIGINFO with Linux

PARMELAN Edouard parmee at postecss.ncrfran.france.ncr.com
Thu Aug 6 22:24:00 PDT 1998


Hi All,

Bug analys and hacker patch.


I use linux 2.1.112 and NullPointerException is
not cached.


Since 2.1.72 (may be before, I have removed very
old kernel...)   
SA_SIGINFO works as expected:

   If set ...  and two additional   
arguments are
   passed to the signal-catching function.  If the
   
  second argument is not equal to NULL, it points
   to a siginfo_t   
structure containing the reason why
   the signal was generated [see   
siginfo(5)]; the
   third argument points to a ucontext_t structure
   
  containing the receiving process's context when
   the signal was   
delivered [see ucontext(5)].

in kaffe/kaffevm/exception.c, function   
catchSignal()
you can read:

#if defined(HAVE_SIGACTION)
..
#if   
defined(SA_SIGINFO)
 newact.sa_flags |= SA_SIGINFO;
#endif
..
#elif   
...


With Linux SA_SIGINFO is defined but in
config/*/linux/jit-md.h,   
EXECPTIONPROTO and
EXCEPTIONFRAME are defined without check   
SA_SIGINFO.

The following patch is an HACK for my configuration:
linux   
2.1, i385 and libc5.  You may add some check for
struct ucontext vs   
ucontext_t, GLIBC2 vs LIBC5,
ucontext.h vs asm/ucontext.h ...



I am not in the mailing-list, please answer directly to:
Edouard.Parmelan at France.NCR.COM


Best regards,
Edouard.

 --
Edouard.Parmelan at France.NCR.COM

 ---

[[ KAFFE-~1.PAT : 5131 dans KAFFE-~1.PAT ]]  

Index: config/i386/linux/jit-md.h
===================================================================
RCS file: /home/cvspublic/kaffe/config/i386/linux/jit-md.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 jit-md.h
--- jit-md.h	1998/03/31 19:10:53	1.1.1.1
+++ jit-md.h	1998/08/06 19:33:14
@@ -36,6 +36,7 @@
 #include <sigcontext.h>
 #endif
 
+#if 0
 /* Function prototype for signal handlers */
 #if defined(HAVE_STRUCT_SIGCONTEXT_STRUCT) && !defined(__GLIBC__)
 /* Linux < 2.1.1 */
@@ -52,5 +53,18 @@
 #define	EXCEPTIONFRAME(f, c)						\
 	(f).retbp = (c).ebp;						\
 	(f).retpc = (c).eip + 1
+#else
+
+#include <asm/ucontext.h>
+
+/* Function prototype for signal handlers */
+#define	EXCEPTIONPROTO							\
+	int sig, struct siginfo *sip, struct ucontext *ctx
+
+/* Get the first exception frame from a signal handler */
+#define	EXCEPTIONFRAME(f, c)						\
+	(f).retbp = (c)->uc_mcontext.ebp;						\
+	(f).retpc = (c)->uc_mcontext.eip + 1
+#endif
 
 #endif



More information about the kaffe mailing list