Signal hang
Matthew Brown
mbrown@mediadb.net
Tue Dec 21 14:51:00 GMT 1999
I am attempting to build libstdc++ 2.90.6
with the following configuration:
ÃÂ
- Windows NT4 sp3
- cygwin full b20.1
- Mumit's gcc 2.95.2 installed according to
instructions
ÃÂ
The symptom is that when mknumeric_limits
runs, it hangs in a loop (CPU is chewed-up and nothing useful happens). When I
dig into things, I find that gen-num-limits.exe is where the loop is happening,
and, when I dig in farther, I find that the loop is in exception handling code.
gen-num-limits is trying to generate divide-by-zero and overflow errors for
various intrinsic types; this is where the problem is occurring.
If I run gen-num-limits interactively (so
it spews to the terminal), I see that the behavior is not consistent; sometimes
it chokes on divide-by-zeroÃÂ for one type and sometimesÃÂ for
another.
ÃÂ
Here is a small program with which I can
reproduce the problem simply (built with no special options):
ÃÂ
------------------------------ cut here
----------------------------
#include <signal.h> #include
<setjmp.h> #include <stdio.h>
ÃÂ
jmp_buf env;
ÃÂ
void signal_handler(int sig) {
ÃÂ ÃÂ fprintf(stderr, "caught a signal\n"); ÃÂ ÃÂ
longjmp(env, sig); }
ÃÂ
typedef charÃÂ ÃÂ
tested_type;
ÃÂ
int main(int argc, char
**argv) { ÃÂ ÃÂ signal(SIGFPE, signal_handler); ÃÂ ÃÂ if
(setjmp(env) == 0) ÃÂ ÃÂ { ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
fprintf(stderr, "set the jump return location\n");
ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
tested_typeÃÂ ÃÂ ÃÂ ÃÂ zero =
tested_type(); ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
tested_typeÃÂ ÃÂ ÃÂ ÃÂ one =
tested_type(1); ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
tested_typeÃÂ ÃÂ ÃÂ ÃÂ junk = one / zero; ÃÂ ÃÂ
}
ÃÂ
ÃÂ ÃÂ fprintf(stderr,
"Done!\n"); ÃÂ ÃÂ return 0; }
------------------------------ cut here
----------------------------
ÃÂ
This is essentially the flow of processing that occurrs in gen-num-limits.
With tested_type set to an integral type (including bool), sometimes it works,
sometimes it loops. Sometimes it just exits.
ÃÂ
Does anyone know of an issue here?
ÃÂ
Vadim Egorov posted a message about this a few months ago, but there are no
replies on this list.
ÃÂ
Thanks for any help.
ÃÂ
-- Matthew Brown
BEGIN:VCARD
VERSION:2.1
N:Brown;Matthew
FN:Matthew Brown
ORG:Concord Software, Inc.
TITLE:Senior Programmer
TEL;WORK;VOICE:(603) 880-8151
TEL;WORK;FAX:(603) 886-1780
ADR;WORK:;;4 John Tyler Street;Merrimack;New Hampshire;03054;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:4 John Tyler Street=0D=0AMerrimack, New Hampshire 03054=0D=0AUSA
X-WAB-GENDER:2
URL:
URL: http://www.concordsw.com
EMAIL;PREF;INTERNET:mbrown@mediadb.net
REV:19991221T225006Z
END:VCARD
More information about the Cygwin
mailing list