X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EFBE386100F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1605327687; bh=9E0Smim1dHLI5qc9CCtqFm4nLYQf46EtgAFwvXZkPLc=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=o+hcY7VA5PEBJFHwF2Ax1PGPGshJe0yuuAUmVejJY/+oyTedG0FpZiIetBkCbTnZS 75gQNGlh1PHnPzfTRCVy9iEC5f+VKgvSU7smwOZwlrYEzJrBqL0u7CsJFREAxJdnpe 7PuX/3AL8SXDa8JI+/lU3nDTBt6lE3U9iy1HlLiI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 58D293857C5F 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; bh=EqGI2QrFmHffXXStlYzw+MWl17hppOtQy0lzGIGfD7w=; b=UHjplWjsMuuC/T5gzMqQ7fcIxnAEfsDABfk1zFDcFPfEPxiCB4grncXmO6hTatelRk 4qWFYTqQoDmZolCnVdd21AT1KNaOILDaOhwgBWj/l9KOc4yaMSDRVM3BrAax/xMHhc6I zVpeRormMAZ8PFOCV9W0DnSB01/mFu3PQYt992Jfe/O1Sb/Rm20aNz5jxgwCHH9qJUpt o9fsNB8zfneQFNCGwlwMEnn+PLhhVkpUpZWL7RuBR2SbityT2FYWhVPoMdfG2Qp1R7kr Uzd7LeI+2K5b+oPdq6c5bA1uhLHCPd+eFZzlbhk+sExhL3cMgttznKeBY9LuOFzfo4li H4tQ== X-Gm-Message-State: AOAM5324oxkQHnlVgmz1+lCUy2kmYKK3VEFHswXNwxvW+jsO7tzOj5ev KSejdqtIstFcBnxFnpnetGHwMIc0+nF8+12ViIz2uwush0o= X-Google-Smtp-Source: ABdhPJyKUR6MoJHjermumoJwADWW0ECQ6rGPcJ0KKmGr8rMmMwjJFqhxDjmFX27md+j1v/eJ2GX6vlJ6UMZ/nqlvgYU= X-Received: by 2002:a50:fe02:: with SMTP id f2mr5986763edt.97.1605327683215; Fri, 13 Nov 2020 20:21:23 -0800 (PST) MIME-Version: 1.0 References: <20201114034504 DOT GD2905 AT dimstar DOT local DOT net> In-Reply-To: <20201114034504.GD2905@dimstar.local.net> Date: Fri, 13 Nov 2020 23:21:12 -0500 Message-ID: Subject: Re: Failed assertion dialog box To: 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 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: "William M. \(Mike\) Miller via Cygwin" Reply-To: "William M. \(Mike\) Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "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.) -- William M. (Mike) Miller | Edison Design Group william DOT m DOT miller AT gmail DOT com -- 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