X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9B1B23857C65
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=optusnet.com.au
Authentication-Results: sourceware.org;
 spf=none smtp.mailfrom=dunc@dimstar.local.net
Date: Sun, 15 Nov 2020 15:46:13 +1100
From: Duncan Roe <duncan_roe@optusnet.com.au>
To: cygwin@cygwin.com
Subject: Re: Failed assertion dialog box
Message-ID: <20201115044613.GE2905@dimstar.local.net>
Mail-Followup-To: cygwin@cygwin.com
References: <CAH5rLZVNLkwntpF4U-27+KeF_eh30yc2bij_MqejWTxBbdQmdw@mail.gmail.com>
 <20201114034504.GD2905@dimstar.local.net>
 <CAH5rLZV+T7u_u6TgivKA7y2RmBJiySVuUsxPVJQjLsEYoN91_A@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAH5rLZV+T7u_u6TgivKA7y2RmBJiySVuUsxPVJQjLsEYoN91_A@mail.gmail.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.3 cv=F8MpiZpN c=1 sm=1 tr=0 cx=a_idp_d
 a=LANN2BGfcS3zZ0PSgbjVGw==:117 a=LANN2BGfcS3zZ0PSgbjVGw==:17
 a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=RSmzAf-M6YYA:10 a=PO7r1zJSAAAA:8
 a=pGLkceISAAAA:8 a=eZ3Y8ILQc_sS73CcJn0A:9 a=CjuIK1q_8ugA:10
X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,
 HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY,
 RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_NONE,
 TXREP autolearn=no 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>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

On Fri, Nov 13, 2020 at 11:21:12PM -0500, cygwin wrote:
> On Fri, Nov 13, 2020 at 10:45 PM Duncan Roe <duncan_roe@optusnet.com.au>
> 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
> william.m.miller@gmail.com

Sorry, should have mentioned running on Win7 Home.

When I try it on my wife's Win10 system, I get the dialog box same as you.

Cheers ... Duncan.
--
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
