delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/11/13/12:28:58

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E6983947C0D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1605288494;
bh=S++wmAyjrszF+4chDTLvjh8ebwYUd28nAz2aQiYcMog=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=JLMksW+hEwkkimJJS2PQo+E/4kYpEpeSzL6uHq/F6vSMiIPgM0N1h87yMOOOT2t5n
6IneAMO8wRLvUkd/uQyqYoRTL1mbr8LXD2I8qa2/+Y10D0elmKd3ydkeyoiOUBCiRY
3erzlZgtNCJ7nR2ydA6/hARB0/MIkxI/PMXS8lLk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 84658385481D
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=qXL/b8lD+EmO3xl1DJy2Jx8m+jcuRbWDcX7l98uSzmM=;
b=AlcRCBEXFfgObYQGNCUO4T0hozZTOFbF0lKCZI+5TOt9AHNiQYfmmGiDEiz0CXvnJj
a+DnYByBdK8X71CXWRk4ccOl9kK0kextMBiTGa8Ylbfuiam4krtul1+Oda0IFVu4GTP6
rOmiY2f5O+ZIOGrHfPaykaIPBxuxeINWbrKkBcKEO4DrOJLx29TXWuN6bCd2zQLSz38l
61B+0H56z3mYAIvYEZwrEz9V/cC3kpVVs7rCyKCPMesqMTWHzbthKVsergw+rCvg4Kcj
LySpBfVSkY4ZEDuwwTKcOT0BUDljhwGIn9fV4pF3yLl6qMllEmSOCRTArmGKVDs453Vn
8Vfg==
X-Gm-Message-State: AOAM531vZgYgAa4iEDOHTtECETggKeHoXiGwa+erkzt8GYiyWEVGs8G6
SgcHgpjW4lJS2zmXWwuxRBc+2wtWMezu/KqEVP+HuBE6RwVeiA==
X-Google-Smtp-Source: ABdhPJz8F1LBbxr+MblvH3J9vEsWl+D08oj6XZV5kxJjWf8W2foWHrg/LpCNN11TffS0g1UJv5qYSA65V1VQE2ckVKM=
X-Received: by 2002:a17:906:3a8d:: with SMTP id
y13mr3093482ejd.460.1605288487836;
Fri, 13 Nov 2020 09:28:07 -0800 (PST)
MIME-Version: 1.0
Date: Fri, 13 Nov 2020 12:27:57 -0500
Message-ID: <CAH5rLZVNLkwntpF4U-27+KeF_eh30yc2bij_MqejWTxBbdQmdw@mail.gmail.com>
Subject: Failed assertion dialog box
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-Spam-Status: No, score=-2.2 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 <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: "William M. \(Mike\) Miller via Cygwin" <cygwin AT cygwin DOT com>
Reply-To: "William M. \(Mike\) Miller" <william DOT m DOT miller AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

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.

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019