From: "Federico G. Benavento" <benavento@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] f2c issue
Date: Fri, 22 Nov 2013 14:52:28 -0200 [thread overview]
Message-ID: <ACF01F71-9366-43DA-B62F-AEBBFD5592F9@gmail.com> (raw)
In-Reply-To: <CAF1zXhm95ew=kTNDUeJvLuPV7CusEW+D+p2pHcAFuqx6w=16GA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]
you might want to disable that exception in main()
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 <fausto.saporito@gmail.com> wrote:
> Hi Erik,
>
> yes, it's a FP stack overflow... :-)
> I also tried with 9front, and the error message is slightly different:
>
> ./arithchk
> #define IEEE_8087
> #define Arith_Kind_ASL 1
> arithchk 8523: suicide: sys: fp: invalid operation fppc=0x12ee status=0xb8b3 pc=0x000012f2
>
> further checks reveal that the problem is this function:
>
> void
> get_nanbits(unsigned int *b, int k)
> {
> union { double d; unsigned int z[2]; } u, u1, u2;
>
> k = 2 - k;
> u1.z[k] = u2.z[k] = 0x7ff00000;
> u1.z[1-k] = u2.z[1-k] = 0;
> u.d = u1.d - u2.d; /* Infinity - Infinity */ <<<<<<<====== this is the FATAL ERROR.
> b[0] = u.z[0];
> b[1] = u.z[1];
> }
>
> called as getnanbits(nanbits,1)
>
> I'm sorry but I don't know how to generate the acid code.
>
> regards,
> Fausto
>
>
>
> 2013/11/22 erik quanstrom <quanstro@quanstro.net>
> > By the way I have always the same problem (suicide with stack overflow
> > running arithchk).
>
> 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.
>
> - erik
>
—
Federico G. Benavento
benavento@gmail.com
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 859 bytes --]
next prev parent reply other threads:[~2013-11-22 16:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 16:50 Fausto Saporito
2013-11-21 17:20 ` Jens Staal
2013-11-21 21:37 ` Fausto Saporito
2013-11-22 8:18 ` Jens Staal
2013-11-22 12:14 ` Fausto Saporito
2013-11-22 14:44 ` erik quanstrom
2013-11-22 16:42 ` Fausto Saporito
2013-11-22 16:52 ` Federico G. Benavento [this message]
2013-11-22 19:54 ` erik quanstrom
2013-11-22 21:18 ` Fausto Saporito
2013-11-22 22:15 ` Charles Forsyth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ACF01F71-9366-43DA-B62F-AEBBFD5592F9@gmail.com \
--to=benavento@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).