public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "William M. (Mike) Miller" <william.m.miller@gmail.com>
To: Lemures Lemniscati <lemures.lemniscati@gmail.com>
Cc: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Failed assertion dialog box
Date: Sat, 14 Nov 2020 09:12:11 -0500	[thread overview]
Message-ID: <CAH5rLZVXdua=dFs7jB=LpG_ObHCwRqCnoMSbRiTnJvUk3tP0uA@mail.gmail.com> (raw)
In-Reply-To: <20201114143744.92E5.50F79699@gmail.com>

On Sat, Nov 14, 2020 at 12:39 AM Lemures Lemniscati via Cygwin <
cygwin@cygwin.com> wrote:

> On Sat, 14 Nov 2020 04:37:43 +0000, André Bleau via Cygwin
> >
> > On Fri, Nov 13, 2020 at 10:45 PM Duncan Roe
> > wrote:
> >
> > > Hi William,
> > >
> > > On Fri, Nov 13, 2020 at 12:27:57PM -0500, cygwin wrote:
> > > > I've run into a problem running a collection of tests under Cygwin
> and I
> > > > wonder if anyone can suggest a way around it.
> > > >
> > > > The problem occurs when a program being run fails a C/C++ runtime
> > > > assertion. Ordinarily, this just writes an error message on stderr
> and
> > > > aborts. Under Cygwin, however, if both stdin and stderr are
> redirected to
> > > > files, the program instead pops up a dialog box that must be
> > > interactively
> > > > dismissed before the failed program will exit - holding up all the
> tests
> > > > that follow it.
> > > >
> > > > Specifically, if I have the following as assert.cpp:
> > > >
> > > >     #include <assert.h>
> > > >     int main() {
> > > >       assert(false);
> > > >     }
> > > >
> > > > and say
> > > >
> > > >     gcc assert.cpp
> > > >     ./a.exe < /dev/null > output 2>&1
> > > >
> > > > I get an error dialog box saying
> > > >
> > > >     Failed assertion
> > > >         false
> > > >     at line 3 of file assert.cpp
> > > >     in function int main()
> > > >
> > > > If I omit either the stdin or the stderr redirection, the program
> behaves
> > > > as desired with no dialog box.
> > > >
> > > > Is there an environment setting or compiler command-line option I can
> > > give
> > > > to suppress the dialog box and always just write a message to stderr
> and
> > > > abort? Thanks for any insights.
> > >
> > > Your example WFFM, (Cygwin64, gcc 10.2.0, everything else also up to
> date).
> > >
> > > Do you still see this behaviour if you run the installer?
> > >
> >
> > Thanks for your reply; unfortunately, yes, it does. I had refreshed
> > the installation fairly recently, and running the installer only updated
> a
> > few things, not cygwin.dll and not gcc; my installation is the same as
> > yours. I've tried it with three different shells (tcsh, bash, mksh) and
> > with both gcc and clang, and all have the same behavior. (Interestingly,
> if
> > I compile the example with MSVC and run it in a Cygwin shell, it does
> _not_
> > pop up an error dialog box, so presumably it's in the Cygwin runtime,
> > specifically the definition of __assert_func.)
> >
> > I see the same behavior as William:
> >
> > ./a.exe < /dev/null > output.txt 2>&1
> > pops a message box.
> >
> > gcc (GCC) 10.2.0
> > CYGWIN_NT-10.0 XXX 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin
> > mintty 3.4.1 (x86_64-pc-cygwin)
> >
> > - André Bleau
>
> It works fine for me.
> Can you check 'gcc -M assert.cpp' ?
> My result is:
>
> $ gcc -M assert.cpp
> assert.o: assert.cpp /usr/include/assert.h /usr/include/_ansi.h \
>  /usr/include/newlib.h /usr/include/_newlib_version.h \
>  /usr/include/sys/config.h /usr/include/machine/ieeefp.h \
>  /usr/include/sys/features.h /usr/include/cygwin/config.h
>

Mine is identical. (Same for "uname -a" output, which André posted above.)

The fact that you and André don't get a dialog box gives me hope that
there's something in the environment or installation that controls that
behavior. (Just to make certain, "works find for me" means that you ran the
executable, redirecting both stdin and stderror, and did not get an error
popup, right?)

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

  reply	other threads:[~2020-11-14 14:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 17:27 William M. (Mike) Miller
2020-11-14  3:45 ` Duncan Roe
2020-11-14  4:21   ` William M. (Mike) Miller
2020-11-14  4:37     ` André Bleau
2020-11-14  5:37       ` Lemures Lemniscati
2020-11-14 14:12         ` William M. (Mike) Miller [this message]
2020-11-14 15:24           ` Lemures Lemniscati
2020-11-14 15:53             ` William M. (Mike) Miller
2020-11-15  4:46     ` Duncan Roe
2020-11-15 13:12       ` William M. (Mike) Miller
2020-11-15 20:04         ` André Bleau
2020-11-15 20:39           ` André Bleau
2020-11-15 20:59             ` William M. (Mike) Miller
2020-11-19 14:21             ` Failed assertion dialog box ATTN: Takashi Yano André Bleau
2020-11-19 18:30               ` Thomas Wolff
2020-11-19 21:53                 ` André Bleau
2020-11-20  0:06                 ` Duncan Roe
2020-11-20  0:19                   ` Takashi Yano
2020-11-20  1:40                     ` Duncan Roe
2020-11-20  2:04                     ` Duncan Roe
2020-11-20  7:09                       ` Thomas Wolff

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='CAH5rLZVXdua=dFs7jB=LpG_ObHCwRqCnoMSbRiTnJvUk3tP0uA@mail.gmail.com' \
    --to=william.m.miller@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=lemures.lemniscati@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).