Re: www/minimo: shlibsign core dump

2006-04-19 Thread Kurt Miller
On Wednesday 08 March 2006 10:11 pm, Peter Valchev wrote:
  While trying to build www/minimo on amd64 -current 
  shlibsign coredumps. 
 ..
 This is caused by patch-nsprpub_pr_src_misc_prdtoa_c which I
 added in order to fix a similar crash on Zaurus.  The patch
 ripped out the mozilla implementation of strtod(3) with the
 one taken directly from our libc.  I have no clue why this
 broke amd64 and have not figured it out yet.  Feel free to
 hack at it.
 

freedtoa should be removed since our strtod(3) dtoa
implementation uses a static var to handle result
allocation, but doesn't always return that. Also since
static vars are in use in places, I added back in
the locks to protect them and added one more to
protect the dtoa return value too.

This fixes the build on sparc64 for me and I expect
it should help stability elsewhere too.

-Kurt
Index: Makefile
===
RCS file: /cvs/ports/www/minimo/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	27 Mar 2006 04:23:29 -	1.17
+++ Makefile	19 Apr 2006 21:44:57 -
@@ -5,7 +5,7 @@
 
 COMMENT=	mini mozilla
 DISTNAME=	minimo-20050802
-PKGNAME=	${DISTNAME}p6
+PKGNAME=	${DISTNAME}p7
 SO_VERSION=	2.0
 # NOTE: Must bump minor version if any shlib's are removed from the
 # components dir to avoid pkg_add -r issues.
Index: patches/patch-nsprpub_pr_src_misc_prdtoa_c
===
RCS file: /cvs/ports/www/minimo/patches/patch-nsprpub_pr_src_misc_prdtoa_c,v
retrieving revision 1.2
diff -u -r1.2 patch-nsprpub_pr_src_misc_prdtoa_c
--- patches/patch-nsprpub_pr_src_misc_prdtoa_c	5 Feb 2006 02:39:18 -	1.2
+++ patches/patch-nsprpub_pr_src_misc_prdtoa_c	19 Apr 2006 21:44:57 -
@@ -1,6 +1,6 @@
 $OpenBSD: patch-nsprpub_pr_src_misc_prdtoa_c,v 1.2 2006/02/05 02:39:18 pvalchev Exp $
 nsprpub/pr/src/misc/prdtoa.c.orig	Tue Apr 27 18:34:07 2004
-+++ nsprpub/pr/src/misc/prdtoa.c	Sat Feb  4 18:47:53 2006
+--- nsprpub/pr/src/misc/prdtoa.c.orig	Tue Apr 27 20:34:07 2004
 nsprpub/pr/src/misc/prdtoa.c	Wed Apr 19 17:24:23 2006
 @@ -1,82 +1,8 @@
 -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 -/* * BEGIN LICENSE BLOCK *
@@ -166,7 +166,7 @@
   * #define KR_headers for old-style C function headers.
   * #define Bad_float_h if your system lacks a float.h or if it does not
   *	define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
-@@ -175,89 +87,82 @@ void _PR_CleanupDtoa(void)
+@@ -175,89 +87,85 @@ void _PR_CleanupDtoa(void)
   *	if memory is available and otherwise does something you deem
   *	appropriate.  If MALLOC is undefined, malloc will be invoked
   *	directly -- and assumed always to succeed.
@@ -247,12 +247,13 @@
 +#define ACQUIRE_DTOA_LOCK(n)PR_Lock(dtoa_lock[n])
 +#define FREE_DTOA_LOCK(n)   PR_Unlock(dtoa_lock[n])
 +
-+static PRLock *dtoa_lock[2];
++static PRLock *dtoa_lock[3];
 +
 +void _PR_InitDtoa(void)
 +{
 +dtoa_lock[0] = PR_NewLock();
 +dtoa_lock[1] = PR_NewLock();
++dtoa_lock[2] = PR_NewLock();
 +}
 +
 +void _PR_CleanupDtoa(void)
@@ -261,6 +262,8 @@
 +dtoa_lock[0] = NULL;
 +PR_DestroyLock(dtoa_lock[1]);
 +dtoa_lock[1] = NULL;
++PR_DestroyLock(dtoa_lock[2]);
++dtoa_lock[2] = NULL;
 +
 +/* FIXME: deal with freelist and p5s. */
 +}
@@ -318,7 +321,7 @@
  
  #ifdef MALLOC
  #ifdef KR_headers
-@@ -269,42 +174,32 @@ extern void *MALLOC(size_t);
+@@ -269,42 +177,32 @@ extern void *MALLOC(size_t);
  #define MALLOC malloc
  #endif
  
@@ -373,7 +376,7 @@
  #define DBL_MAX 7.2370055773322621e+75
  #endif
  
-@@ -313,27 +208,16 @@ static double private_mem[PRIVATE_mem], 
+@@ -313,27 +211,16 @@ static double private_mem[PRIVATE_mem], 
  #define DBL_MAX_10_EXP 38
  #define DBL_MAX_EXP 127
  #define FLT_RADIX 2
@@ -403,7 +406,7 @@
  #ifndef __MATH_H__
  #include math.h
  #endif
-@@ -350,37 +234,43 @@ extern C {
+@@ -350,37 +237,43 @@ extern C {
  #endif
  #endif
  
@@ -464,7 +467,7 @@
  #define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
  ((unsigned short *)a)[0] = (unsigned short)c, a++)
  #else
-@@ -394,7 +284,7 @@ typedef union { double d; ULong L[2]; } 
+@@ -394,7 +287,7 @@ typedef union { double d; ULong L[2]; } 
  /* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
  /* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
  
@@ -473,7 +476,7 @@
  #define Exp_shift  20
  #define Exp_shift1 20
  #define Exp_msk10x10
-@@ -402,6 +292,7 @@ typedef union { double d; ULong L[2]; } 
+@@ -402,6 +295,7 @@ typedef union { double d; ULong L[2]; } 
  #define Exp_mask  0x7ff0
  #define P 53
  #define Bias 1023
@@ -481,7 +484,7 @@
  #define Emin (-1022)
  #define Exp_1  0x3ff0
  #define Exp_11 0x3ff0
-@@ -419,38 +310,11 @@ typedef union { double d; ULong L[2]; } 
+@@ -419,38 +313,11 @@ typedef union { double d; ULong L[2]; } 
  #define Tiny1 1
  #define Quick_max 14
  #define Int_max 14
@@ -521,7 +524,7 @@
  #define 

Re: www/minimo: shlibsign core dump

2006-03-08 Thread Peter Valchev
 While trying to build www/minimo on amd64 -current 
 shlibsign coredumps. 
..
This is caused by patch-nsprpub_pr_src_misc_prdtoa_c which I
added in order to fix a similar crash on Zaurus.  The patch
ripped out the mozilla implementation of strtod(3) with the
one taken directly from our libc.  I have no clue why this
broke amd64 and have not figured it out yet.  Feel free to
hack at it.

Also if someone brings this port up to date (there is a newer
snapshot on the master site), that would be good.