From: Joel Salomon <JoelCSalomon@Gmail.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] NaN(2)
Date: Tue, 20 Feb 2007 19:20:31 -0500 [thread overview]
Message-ID: <f02ff9e24e74f206ffbb8949e924b690@plan9.jp> (raw)
In-Reply-To: <7871fcf50702201600t500a1610yee4b99b8c0068671@mail.gmail.com>
Playing with acid a bit:
cpu% cat tnan.c
#include <u.h>
#include <libc.h>
void
main(int, char**)
{
NaN(); // ☹
exits(0);
}
cpu% 8c -FTVw tnan.c
cpu% 8l -o tnan tnan.8
cpu% tnan
tnan 55986: suicide: sys: fp: invalid operation fppc=0x108d status=0x8081 pc=0x00001028
cpu% acid -l acme 55986
/proc/55986/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/acme
/sys/lib/acid/386
acid: stk()
At pc:0x00001028:main+0x8 /usr/chesky/src/hak/lex/tnan.c:7
main()
called from _main+0x31 /sys/src/libc/386/main9.s:16
acid: regs()
PC 0x00001028 main+0x8 /usr/chesky/src/hak/lex/tnan.c:7
SP 0xdfffef5c ECODE 0xf0100661 EFLAG 0x00010292
CS 0x00000023 DS 0x0000001b SS 0x0000001b
GS 0xf010001b FS 0x0000001b ES 0x0000001b
TRAP 0x00000010 math coprocessor error
AX 0xdfffefb4 BX 0x00000001 CX 0x00000000 DX 0x0001d260
DI 0xdfffea17 SI 0x0001f425 BP 0x00031e00
acid: asm(main)
main 0x00001020 SUBL $0x8,SP
main+0x3 0x00001023 CALL NaN(SB)
main+0x8 0x00001028 FMOVDP F0,F0
main+0xa 0x0000102a MOVL $0x0,0x0(SP)
main+0x11 0x00001031 CALL exits(SB)
main+0x16 0x00001036 ADDL $0x8,SP
main+0x19 0x00001039 RET
_main 0x0000103a SUBL $0x48,SP
acid: fpr()
F0 0
F1 0
F2 0
F3 0
F4 0
F5 0
F6 3.431198e+09
F7 1000
control 0x027f
status 0x0001
tag 0xffff
ip offset 0x0000108d
cs selector 0x0023
opcode 0xea17
data operand offset 0xef50
operand selector 0x001b
acid: asm(NaN)
NaN 0x0000107a SUBL $0xc,SP
NaN+0x3 0x0000107d MOVL $0x7ff00000,0x8(SP)
NaN+0xb 0x00001085 MOVL $0x1,a+0x4(SP)
NaN+0x13 0x0000108d FMOVD a+0x4(SP),F0
NaN+0x17 0x00001091 ADDL $0xc,SP
NaN+0x1a 0x00001094 RET
isNaN 0x00001095 SUBL $0x1c,SP
acid:
Considering that fppc points into NaN (0x108d), is the suicide
happening within NaN? Anything I can do to pinpoint the bug better?
--Joel
next prev parent reply other threads:[~2007-02-21 0:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-20 23:55 Joel Salomon
2007-02-21 0:00 ` Joel C. Salomon
2007-02-21 0:20 ` Joel Salomon [this message]
2007-02-21 1:00 ` erik quanstrom
2007-02-21 2:26 ` Joel Salomon
2007-02-21 4:18 ` erik quanstrom
2007-02-21 4:35 ` Joel C. Salomon
2007-02-21 5:10 ` Joel C. Salomon
2007-02-21 5:50 ` Russ Cox
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=f02ff9e24e74f206ffbb8949e924b690@plan9.jp \
--to=joelcsalomon@gmail.com \
--cc=9fans@cse.psu.edu \
/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).