Subject: pkg/30106: www/firefox failes to install with 'Bus error' on UltraSparc machines
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <segv@netctl.net>
List: pkgsrc-bugs
Date: 05/01/2005 09:21:00
>Number: 30106
>Category: pkg
>Synopsis: www/firefox failes to install with 'Bus error' on UltraSparc machines
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 01 09:21:00 +0000 2005
>Originator: SEGV
>Release:
>Organization:
>Environment:
SunOS u10 5.10 Generic sun4u sparc SUNW,Ultra-5_10
>Description:
www/firefox has alignment issues on 64-bit architectures like UltraSparc. It builds fine from pkgsrc, but when it comes to installing and registering components it fails with 'Bus error'
Other programs based on Mozilla are likeley to have the same problems and should incorporate the patch given below.
>How-To-Repeat:
>Fix:
Apply the following patch to fix the alignment issues:
*** extensions/transformiix/source/base/Double.cpp.orig Wed Mar 16 17:58:58 2005
--- extensions/transformiix/source/base/Double.cpp Wed Mar 16 17:59:16 2005
***************
*** 116,130 ****
--- 116,173 ----
//-- Initialize Double related constants
#ifdef IS_BIG_ENDIAN
+ /*
const PRUint32 nanMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK,
0xffffffff};
const PRUint32 infMask[2] = {TX_DOUBLE_HI32_EXPMASK, 0};
const PRUint32 negInfMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0};
+ */
+
+ /* alignment needs to be to 'double' datatype */
+ union {
+ const PRUint32 nanMask[2];
+ double dummy;
+ } un_nanMask = { {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK, 0xffffffff} };
+ #define nanMask (un_nanMask.nanMask)
+
+ union {
+ const PRUint32 infMask[2];
+ double dummy;
+ } un_infMask = { {TX_DOUBLE_HI32_EXPMASK, 0} };
+ #define infMask (un_infMask.infMask)
+
+ union {
+ const PRUint32 negInfMask[2];
+ double dummy;
+ } un_negInfMask = { {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0} };
+ #define negInfMask (un_negInfMask.negInfMask)
+
#else
+ /*
const PRUint32 nanMask[2] = {0xffffffff,
TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK};
const PRUint32 infMask[2] = {0, TX_DOUBLE_HI32_EXPMASK};
const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT};
+ */
+
+ /* alignment needs to be to 'double' datatype */
+ union {
+ const PRUint32 nanMask[2];
+ double dummy;
+ } un_nanMask = { {0xffffffff, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK} };
+ #define nanMask (un_nanMask.nanMask)
+
+ union {
+ const PRUint32 infMask[2];
+ double dummy;
+ } un_infMask = { {0, TX_DOUBLE_HI32_EXPMASK} };
+ #define infMask (un_infMask.infMask)
+
+ union {
+ const PRUint32 negInfMask[2];
+ double dummy;
+ } un_negInfMask = { {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT} };
+ #define negInfMask (un_negInfMask.negInfMask)
#endif
const double Double::NaN = *((double*)nanMask);