From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Federico G. Benavento" Content-Type: multipart/signed; boundary="Apple-Mail=_9548ED79-145D-4B11-B9C4-5DA66BDABE90"; protocol="application/pgp-signature"; micalg=pgp-sha512 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Date: Fri, 22 Nov 2013 14:52:28 -0200 References: <5700548.4Uf9crWo2Z@krypton> <3072040.2Ns7VPtGUt@krypton> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Subject: Re: [9fans] f2c issue Topicbox-Message-UUID: 8be18892-ead8-11e9-9d60-3106f5b1d025 --Apple-Mail=_9548ED79-145D-4B11-B9C4-5DA66BDABE90 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 you might want to disable that exception in main()=20 setfcr(getcfr() ~FPOVFL); sometimes I had to go extreme and do: setfcr(getfcr() &~ (FPINEX|FPOVFL|FPUNFL|FPZDIV|FPINVAL)); when porting some code that was supposed to run well on unixes. see getfcr(2). On Nov 22, 2013, at 2:42 PM, Fausto Saporito = wrote: > Hi Erik, >=20 > yes, it's a FP stack overflow... :-) > I also tried with 9front, and the error message is slightly different: >=20 > ./arithchk > #define IEEE_8087 > #define Arith_Kind_ASL 1 > arithchk 8523: suicide: sys: fp: invalid operation fppc=3D0x12ee = status=3D0xb8b3 pc=3D0x000012f2 >=20 > further checks reveal that the problem is this function: >=20 > void > get_nanbits(unsigned int *b, int k) > { > union { double d; unsigned int z[2]; } u, u1, u2; >=20 > k =3D 2 - k; > u1.z[k] =3D u2.z[k] =3D 0x7ff00000; > u1.z[1-k] =3D u2.z[1-k] =3D 0; > u.d =3D u1.d - u2.d; /* Infinity - Infinity */ <<<<<<<=3D=3D=3D= =3D=3D=3D this is the FATAL ERROR. > b[0] =3D u.z[0]; > b[1] =3D u.z[1]; > } >=20 > called as getnanbits(nanbits,1) >=20 > I'm sorry but I don't know how to generate the acid code. >=20 > regards, > Fausto >=20 >=20 >=20 > 2013/11/22 erik quanstrom > > By the way I have always the same problem (suicide with stack = overflow > > running arithchk). >=20 > that's not a stack overflow, that's a x87 floating point stack = overflow. > if you would post the code around the program counter in your error > message it would be helpful. asm(*PC) with acid would be even better. >=20 > - erik >=20 =97 Federico G. Benavento benavento@gmail.com --Apple-Mail=_9548ED79-145D-4B11-B9C4-5DA66BDABE90 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJSj4vMAAoJEJq2ql3haYk/EG4P/jO344v4u+/IJaMqh1i8XiSd 2OXXLlNkyStLfHeUBTqbOJ0lJQ39JNyvY3Xk5a2BlnxYewbuDaHYPhrGwWX6SAal dxyRHy6vVuuEvL36DX4n6zRJjmeTSuF/zHhcy/zC2joJ68wP0T1njJeaPcux7OU0 yhmpeeGPbsMm8hTqJHfA3bcUK/BiqoW79UOfgX+9LtzLkS0pwJBaqXlk5Uvzmho1 jbId92j/h/LdFVHvylv2Jshhl/G8UN3qf3+kailgfnKeNd7tLaoCv9NOiXi/NAqV 597OYhMWE4JfPvxPTCMnUVGWTPl8BasG8vUptP41LR6VP9WB5/6DiwrG4RKIkf9g vR55LrotJ/frMHM+EAU8wODJ+lUeZx/jSj/vCuU03/pF4F31qtFQncPvQb+PKrbm ynoSdPFNntuMlt45epPuueVVrzIdNmM8ZLjg28q0/GBaxlzAhhHzyDjo7pSZyK7j vGF8Y8Yi878WT4VIlmjGqXF8w9GpfW5X4FKmkSlx9SmWpVfRDEuTs6SvE1EzKW1c bsfgfcHYH9V2PNqNRT+DWU1xd6dFkOkPzXi/YwBojrdKYehYCG4CEHaYDXJ7tUg+ kv2GGYQ0roqDhErSLFxpPgszBMokrLChovuct0CDDa3YUaEVoqyZSFzZqScGRjuS 9Mfqx1xAiyQ9v2FDyKdM =Pr7b -----END PGP SIGNATURE----- --Apple-Mail=_9548ED79-145D-4B11-B9C4-5DA66BDABE90--