X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965A13870907 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1605367554; bh=xIcyhk528n58P47XTBc35ncoZFeIj7kADwrLT02n5uA=; 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=yrmX8VOAjdljtTf5CEZdYcAqBJ3He3ziI9XBJlheL/UKso/N7t9oiN8TK5fZHkh2X i6FpGVrKssBcYrZwJV/96FPoXoz6e1P0IZttsAh7XIzSc6i/sONU8afFlxw5FNOfTc cg2036merXBTCRNtJ3b81OECxPLqegRduZkIoo0o= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 95353384404C 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=JJyNuiG52snZDECv1wR6hokEafyDbdOr/bU2vNN5e3U=; b=r7Tfmpudsw76hsSg1XLI5WwpzHzQUQBttbllcCGyZwmzpWTmATkJIpobP619LS5JMI /uk2ii8E4zbyRTkHok+nMnksmrrwlXfgLm/pvmvMLGfTXXcZYLgj8kcP80kbZk/9t+of QG0N3xu7rLPcBSlx0VexPKYBkq/M0h993/URreJzwxFhAw+O6rBWB9P3JMGPkSPDLQ6H d/Q2SfnxIg/VaQpMw6WhK3U6dozAopTjuAmYaiwGcBGF0oHSmDbyS1rL9oUeTzYOsRd4 CPWXNDSvAKPZ22eABMranzeuTr7ilxFbcQ4cnI+2ml6eBrwuHhuD1P2O5CayaFfh9Hrc YYSQ== X-Gm-Message-State: AOAM533COu4jJoOmmvM2P05xIFwGDpW4kS7O9H7HaXZhDxGg0R8oJrqF dDV4vT/Wy92Mcl2XqLlARTTxH0Yn+c2DQQ== X-Google-Smtp-Source: ABdhPJwG3eVHDBlhS81qfhJoY4oT63VRAub0sd7LxrL47DWFF4baaEM+VCw63HJADyAWztZBmhb4Zg== X-Received: by 2002:a17:902:402:b029:d5:ac47:c33f with SMTP id 2-20020a1709020402b02900d5ac47c33fmr6218972ple.60.1605367549390; Sat, 14 Nov 2020 07:25:49 -0800 (PST) Date: Sun, 15 Nov 2020 00:24:56 +0900 To: cygwin AT cygwin DOT com Subject: Re: Failed assertion dialog box In-Reply-To: References: <20201114143744 DOT 92E5 DOT 50F79699 AT gmail DOT com> Message-Id: <20201115002454.BB54.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=-1.8 required=5.0 tests=BAYES_00, 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 AT cygwin DOT 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: , From: Lemures Lemniscati via Cygwin Reply-To: Lemures Lemniscati Content-Type: text/plain; charset="utf-8" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 0AEFQQGF013027 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 AT cygwin DOT 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 > > > > > 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?) 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. 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