X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65AC13861036
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1605332324;
	bh=gQP+vzUQMCNU5JJkXkDQ1YfchRYAsT41pttk3HJoMsw=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=CL43lJTSbUYYyaMuOJspOwtAAsTPl59jpKwdjkffUdSlhC3w/w3tGr+EcjO0J1b/Z
	 sr4Rl7bRwnUxj8YOcCeR67kGZilVXgnb8TqJIkF9EAN8Jp1m+TFye3IT+LSVt53ctf
	 Bi1VCstwA8YaR23iTSx9RTXyxLZNLrgaF0wK31XQ=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3FB853858001
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:subject:in-reply-to:references
 :message-id:mime-version:content-transfer-encoding;
 bh=dibMcokSi/IO6bByirjNy9YklJ8dFTQZQtgujXTymmA=;
 b=Ht74pbYIV0DRn0EXNoIh7E90ci64eRM2fxI19sscF54HBI5xDXqKpRdbADUL+t5ToN
 5+uDO/cYAcnMAqlQr49LebcpIWN/MgN1AgKiVqf0ggjaVD4hGVqh0rlBU90sJBWSks6R
 3tUOCFnT9VlesvnmjPicda167hJhmNPlXwsoOpjPsIev2lxRSdoukqfsfTE9PqkosDdZ
 bLPf6BLHGOjR8YO95BGWKN5WaomK6UR+TspAQ9e8fpFiJvR+/HmPEJbYmFhXD0tMy92X
 kcDu81zKxXKHQDAqosaKIcQnoY8L7jdBw2nDA/O7M/XSO86Zgy8UJ2apMKaE7UTQXfPB
 ytbQ==
X-Gm-Message-State: AOAM5320zI4UZfusSF9FHJXyTwjlxzrn8rM+r0DRfFH6qBSbZWyr5FXv
 ODoh+SkZQFI0yttO1fly5c5BW9mFghsREQ==
X-Google-Smtp-Source: ABdhPJxBVNMv98rk1cbgdACYd35yaRWCteHkhTPqyck9xe/9EbsEfOsjvgbp4mu70f3ErHyoUb1TZw==
X-Received: by 2002:a17:90a:8542:: with SMTP id
 a2mr6597913pjw.101.1605332319817; 
 Fri, 13 Nov 2020 21:38:39 -0800 (PST)
Date: Sat, 14 Nov 2020 14:37:47 +0900
To: cygwin@cygwin.com
Subject: Re: Failed assertion dialog box
In-Reply-To: <MWHPR19MB09925AD67FFA893D1B8805E293E50@MWHPR19MB0992.namprd19.prod.outlook.com>
References: <CAH5rLZV+T7u_u6TgivKA7y2RmBJiySVuUsxPVJQjLsEYoN91_A@mail.gmail.com>
 <MWHPR19MB09925AD67FFA893D1B8805E293E50@MWHPR19MB0992.namprd19.prod.outlook.com>
Message-Id: <20201114143744.92E5.50F79699@gmail.com>
MIME-Version: 1.0
X-Mailer: Becky! ver. 2.75.01 [ja]
X-Antivirus: Avast (VPS 201113-2, 2020/11/13), Outbound message
X-Antivirus-Status: Clean
X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, BODY_8BITS,
 DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM,
 RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Lemures Lemniscati via Cygwin <cygwin@cygwin.com>
Reply-To: Lemures Lemniscati <lemures.lemniscati@gmail.com>
Content-Type: text/plain; charset="utf-8"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 0AE5dAg1002219

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.)
> 
> -- 
> William M. (Mike) Miller | Edison Design Group
> 
> 
> 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

Lem
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

