www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/26/03:14:11

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer david.siemens.de)
From: "Andrej Borsenkow" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: <Cygwin AT Sourceware DOT Cygnus DOT Com>
Subject: Exit code zero in case of STATUS_ACCESS_VIOLATION - AC_TRY_RUN confused
Date: Wed, 26 Jul 2000 11:13:10 +0400
Message-ID: <000201bff6d0$f46e19f0$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-reply-to: <u9r98iys5p.fsf@ait-tech.com>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

> > This particular problem was due to tgetent() problem. Zsh tests, if
> > tgetent() accepts null pointer for buffer. Unfortunately,
> test always
> > succeeded, but running under gdb showed, that Zsh crashed in
> > tgetent(0,"cygwin").
> >

Test succeeded because you get exit status 0 in case of program crash
(and AC_TRY_RUN believed everything O.K.):

mw1g017 AT MW1G17C ~/src/temcap
$ cat main.c
main()
{
    int i = tgetent((char*)0,"vt100");
    if (i > 0) {
        char tbuf[1024], *u;
        u = tbuf;
        tgetstr("cl", &u);
    }
    exit(!i || i == -1);
}

mw1g017 AT MW1G17C ~/src/temcap
$ gcc -o main main.c -ltermcap

mw1g017 AT MW1G17C ~/src/temcap
$ ./main
      0 [main] main 1010 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
   3317 [main] main 1010 stackdump: Dumping stack trace to
main.exe.stackdump

mw1g017 AT MW1G17C ~/src/temcap
$ echo $?
0

Is it expected? The above is exact test as used in Zsh. (ncurses
obviously has more friendly tgetent() :-)

-andrej

P.S. I'd appreciate Cc as I am not on this list.


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

- Raw text -


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