From owner-freebsd-emulation Tue Sep 5 19:44:28 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 6389537B422 for ; Tue, 5 Sep 2000 19:44:25 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id WAA01657; Tue, 5 Sep 2000 22:44:14 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.0/8.9.1) id e862iEM24144; Tue, 5 Sep 2000 22:44:14 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 5 Sep 2000 22:44:14 -0400 (EDT) To: marcel@cup.hp.com Cc: freebsd-emulation@freebsd.org Subject: IBM JDK fails due to lack of SA_SIGINFO support X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14773.43466.744621.411519@grasshopper.cs.duke.edu> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 #include #include 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