delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/12/21/17:52:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <019601bf4c05$b9b4e210$2301a8c0@mediadb.net>
From: "Matthew Brown" <mbrown AT mediadb DOT net>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: Signal hang
Date: Tue, 21 Dec 1999 17:50:06 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300

------=_NextPart_000_0192_01BF4BDB.D0C7CFA0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0193_01BF4BDB.D0C7CFA0"


------=_NextPart_001_0193_01BF4BDB.D0C7CFA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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)=20
{=20
   fprintf(stderr, "caught a signal\n");=20
   longjmp(env, sig);=20
}

typedef char   tested_type;

int main(int argc, char **argv)
{
   signal(SIGFPE, signal_handler);
   if (setjmp(env) =3D=3D 0)
   {
      fprintf(stderr, "set the jump return location\n");

      tested_type     zero =3D tested_type();
      tested_type     one =3D tested_type(1);
      tested_type     junk =3D 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

------=_NextPart_001_0193_01BF4BDB.D0C7CFA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Courier New" size=3D2>I am attempting to build =
libstdc++ 2.90.6=20
with the following configuration:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>- Windows NT4 sp3</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>- cygwin full =
b20.1</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>- Mumit's gcc 2.95.2 installed =
according to=20
instructions</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>The symptom is that when =
mknumeric_limits=20
runs, it hangs in a loop (CPU is chewed-up and nothing useful happens). =
When I=20
dig into things, I find that gen-num-limits.exe is where the loop is =
happening,=20
and, when I dig in farther, I find that the loop is in exception =
handling code.=20
gen-num-limits is trying to generate divide-by-zero and overflow errors =
for=20
various intrinsic types; this is where the problem is =
occurring.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>If I run gen-num-limits =
interactively (so=20
it spews to the terminal), I see that the behavior is not consistent; =
sometimes=20
it chokes on divide-by-zero&nbsp;for one type and sometimes&nbsp;for=20
another.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Here is a small program with =
which I can=20
reproduce the problem simply (built with no special =
options):</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>------------------------------ =
cut here=20
----------------------------</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>#include =
&lt;signal.h&gt;<BR>#include=20
&lt;setjmp.h&gt;<BR>#include &lt;stdio.h&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2><BR>jmp_buf env;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>void signal_handler(int sig) =
<BR>{=20
<BR>&nbsp;&nbsp; fprintf(stderr, "caught a signal\n"); <BR>&nbsp;&nbsp;=20
longjmp(env, sig); <BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>typedef char&nbsp;&nbsp;=20
tested_type;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>int main(int argc, char=20
**argv)<BR>{<BR>&nbsp;&nbsp; signal(SIGFPE, =
signal_handler);<BR>&nbsp;&nbsp; if=20
(setjmp(env) =3D=3D 0)<BR>&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
fprintf(stderr, "set the jump return location\n");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tested_type&nbsp;&nbsp;&nbsp;&nbsp; zero =3D=20
tested_type();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tested_type&nbsp;&nbsp;&nbsp;&nbsp; one =3D=20
tested_type(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tested_type&nbsp;&nbsp;&nbsp;&nbsp; junk =3D one / zero;<BR>&nbsp;&nbsp; =

}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>&nbsp;&nbsp; fprintf(stderr,=20
"Done!\n");<BR>&nbsp;&nbsp; return 0;<BR>}</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>
<DIV><FONT face=3D"Courier New" size=3D2>------------------------------ =
cut here=20
----------------------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>This is essentially the flow of processing that occurrs in =
gen-num-limits.=20
With tested_type set to an integral type (including bool), sometimes it =
works,=20
sometimes it loops. Sometimes it just exits.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does anyone know of an issue here?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Vadim Egorov posted a message about this a few months ago, but =
there are no=20
replies on this list.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for any help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-- Matthew Brown</DIV></FONT></DIV></BODY></HTML>

------=_NextPart_001_0193_01BF4BDB.D0C7CFA0--

------=_NextPart_000_0192_01BF4BDB.D0C7CFA0
Content-Type: text/x-vcard;
	name="Matthew Brown.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Matthew Brown.vcf"

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=3DQUOTED-PRINTABLE:4 John Tyler =
Street=3D0D=3D0AMerrimack, New Hampshire 03054=3D0D=3D0AUSA
X-WAB-GENDER:2
URL:
URL:http://www.concordsw.com
EMAIL;PREF;INTERNET:mbrown AT mediadb DOT net
REV:19991221T225006Z
END:VCARD


------=_NextPart_000_0192_01BF4BDB.D0C7CFA0
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
------=_NextPart_000_0192_01BF4BDB.D0C7CFA0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019