NetBSD Problem Report #44222

From www@NetBSD.org  Sun Dec 12 10:07:35 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 55A1763B886
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 12 Dec 2010 10:07:35 +0000 (UTC)
Message-Id: <20101212100735.2638363B883@www.NetBSD.org>
Date: Sun, 12 Dec 2010 10:07:35 +0000 (UTC)
From: noud4@home.nl
Reply-To: noud4@home.nl
To: gnats-bugs@NetBSD.org
Subject: kaffe halts on BufferedReader.readLine (while building wip/jdk15)
X-Send-Pr-Version: www-1.0

>Number:         44222
>Category:       pkg
>Synopsis:       kaffe halts on BufferedReader.readLine (while building wip/jdk15)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tonio
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 12 10:10:00 +0000 2010
>Closed-Date:    Sun Jan 02 02:01:07 +0000 2011
>Last-Modified:  Sun Jan 02 02:01:07 +0000 2011
>Originator:     B ICT A.P. deBrouwer Jr.
>Release:        i386 5.0.2
>Organization:
-none-
>Environment:
NetBSD 10.0.2.17 5.0.2 NetBSD 5.0.2 (GENERIC.IP4) #2: Sun Nov 14 16:18:05 CET 2010  root@h12.hosts:/obj/sys/arch/i386/compile/GENERIC.IP4 i386
>Description:
wip/jdk15 being resurrected, it's build using kaffe on DragonFly
did succeed but a build on NetBSD/i386 and amd64 didn't.
>How-To-Repeat:
apply fix in problem report `pkg/44221'
and
add localpatches/wip/jdk15/Database.java.diff like below and see kaffee 'stalled' in a readLine while building wip/jdk15:

--- hotspot/src/share/tools/MakeDeps/Database.java.orig	2008-05-28 09:01:18.000000000 +0200
+++ hotspot/src/share/tools/MakeDeps/Database.java	2010-12-09 13:11:53.000000000 +0100
@@ -82,9 +82,9 @@
 	throws FileFormatException, IOException, FileNotFoundException {
 	macros.readFrom(platFileName, missingOk);

 	BufferedReader reader = null;
 	try {
-	    reader = new BufferedReader(new FileReader(dbFileName));
+	    reader = new BufferedReader(new FileReader(dbFileName));
 	} catch (FileNotFoundException e) {
 	    if (missingOk) {
 		return;
@@ -97,6 +99,7 @@
 	int lineNo = 0;
 	do {
 	    line = reader.readLine();
+	System.out.println("\nDatabase: "+ line);
 	    lineNo++;
 	    if (line != null) {
 		StreamTokenizer tokenizer =


i'm not sure the __NetBSD_Version__ at all given
i have 
# head /usr/src/sys/kern/sys_sig.c
/*      $NetBSD: sys_sig.c,v 1.17.4.2.2.1
and only pre 1.17.x mentioning a sigwait is:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_sig.c.diff?r1=1.12&r2=1.13&only_with_tag=MAIN&f=h

but/and the fix below solves the 'stalles' and
am now able to continue the wip/jdk15 build using kaffe.


fix still has to be reported upsteam to kaffe
and removed again after kaffe's acceptance and pkgsrc's kaffe upgrade to a kaffe version incorporating the fix.
>Fix:
--- kaffe/kaffevm/systems/unix-pthreads/thread-impl.c.orig	2010-12-11 23:19:36.000000000 +0100
+++ kaffe/kaffevm/systems/unix-pthreads/thread-impl.c	2010-12-11 23:19:47.000000000 +0100
@@ -415,7 +415,7 @@
   saResume.sa_flags = 0; /* Note that we do not want restart here. */
   saResume.sa_handler = resume_signal_handler;
   saResume.sa_mask = saSuspend.sa_mask;
-#if !defined(KAFFE_BOEHM_GC) && !defined(KAFFE_BUGGY_NETBSD_SIGWAIT)
+#if !defined(KAFFE_BOEHM_GC) && (!defined(KAFFE_BUGGY_NETBSD_SIGWAIT) || (defined(__NetBSD__) && __NetBSD_Version__ >= 499000200 /* 4.99.02 */ )
   sigaction( sigResume, &saResume, NULL);
 #endif


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->tonio
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sun, 12 Dec 2010 10:53:22 +0000
Responsible-Changed-Why:
Over to maintainer.


From: "B ICT A.P. de Brouwer Jr." <noud4@home.nl>
To: David Brownlee <abs@absd.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: PR/44222 kaffe halts on BufferedReader.readLine (while
 building wip/jdk15)
Date: Mon, 13 Dec 2010 22:38:29 +0100

 On Mon, 2010-12-13 at 21:04 +0000, David Brownlee wrote:
 > Might it be better to handle this in configure.ac - to only set
 > KAFFE_BUGGY_NETBSD_SIGWAIT on NetBSD_Version__ < 499000200 ?

 Yes, configure.ac should be patched and not thread-impl.c.
 A version 499000200 is just an example, exact version number should
 match a change in sigwait( handling).

 -- 
 the challenge was in learning the needed,
              not in showing off to other.

From: David Brownlee <abs@absd.org>
To: "B ICT A.P. de Brouwer Jr." <noud4@home.nl>
Cc: gnats-bugs@netbsd.org
Subject: Re: PR/44222 kaffe halts on BufferedReader.readLine (while building wip/jdk15)
Date: Tue, 14 Dec 2010 01:43:01 +0000

 On 13 December 2010 21:38, B ICT A.P. de Brouwer Jr. <noud4@home.nl> wrote:
 > On Mon, 2010-12-13 at 21:04 +0000, David Brownlee wrote:
 >> Might it be better to handle this in configure.ac - to only set
 >> KAFFE_BUGGY_NETBSD_SIGWAIT on NetBSD_Version__ < 499000200 ?
 >
 > Yes, configure.ac should be patched and not thread-impl.c.
 > A version 499000200 is just an example, exact version number should
 > match a change in sigwait( handling).

 Do you have time to provide such a patch? :)

From: "B ICT A.P. de Brouwer Jr." <noud4@home.nl>
To: gnats-bugs@NetBSD.org
Cc: tonio@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, David
 Brownlee <abs@absd.org>
Subject: Re: PR/44222 kaffe halts on BufferedReader.readLine (while
 building wip/jdk15)
Date: Wed, 15 Dec 2010 16:27:24 +0100

 --=-5/HCQNX8ddyb2SicL+fG
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: 7bit

 On Tue, 2010-12-14 at 02:10 +0000, David Brownlee wrote:
 >  > Yes, configure.ac should be patched and not thread-impl.c.

 >  Do you have time to provide such a patch? :)

 I did take time for this resulting in:
 -a patch to lang/kaffe/Makefile.common to recreate configure.
 -3 extra patches against
    config/config.h.in, configure.ac and config/config.alias.
 -and thus a changed distinfo.

 find them attached (hope gnats shows them okay too),
 -- 

 --=-5/HCQNX8ddyb2SicL+fG
 Content-Disposition: attachment; filename="Makefile.common.diff"
 Content-Type: text/x-patch; name="Makefile.common.diff"; charset="us-ascii"
 Content-Transfer-Encoding: 7bit

 --- Makefile.common.orig	2010-03-24 19:43:25.000000000 +0000
 +++ Makefile.common	2010-12-15 15:19:02.000000000 +0000
 @@ -18,6 +18,7 @@
  JAVA_HOME=		${PREFIX}/java/kaffe
  JAVA_NAME=		kaffe
  USE_LIBTOOL=		yes
 +USE_TOOLS+=		autoconf
  USE_TOOLS+=		gmake
  TEST_TARGET=		check

 @@ -58,6 +59,9 @@
  CONFIGURE_ARGS+=	--with-engine=intrp
  .endif

 +pre-configure:
 +	cd ${WRKSRC} && autoconf
 +
  .include "../../devel/libltdl/convenience.mk"
  .include "../../mk/pthread.buildlink3.mk"
  .include "../../converters/libiconv/buildlink3.mk"

 --=-5/HCQNX8ddyb2SicL+fG
 Content-Disposition: attachment; filename="patch-ca"
 Content-Type: text/plain; name="patch-ca"; charset="us-ascii"
 Content-Transfer-Encoding: 7bit

 $NetBSD$

 --- config/config.h.in	2010-12-15 15:28:42.000000000 +0100
 +++ config/config.h.in.new	2010-12-15 15:31:15.000000000 +0100
 @@ -771,7 +771,7 @@
  /* additional directories to search for native jni libraries */
  #undef JNI_LIBRARY_PATH

 -/* Defined on NetBSD because sigwait needs the handle not to be registered */
 +/* Defined on NetBSD 1.6.2 and lower because sigwait needs the handle not to be registered */
  #undef KAFFE_BUGGY_NETBSD_SIGWAIT

  /* Full path to the directory containing kaffe's locales */

 --=-5/HCQNX8ddyb2SicL+fG
 Content-Disposition: attachment; filename="patch-cb"
 Content-Type: text/plain; name="patch-cb"; charset="us-ascii"
 Content-Transfer-Encoding: 7bit

 $NetBSD$

 --- configure.ac	2010-12-15 15:08:20.000000000 +0100
 +++ configure.ac.new	2010-12-15 15:10:10.000000000 +0100
 @@ -266,6 +266,7 @@
  known=no
  Khost_cpu=$host_cpu
  Khost_os=$host_os
 +Knetbsd1=no
  if test -f $srcdir/config/config.alias ; then
  	. $srcdir/config/config.alias
  fi
 @@ -709,7 +710,9 @@
  	CPPFLAGS="$CPPFLAGS -D_REENTRANT"

  	if test "x$Khost_os" = "xnetbsd1"; then
 -		AC_DEFINE(KAFFE_BUGGY_NETBSD_SIGWAIT, 1, [Defined on NetBSD because sigwait needs the handle not to be registered])
 +		if test "x$Knetbsd1" = "xyes"; then
 +			AC_DEFINE(KAFFE_BUGGY_NETBSD_SIGWAIT, 1, [Defined on NetBSD because sigwait needs the handle not to be registered])
 +		fi
  	fi
   else
          CPPFLAGS="$CPPFLAGS -DBR_PTHREADS=0"

 --=-5/HCQNX8ddyb2SicL+fG
 Content-Disposition: attachment; filename="patch-cc"
 Content-Type: text/plain; name="patch-cc"; charset="us-ascii"
 Content-Transfer-Encoding: 7bit

 $NetBSD$

 --- config/config.alias	2006-03-23 20:52:54.000000000 +0100
 +++ config/config.alias.new	2010-12-15 15:07:07.000000000 +0100
 @@ -21,6 +21,11 @@

  esac

 +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 +case "${UNAME_RELEASE}" in
 +    1*) Knetbsd1=yes ;;
 +esac
 +
  case "$Khost_os" in

  aix*)		Khost_os=aix ;;


 --=-5/HCQNX8ddyb2SicL+fG--

From: "David Brownlee" <abs@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44222 CVS commit: pkgsrc/lang
Date: Wed, 15 Dec 2010 16:06:27 +0000

 Module Name:	pkgsrc
 Committed By:	abs
 Date:		Wed Dec 15 16:06:27 UTC 2010

 Modified Files:
 	pkgsrc/lang/kaffe: Makefile Makefile.common PLIST distinfo
 	pkgsrc/lang/kaffe-x11: Makefile
 Added Files:
 	pkgsrc/lang/kaffe/patches: patch-ca patch-cb patch-cc

 Log Message:
 apply patches from Noud to fix PR/44222 kaffe halts on
 BufferedReader.readLine (while building wip/jdk15)

 KAFFE_BUGGY_NETBSD_SIGWAIT is only required in older NetBSD releases, and
 in fact breaks NetBSD 5

 Bump PKGREVISION

 many thanks


 To generate a diff of this commit:
 cvs rdiff -u -r1.74 -r1.75 pkgsrc/lang/kaffe/Makefile
 cvs rdiff -u -r1.21 -r1.22 pkgsrc/lang/kaffe/Makefile.common
 cvs rdiff -u -r1.17 -r1.18 pkgsrc/lang/kaffe/PLIST
 cvs rdiff -u -r1.28 -r1.29 pkgsrc/lang/kaffe/distinfo
 cvs rdiff -u -r1.22 -r1.23 pkgsrc/lang/kaffe-x11/Makefile
 cvs rdiff -u -r0 -r1.1 pkgsrc/lang/kaffe/patches/patch-ca \
     pkgsrc/lang/kaffe/patches/patch-cb pkgsrc/lang/kaffe/patches/patch-cc

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 29 Dec 2010 01:30:42 +0000
State-Changed-Why:
Fixed?


From: "B ICT A.P. de Brouwer Jr." <noud4@home.nl>
To: gnats-bugs@NetBSD.org
Cc: tonio@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, 
 dholland@NetBSD.org
Subject: Re: pkg/44222 (kaffe halts on BufferedReader.readLine (while
 building wip/jdk15))
Date: Wed, 29 Dec 2010 11:08:07 +0100

 On Wed, 2010-12-29 at 01:30 +0000, dholland@NetBSD.org wrote:
 > Synopsis: kaffe halts on BufferedReader.readLine (while building wip/jdk15)

 > State-Changed-Why:
 > Fixed?

 patch is applied so if no objections from anyone i'd say yes fixed.

 (given the patch, wip/jdk15 is building again for NetBSD/i386 /amd64
 using kaffe to bootstrap)

 -- 

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 02 Jan 2011 02:01:07 +0000
State-Changed-Why:
Yes, fixed.
(I wanted to make sure things really did start building; thanks for checking.)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.