public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "André Bleau" <andre_bleau@hotmail.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Failed assertion dialog box ATTN: Takashi Yano
Date: Thu, 19 Nov 2020 21:53:05 +0000	[thread overview]
Message-ID: <DM5PR19MB0986A2F2AE821C0F16E578A293E00@DM5PR19MB0986.namprd19.prod.outlook.com> (raw)
In-Reply-To: <6d8262e3-4206-a05b-5252-f77bef27b0db@towo.net>

De : Cygwin <cygwin-bounces@cygwin.com> de la part de Thomas Wolff <redacted>
Envoyé : 19 novembre 2020 13:30
À : cygwin@cygwin.com <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box ATTN: Takashi Yano 
 
---------------------------------------------------------------------------------------

Am 19.11.2020 um 15:21 schrieb André Bleau via Cygwin:
> ...
> Here's some more info:
>
> It seems the bug is related to pseudo-console support; that explains why it is Windows 10 specific.
>
> Experiment:
>
> CYGWIN=disable_pcon /usr/bin/mintty &
>
> In the newly created window:
>
> $ ./a.exe </dev/null >output.txt 2>&1
> Aborted (core dumped)
>
> No message box popup.
>
> $ cat output.txt
> assertion "false" failed: file "assert.cpp", line 3, function: int main()
>
> In the original mintty window, with empty CYGWIN env variable:
>
> $ ./a.exe </dev/null >output.txt 2>&1
> Aborted (core dumped)
>
> A message box pops
>
> AND:
>
> $ cat output.txt
>
>   output.txt  is empty
>
> So, 2 problems here.
>
> In a CMD Window:
>
> set path=%PATH%D:\Cygwin\bin;
> a.exe <NUL: >outcmd.txt 2>&1
>        1 [main] a 759 cygwin_exception::open_stackdumpfile: Dumping stack trace to a.exe.stackdump
>
> type outcmd.txt
> assertion "false" failed: file "assert.cpp", line 3, function: int main()
>        1 [main] a 759 cygwin_exception::open_stackdumpfile: Dumping stack trace to a.exe.stackdump
>
> The bug could be in cygwin or in mintty. Maybe this is something that Thomas Wolff (mintty author) or Takashi Yano  (pseudo-console support expert) would want to look at.
> ---------------------------------------------------------------------------------------
>
> OK, I opened an issue for mintty and it was quickly closed with that quote:
>
> "Quick generic answer: if it's caused by ConPTY support, it's not related to mintty; also mintty never shows any popups.
> Funny thing, though, but really: assert isn't handled by the terminal."
>
> So the issue can only be with pseudo-console support in cygwin.
It does not seem to happen in xterm which is weird.
It does however also happen in rxvt-unicode, xfce4-terminal, and vte.
The message text of the popup can be easily found in cygwin code.
Thomas
---------------------------------------------------------------------------------------

One more data point:

The following program:

$ cat stderr.c
#include <stdio.h>
int main() {
  fprintf(stdout, "To stdout\n");
  fprintf(stderr, "To stderr\n");
  return 0;
}

$ gcc stderr.c
$ ./a.exe </dev/null >output.txt 2>&1

Behaves normally, with either empty CYGWIN env variable or with 
$ CYGWIN=disable_pcon /usr/bin/mintty &

So the problem is narrowly confined to how Cygwin handles assert when pseudo-console is used and stdin, stdout, and stderr are redirected. Not in all cases where pseudo-console is used and stdin, stdout, and stderr are redirected. 

- André Bleau

  reply	other threads:[~2020-11-19 21:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 17:27 Failed assertion dialog box William M. (Mike) Miller
2020-11-14  3:45 ` Duncan Roe
2020-11-14  4:21   ` William M. (Mike) Miller
2020-11-14  4:37     ` André Bleau
2020-11-14  5:37       ` Lemures Lemniscati
2020-11-14 14:12         ` William M. (Mike) Miller
2020-11-14 15:24           ` Lemures Lemniscati
2020-11-14 15:53             ` William M. (Mike) Miller
2020-11-15  4:46     ` Duncan Roe
2020-11-15 13:12       ` William M. (Mike) Miller
2020-11-15 20:04         ` André Bleau
2020-11-15 20:39           ` André Bleau
2020-11-15 20:59             ` William M. (Mike) Miller
2020-11-19 14:21             ` Failed assertion dialog box ATTN: Takashi Yano André Bleau
2020-11-19 18:30               ` Thomas Wolff
2020-11-19 21:53                 ` André Bleau [this message]
2020-11-20  0:06                 ` Duncan Roe
2020-11-20  0:19                   ` Takashi Yano
2020-11-20  1:40                     ` Duncan Roe
2020-11-20  2:04                     ` Duncan Roe
2020-11-20  7:09                       ` Thomas Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR19MB0986A2F2AE821C0F16E578A293E00@DM5PR19MB0986.namprd19.prod.outlook.com \
    --to=andre_bleau@hotmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).