From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <7549f198696335dda5fba154f63068af@granite.cias.osakafu-u.ac.jp> To: 9fans@cse.psu.edu Subject: Re: [9fans] fp: stack underflow error From: Kenji Okamoto Date: Thu, 1 Jul 2004 17:55:37 +0900 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-dyigsroshjkswuhohlpglgfdlz" Topicbox-Message-UUID: b24b1846-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-dyigsroshjkswuhohlpglgfdlz Content-Disposition: inline Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Probably, you see some comment in a ghostscript program gshtscr.c by Russ (ssearch RSC string). Because now Russ is out. Kenji --upas-dyigsroshjkswuhohlpglgfdlz Content-Type: message/rfc822 Content-Disposition: inline Received: from elmo.cias.osakafu-u.ac.jp ([157.16.103.2]) by diabase; Thu Jul 1 13:50:14 JST 2004 Received: from mail.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by elmo.cias.osakafu-u.ac.jp (8.9.3p2+/3.7W-04061611) with ESMTP id NAA27454 for ; Thu, 1 Jul 2004 13:51:08 +0900 (JST) Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 444651A146 for ; Thu, 1 Jul 2004 00:51:03 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (neuromancer.cse.psu.edu [130.203.4.2]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 2C15219C75 for <9fans@cse.psu.edu>; Thu, 1 Jul 2004 00:50:58 -0400 (EDT) Received: from mail.cse.psu.edu ([130.203.4.6]) by localhost (neuromancer [130.203.4.2]) (amavisd-new, port 10024) with LMTP id 09355-02-38 for <9fans@cse.psu.edu>; Thu, 1 Jul 2004 00:50:56 -0400 (EDT) Received: from mx2.net.titech.ac.jp (mx2.net.titech.ac.jp [131.112.125.31]) by mail.cse.psu.edu (CSE Mail Server) with SMTP id 8A57819C48 for <9fans@cse.psu.edu>; Thu, 1 Jul 2004 00:50:55 -0400 (EDT) Received: (qmail 33770 invoked from network); 1 Jul 2004 04:50:53 -0000 Received: from unknown (HELO vc2.net.titech.ac.jp) (131.112.125.36) by mx2.net.titech.ac.jp with SMTP; 1 Jul 2004 04:50:53 -0000 Received: from unknown (HELO o.cc.titech.ac.jp) (127.0.0.1) by localhost with SMTP; 1 Jul 2004 04:50:53 -0000 Received: from valinore by mail-o.cc.titech.ac.jp (8.11.3/1.1.10.5/20Feb97-0455PM) id i614orF376555; Thu, 1 Jul 2004 13:50:53 +0900 (JST) Message-ID: To: 9fans@cse.psu.edu From: YAMANASHI Takeshi Date: Thu, 1 Jul 2004 13:50:35 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at cse.psu.edu Subject: [9fans] fp: stack underflow error X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+okamoto=granite.cias.osakafu-u.ac.jp@cse.psu.edu Errors-To: 9fans-bounces+okamoto=granite.cias.osakafu-u.ac.jp@cse.psu.edu I encountered a "sys: fp: stack underflow" error in my program. When I change the uint arguments of a2b() to int, the modified program ran successfully. What's wrong with my program? Thanks in advance. ++ program and acid stack trace are attached below ++ % nashi@valinore cat suflow.c #include #include /*{ 8c suflow.c; 8l suflow.8; ./8.out }*/ ulong a2b(uint fr, uint fg, uint fb, uint tr, uint tg, uint tb, double dis) { uchar r, g, b; r = fr + (tr - fr)*dis; g = fg + (tg - fg)*dis; b = fb + (tb - fb)*dis; return (r<<24)+(g<<16)+(b<<8)+0xFF; } void main() { int i; ulong p; for(i=0; i<256; i++) p=a2b(0, 0, 0xFF, 00, 0xFF, 00, 2.0*i/256.0); exits(nil); } % nashi@valinore ./8.out 8.out 1167: suicide: sys: fp: stack underflow fppc=0x1118 status=0x80a1 pc=0x0000118f % nashi@valinore acid 1167 /proc/1167/text:386 plan 9 executable /sys/lib/acid/port /sys/lib/acid/386 acid: stk() At pc:0x0000118f:main+0x46 /usr/nashi/src/test/suflow.c:27 main() /usr/nashi/src/test/suflow.c:21 called from _main+0x31 /sys/src/libc/386/main9.s:16 -- --upas-dyigsroshjkswuhohlpglgfdlz--