Subject: Re: pkg/30106
To: None <>
From: Shin'ichiro TAYA <>
List: pkgsrc-bugs
Date: 05/07/2005 18:40:37
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

segv wrote:
>  It's not just Solaris problem, it's a 64-bit issue which will bite on 64-bit platforms like UltraSparc, not matter which OS is installed

I think source code itself has problem.
I tested this problem with attached source code on sparc64.
Simply compiled code has problem you mentioned.
But shared object created from this source code doesn't dump core.
I don't have much knowledge about toolchain nor sparc asm lang.
I don't known whether data is properly aligned or unaligned access is 
prevented. Anyway I never see this problem with alpha, amd64, 
sparc64(all NetBSD). And there is a official distribution for Solaris.
I wonder this patch is really required or not....

Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

#include	<inttypes.h>

#define TX_DOUBLE_HI32_SIGNBIT   0x80000000
#define TX_DOUBLE_HI32_EXPMASK   0x7ff00000 
#define TX_DOUBLE_HI32_MANTMASK  0x000fffff
typedef uint32_t PRUint32;

//-- Initialize Double related constants
const PRUint32 nanMask[2] =    {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK
const PRUint32 infMask[2] =    {TX_DOUBLE_HI32_EXPMASK, 0};
const PRUint32 negInfMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT,
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};
const double NaN = *((double*)nanMask); 
const double POSITIVE_INFINITY = *((double*)infMask);
const double NEGATIVE_INFINITY = *((double*)negInfMask);

	return NaN;

#if 0
	printf("%f", get_double());