From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 6F6393857811 for ; Sat, 14 Nov 2020 15:53:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6F6393857811 Received: by mail-ej1-x62f.google.com with SMTP id w13so18165776eju.13 for ; Sat, 14 Nov 2020 07:53:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KT8vbxtFx4Y1bmy4fPvchxISQ+3nfOHnPle8uQWnG64=; b=QaQNR0FANUBhZVhh0DK0LLdwGIwc4SWjNMB8DCV/bXAvbooB1v+90auZh5z03AApj6 kkkeeNvWnuq2a4/PmGOwgztK4HUmToK1LucgGfmCEty/PEDn4R6uszoMq5MXe1cHizSv aiOrUMROura3WAwMnYzkQ0LSx37HLQ79WcZRyJHR51ti2v1KUAQ45CprIWNhg/KhwHx4 7nYH0CWMNGx5lErKClERVAr2zpxi7lJFqlSH3GIyVtIY02BS84zvV5IOHSvnIFUvo6UH MP+0WgTBqOZ1hWCdaQ4+R3/taen4YQSg4KWfxIcC35KmlH0b4OM6QjAhSuBt0cQSoBr1 1aqQ== X-Gm-Message-State: AOAM5308jJQ0KtuJ6K6uAttsftKF9fs7xAYOpQTu6gotACj+JfM2UF1/ 3E5y9scMDZQLMiShXn/eLFKBwsYteF+IWN7sMDw= X-Google-Smtp-Source: ABdhPJzGgb148CtexdHPmr1LNdmscfA9my9wg6/WYhPoT4m6hC2jk+Equ0U+xupWA5oT5PiEAzYf8E6jXVQygtgJCMI= X-Received: by 2002:a17:906:80ca:: with SMTP id a10mr7392880ejx.351.1605369212528; Sat, 14 Nov 2020 07:53:32 -0800 (PST) MIME-Version: 1.0 References: <20201114143744.92E5.50F79699@gmail.com> <20201115002454.BB54.50F79699@gmail.com> In-Reply-To: <20201115002454.BB54.50F79699@gmail.com> From: "William M. (Mike) Miller" Date: Sat, 14 Nov 2020 10:53:21 -0500 Message-ID: Subject: Re: Failed assertion dialog box To: Lemures Lemniscati Cc: The Cygwin Mailing List X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sat, 14 Nov 2020 15:53:35 -0000 On Sat, Nov 14, 2020 at 10:26 AM Lemures Lemniscati via Cygwin < cygwin@cygwin.com> wrote: > On Sat, 14 Nov 2020 09:12:11 -0500, William M. (Mike) Miller > > 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=C3=A9 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++ runti= me > > > > > > 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 progr= am > > > 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 do= es > > > _not_ > > > > pop up an error dialog box, so presumably it's in the Cygwin runtim= e, > > > > 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=C3=A9 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=C3=A9 posted > above.) > > > > The fact that you and Andr=C3=A9 don't get a dialog box gives me hope t= hat > > 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 err= or > > popup, right?) > > Sorry, I tested on a very old machine (CYGWIN_NT-6.1), > on which no error popup occurred. > > But on Windows 10 (CYGWIN_NT-10.0), it does not work on Windows 10, > and brings an error popup. > Ah, that makes sense; I was previously doing this testing on an older machine (now defunct, so I can't check versions) and didn't have this issue. Thanks for the update. --=20 William M. (Mike) Miller | Edison Design Group william.m.miller@gmail.com