From nobody@FreeBSD.org  Fri Jun 18 13:51:37 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CAF0316A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2004 13:51:37 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C38E943D48
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2004 13:51:37 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i5IDodGD061214
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2004 13:50:39 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i5IDod0U061159;
	Fri, 18 Jun 2004 13:50:39 GMT
	(envelope-from nobody)
Message-Id: <200406181350.i5IDod0U061159@www.freebsd.org>
Date: Fri, 18 Jun 2004 13:50:39 GMT
From: "Georg-W. Koltermann" <gwk@rahn-koltermann.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: linux ibm jdk 1.4.1 fails with: JVMLH050: Signal stack registration failed (errno=22)
X-Send-Pr-Version: www-2.3

>Number:         68079
>Category:       kern
>Synopsis:       linux ibm jdk 1.4.1 fails with: JVMLH050: Signal stack registration failed (errno=22)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    emulation
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 18 14:00:39 GMT 2004
>Closed-Date:    Tue Aug 24 20:53:56 GMT 2004
>Last-Modified:  Tue Aug 24 20:53:56 GMT 2004
>Originator:     Georg-W. Koltermann
>Release:        5.2.1
>Organization:
>Environment:
FreeBSD hunter.localnet 5.2.1-RELEASE-p5 FreeBSD 5.2.1-RELEASE-p5 #8: Sun Apr 25 21:22:15 CEST 2004     gwk@hunter.localnet:/usr/obj/usr/src/sys/HUNTER  i386

>Description:
hunter[13]$ java -version
JVMLH050: Signal stack registration failed (errno=22).
Abort trap (core dumped)
hunter[14]$ echo $JAVA_HOME
/usr/local/linux-ibm-jdk1.4.1
hunter[15]$

BTW the 131 JDK from IBM also fails with: *** panic: JVMXE102: sigaltstack



>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:

From: "Georg-W. Koltermann" <gwk@rahn-koltermann.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: java/68079: PATCH linux ibm jdk 1.4.1 fails with: JVMLH050:
	Signal stack registration failed (errno=22)
Date: Sun, 20 Jun 2004 02:14:15 +0200

 The problem was that linux_machdep.c had the arguments to
 kern_sigaltstack() switched. Apply the following patch:
 
 Index: linux_machdep.c
 ===================================================================
 RCS file: /usr/ncvs/src/sys/i386/linux/linux_machdep.c,v
 retrieving revision 1.40
 diff -u -r1.40 linux_machdep.c
 --- linux_machdep.c	2 Jun 2003 16:56:40 -0000	1.40
 +++ linux_machdep.c	19 Jun 2004 23:19:29 -0000
 @@ -799,8 +799,8 @@
  		ss.ss_size = lss.ss_size;
  		ss.ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags);
  	}
 -	error = kern_sigaltstack(td, (uap->uoss != NULL) ? &oss : NULL,
 -	    (uap->uss != NULL) ? &ss : NULL);
 +	error = kern_sigaltstack(td, (uap->uss != NULL) ? &ss : NULL,
 +	    (uap->uoss != NULL) ? &oss : NULL);
  	if (!error && uap->uoss != NULL) {
  		lss.ss_sp = oss.ss_sp;
  		lss.ss_size = oss.ss_size;
 
 Alas, it still does not work right.  Now it hangs with high system times
 and the message "kernel trap 26 with interrupts disabled" in syslog :(
 See next PR.
 
 
Responsible-Changed-From-To: freebsd-java->emulation 
Responsible-Changed-By: glewis 
Responsible-Changed-When: Thu Jul 1 22:46:26 GMT 2004 
Responsible-Changed-Why:  
Looks like a problem in the Linux emulation code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68079 

From: "Georg-W. Koltermann" <gwk@rahn-koltermann.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/68079: linux ibm jdk 1.4.1 fails with: JVMLH050: Signal
	stack registration failed (errno=22)
Date: Fri, 06 Aug 2004 22:19:41 +0200

 Update: The IBM JRE can be made to work by setting IBM_NOLDT=1 in the
 environment.  So the remaining problem is definitely a problem with our
 LDT usage, conflicting with Linux emulation.
 
 I assume the port could be fixed by installing a wrapper script which
 sets this.  Or at least we could add a message to the port asking the
 user to do it.
 
 As a prereq we still have to apply the patch from this PR, to get around
 the first problem.  So could someone with a commit bit please commit it?
 
 Tnx, Georg.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Tue Aug 24 20:53:10 GMT 2004 
State-Changed-Why:  
Fix from PR committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68079 
>Unformatted:
