Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  5 Sep 2000 22:44:14 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        marcel@cup.hp.com
Cc:        freebsd-emulation@freebsd.org
Subject:   IBM JDK fails due to lack of SA_SIGINFO support
Message-ID:  <14773.43466.744621.411519@grasshopper.cs.duke.edu>

next in thread | raw e-mail | index | archive | help

Currently the IBM jdk & jvm don't run under our linux abi.  This had
previously been attributed to the "sigaltstack: Cannot allocate
memory" message one sees when running it.  Upon further investigation,
this appears to be a red herring.  The "real" problem is as simple
(or, rather, complex) as the fact that we don't support SA_SIGINFO
style signal handlers under the linux abi.

The program installs signal handlers for just about everything.  One
thread sends another a SIGUSR2, which is caught.  As soon as the
handler tries to dereference sip, it SEGV's.  It proceeds to catch
that, then gets caught in an infinate loop of catching SEGV's &
SEGV'ing in the handler.  

The appended program demonstrates the problem when its built on a
linux system & run on a FreeBSD one.  Run it in the background & send
it SIGUSR2.  Notice it faults as soon as it deref's sip. 

I've been trying to whip up a linux_rt_sendsig() that could handle
SA_SIGINFO style signal handlers. However, I've been failing
miserably.  Any help from x86 savy people would be appreciated -- I'm
mainly an alpha guy :-(

Cheers,

Drew
------------------------------------------------------------------------------
Andrew Gallatin, Sr Systems Programmer	http://www.cs.duke.edu/~gallatin
Duke University				Email: gallatin@cs.duke.edu
Department of Computer Science		Phone: (919) 660-6590



#include <signal.h>
#include <stdlib.h>
#include <ucontext.h>

static void
kill_handler(int sig, siginfo_t *sip, void  *context)
{
        printf("\n");
        printf("&sig = %p\n", &sig);
        printf("&sip = %p\n", &sip);
        printf("sip = %p\n", sip);
        printf("context = %p\n", context);
	printf("sip->si_signo = 0x%lx\n", sip->si_signo); /* KABOOM!*/                
        exit(0);
}

main(int argc, char *argv[])
{
        sigset_t sigset;
        struct sigaction sa;
        int i, ret;
        volatile int bar;
        int *array;

        bzero((char*)& (sa.sa_mask), sizeof(sigset_t));
        sa.sa_flags = SA_SIGINFO;
        sa.sa_sigaction = kill_handler;

        sigaction(SIGUSR2, &sa, NULL);

        while (1);
}








To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14773.43466.744621.411519>