From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by sourceware.org (Postfix) with ESMTP id 9B1B23857C65 for ; Sun, 15 Nov 2020 04:46:19 +0000 (GMT) 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 Received: from dimstar.local.net (n49-192-180-44.sun4.vic.optusnet.com.au [49.192.180.44]) by mail104.syd.optusnet.com.au (Postfix) with SMTP id 5B12458BC56 for ; Sun, 15 Nov 2020 15:46:14 +1100 (AEDT) Received: (qmail 16836 invoked by uid 501); 15 Nov 2020 04:46:13 -0000 Date: Sun, 15 Nov 2020 15:46:13 +1100 From: Duncan Roe To: cygwin@cygwin.com Subject: Re: Failed assertion dialog box Message-ID: <20201115044613.GE2905@dimstar.local.net> Mail-Followup-To: cygwin@cygwin.com References: <20201114034504.GD2905@dimstar.local.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2020 04:46:23 -0000 On Fri, Nov 13, 2020 at 11:21:12PM -0500, cygwin wrote: > 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 > > > 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.