public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Failed assertion dialog box
@ 2020-11-13 17:27 William M. (Mike) Miller
  2020-11-14  3:45 ` Duncan Roe
  0 siblings, 1 reply; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-13 17:27 UTC (permalink / raw)
  To: The Cygwin Mailing List

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.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Duncan Roe @ 2020-11-14  3:45 UTC (permalink / raw)
  To: cygwin

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 <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.m.miller@gmail.com
> --

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?

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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-15  4:46     ` Duncan Roe
  0 siblings, 2 replies; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-14  4:21 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Fri, Nov 13, 2020 at 10:45 PM Duncan Roe <duncan_roe@optusnet.com.au>
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 <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.
>
> 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.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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-15  4:46     ` Duncan Roe
  1 sibling, 1 reply; 21+ messages in thread
From: André Bleau @ 2020-11-14  4:37 UTC (permalink / raw)
  To: The Cygwin Mailing List


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


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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-14  4:37     ` André Bleau
@ 2020-11-14  5:37       ` Lemures Lemniscati
  2020-11-14 14:12         ` William M. (Mike) Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Lemures Lemniscati @ 2020-11-14  5:37 UTC (permalink / raw)
  To: cygwin

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

Lem

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-14  5:37       ` Lemures Lemniscati
@ 2020-11-14 14:12         ` William M. (Mike) Miller
  2020-11-14 15:24           ` Lemures Lemniscati
  0 siblings, 1 reply; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-14 14:12 UTC (permalink / raw)
  To: Lemures Lemniscati; +Cc: The Cygwin Mailing List

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é 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 <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.
> > >
> > > 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?)

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Lemures Lemniscati @ 2020-11-14 15:24 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-14 15:24           ` Lemures Lemniscati
@ 2020-11-14 15:53             ` William M. (Mike) Miller
  0 siblings, 0 replies; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-14 15:53 UTC (permalink / raw)
  To: Lemures Lemniscati; +Cc: The Cygwin Mailing List

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

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.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-14  4:21   ` William M. (Mike) Miller
  2020-11-14  4:37     ` André Bleau
@ 2020-11-15  4:46     ` Duncan Roe
  2020-11-15 13:12       ` William M. (Mike) Miller
  1 sibling, 1 reply; 21+ messages in thread
From: Duncan Roe @ 2020-11-15  4:46 UTC (permalink / raw)
  To: cygwin

On Fri, Nov 13, 2020 at 11:21:12PM -0500, cygwin wrote:
> On Fri, Nov 13, 2020 at 10:45 PM Duncan Roe <duncan_roe@optusnet.com.au>
> 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 <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.
> >
> > 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.m.miller@gmail.com

Sorry, should have mentioned running on Win7 Home.

When I try it on my wife's Win10 system, I get the dialog box same as you.

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-15  4:46     ` Duncan Roe
@ 2020-11-15 13:12       ` William M. (Mike) Miller
  2020-11-15 20:04         ` André Bleau
  0 siblings, 1 reply; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-15 13:12 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Sat, Nov 14, 2020 at 11:49 PM Duncan Roe <duncan_roe@optusnet.com.au>
wrote:

> On Fri, Nov 13, 2020 at 11:21:12PM -0500, cygwin wrote:
> > On Fri, Nov 13, 2020 at 10:45 PM Duncan Roe <duncan_roe@optusnet.com.au>
> > 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 <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.
> > >
> > > 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.)
>
> Sorry, should have mentioned running on Win7 Home.
>
> When I try it on my wife's Win10 system, I get the dialog box same as you.
>

That's disappointing. Thanks for the additional information, though.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  2020-11-15 13:12       ` William M. (Mike) Miller
@ 2020-11-15 20:04         ` André Bleau
  2020-11-15 20:39           ` André Bleau
  0 siblings, 1 reply; 21+ messages in thread
From: André Bleau @ 2020-11-15 20:04 UTC (permalink / raw)
  To: The Cygwin Mailing List

---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de William M. (Mike) Miller via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 08:12
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
On Sat, Nov 14, 2020 at 11:49 PM Duncan Roe <duncan_roe@optusnet.com.au>
wrote:

...

>
> Sorry, should have mentioned running on Win7 Home.
>
> When I try it on my wife's Win10 system, I get the dialog box same as you.
>

That's disappointing. Thanks for the additional information, though.
---------------------------------------------------------------------------------------

I would say we got some useful info:
1- The bug is OS specific; it occurs in Windows 10
2- Three persons were able to reproduce it on Windows 10, which improves the probability of getting fixed.

- André Bleau

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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
  0 siblings, 2 replies; 21+ messages in thread
From: André Bleau @ 2020-11-15 20:39 UTC (permalink / raw)
  To: The Cygwin Mailing List

---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de André Bleau via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 15:04
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de William M. (Mike) Miller via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 08:12
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
On Sat, Nov 14, 2020 at 11:49 PM Duncan Roe <duncan_roe@optusnet.com.au>
wrote:

...

>
> Sorry, should have mentioned running on Win7 Home.
>
> When I try it on my wife's Win10 system, I get the dialog box same as you.
>

That's disappointing. Thanks for the additional information, though.
---------------------------------------------------------------------------------------

I would say we got some useful info:
1- The bug is OS specific; it occurs in Windows 10
2- Three persons were able to reproduce it on Windows 10, which improves the probability of getting fixed.

- André Bleau
---------------------------------------------------------------------------------------

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.

- André Bleau

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box
  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
  1 sibling, 0 replies; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-15 20:59 UTC (permalink / raw)
  To: André Bleau; +Cc: The Cygwin Mailing List

On Sun, Nov 15, 2020 at 3:39 PM André Bleau via Cygwin <cygwin@cygwin.com>
wrote:

>
> On Sat, Nov 14, 2020 at 11:49 PM Duncan Roe <duncan_roe@optusnet.com.au>
> wrote:
>
> ...
>
> >
> > Sorry, should have mentioned running on Win7 Home.
> >
> > When I try it on my wife's Win10 system, I get the dialog box same as
> you.
> >
>
> That's disappointing. Thanks for the additional information, though.
>
> ---------------------------------------------------------------------------------------
>
> I would say we got some useful info:
> 1- The bug is OS specific; it occurs in Windows 10
> 2- Three persons were able to reproduce it on Windows 10, which improves
> the probability of getting fixed.
>
> - André Bleau
>
> ---------------------------------------------------------------------------------------
>
> 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.
>

That seems like useful information. However, my experience is a bit
different; I get the popup regardless of whether the CYGWIN environment
variable is empty or disable_pcon. However, I do see the same behavior as
you with regard to mintty versus a command shell window, so I think that
would argue in favor of mintty being responsible for popping up the dialog.

Thanks for the information!

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  2020-11-15 20:39           ` André Bleau
  2020-11-15 20:59             ` William M. (Mike) Miller
@ 2020-11-19 14:21             ` André Bleau
  2020-11-19 18:30               ` Thomas Wolff
  1 sibling, 1 reply; 21+ messages in thread
From: André Bleau @ 2020-11-19 14:21 UTC (permalink / raw)
  To: The Cygwin Mailing List

---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de André Bleau via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 15:39
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de André Bleau via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 15:04
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
---------------------------------------------------------------------------------------
De : Cygwin <cygwin-bounces@cygwin.com> de la part de William M. (Mike) Miller via Cygwin <cygwin@cygwin.com>
Envoyé : 15 novembre 2020 08:12
À : The Cygwin Mailing List <cygwin@cygwin.com>
Objet : Re: Failed assertion dialog box 
 
On Sat, Nov 14, 2020 at 11:49 PM Duncan Roe <duncan_roe@optusnet.com.au>
wrote:

...

>
> Sorry, should have mentioned running on Win7 Home.
>
> When I try it on my wife's Win10 system, I get the dialog box same as you.
>

That's disappointing. Thanks for the additional information, though.
---------------------------------------------------------------------------------------

I would say we got some useful info:
1- The bug is OS specific; it occurs in Windows 10
2- Three persons were able to reproduce it on Windows 10, which improves the probability of getting fixed.

- André Bleau
---------------------------------------------------------------------------------------

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.

- André Bleau
- André Bleau

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  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
  2020-11-20  0:06                 ` Duncan Roe
  0 siblings, 2 replies; 21+ messages in thread
From: Thomas Wolff @ 2020-11-19 18:30 UTC (permalink / raw)
  To: cygwin


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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  2020-11-19 18:30               ` Thomas Wolff
@ 2020-11-19 21:53                 ` André Bleau
  2020-11-20  0:06                 ` Duncan Roe
  1 sibling, 0 replies; 21+ messages in thread
From: André Bleau @ 2020-11-19 21:53 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  2020-11-19 18:30               ` Thomas Wolff
  2020-11-19 21:53                 ` André Bleau
@ 2020-11-20  0:06                 ` Duncan Roe
  2020-11-20  0:19                   ` Takashi Yano
  1 sibling, 1 reply; 21+ messages in thread
From: Duncan Roe @ 2020-11-20  0:06 UTC (permalink / raw)
  To: Thomas Wolff; +Cc: cygwin

On Thu, Nov 19, 2020 at 07:30:20PM +0100, Thomas Wolff wrote:
>
> It does not seem to happen in xterm which is weird.

It happens in an xterm for me.
xterm is /dev/pty1 and mintty is /dev/pty0. They both do it.
So I think it has to be pseudo-console.
(xterm has DISPLAY set to a Linux system but that shouldn't matter should it?)

> 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

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  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
  0 siblings, 2 replies; 21+ messages in thread
From: Takashi Yano @ 2020-11-20  0:19 UTC (permalink / raw)
  To: cygwin

Hi all,

On Fri, 20 Nov 2020 11:06:58 +1100
Duncan Roe wrote:
> On Thu, Nov 19, 2020 at 07:30:20PM +0100, Thomas Wolff wrote:
> >
> > It does not seem to happen in xterm which is weird.
> 
> It happens in an xterm for me.
> xterm is /dev/pty1 and mintty is /dev/pty0. They both do it.
> So I think it has to be pseudo-console.
> (xterm has DISPLAY set to a Linux system but that shouldn't matter should it?)

Could you please try latest cygwin snapshot?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  2020-11-20  0:19                   ` Takashi Yano
@ 2020-11-20  1:40                     ` Duncan Roe
  2020-11-20  2:04                     ` Duncan Roe
  1 sibling, 0 replies; 21+ messages in thread
From: Duncan Roe @ 2020-11-20  1:40 UTC (permalink / raw)
  To: cygwin

On Fri, Nov 20, 2020 at 09:19:29AM +0900, cygwin wrote:
> Hi all,
>
> On Fri, 20 Nov 2020 11:06:58 +1100
> Duncan Roe wrote:
> > On Thu, Nov 19, 2020 at 07:30:20PM +0100, Thomas Wolff wrote:
> > >
> > > It does not seem to happen in xterm which is weird.
> >
> > It happens in an xterm for me.
> > xterm is /dev/pty1 and mintty is /dev/pty0. They both do it.
> > So I think it has to be pseudo-console.
> > (xterm has DISPLAY set to a Linux system but that shouldn't matter should it?)
>
> Could you please try latest cygwin snapshot?
>
> --
> Takashi Yano <takashi.yano@nifty.ne.jp>

Never done that before. How do I get it?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  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
  1 sibling, 1 reply; 21+ messages in thread
From: Duncan Roe @ 2020-11-20  2:04 UTC (permalink / raw)
  To: Takashi Yano; +Cc: cygwin

On Fri, Nov 20, 2020 at 09:19:29AM +0900, cygwin wrote:
> Hi all,
>
> On Fri, 20 Nov 2020 11:06:58 +1100
> Duncan Roe wrote:
> > On Thu, Nov 19, 2020 at 07:30:20PM +0100, Thomas Wolff wrote:
> > >
> > > It does not seem to happen in xterm which is weird.
> >
> > It happens in an xterm for me.
> > xterm is /dev/pty1 and mintty is /dev/pty0. They both do it.
> > So I think it has to be pseudo-console.
> > (xterm has DISPLAY set to a Linux system but that shouldn't matter should it?)
>
> Could you please try latest cygwin snapshot?
>
> --
> Takashi Yano <takashi.yano@nifty.ne.jp>
Tried 20200909 - no popup

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Failed assertion dialog box ATTN: Takashi Yano
  2020-11-20  2:04                     ` Duncan Roe
@ 2020-11-20  7:09                       ` Thomas Wolff
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Wolff @ 2020-11-20  7:09 UTC (permalink / raw)
  To: cygwin

Am 20.11.2020 um 03:04 schrieb Duncan Roe:
> On Fri, Nov 20, 2020 at 09:19:29AM +0900, cygwin wrote:
>> Hi all,
>>
>> On Fri, 20 Nov 2020 11:06:58 +1100
>> Duncan Roe wrote:
>>> On Thu, Nov 19, 2020 at 07:30:20PM +0100, Thomas Wolff wrote:
>>>> It does not seem to happen in xterm which is weird.
>>> It happens in an xterm for me.
>>> xterm is /dev/pty1 and mintty is /dev/pty0. They both do it.
>>> So I think it has to be pseudo-console.
>>> (xterm has DISPLAY set to a Linux system but that shouldn't matter should it?)
>> Could you please try latest cygwin snapshot?
>>
>> --
>> Takashi Yano <takashi.yano@nifty.ne.jp>
> Tried 20200909 - no popup
Still interesting, though, is this observation:
the message text in the popup is different from the text if it appears 
in the terminal, suggesting that cygwin function __assert_func (from 
winsup/cygwin/assert.cc) is somehow injected into the gcc runtime in the 
popup cases only, which raises the technical questions how it could be 
injected at all and why only in some cases.
Thomas

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-11-20  7:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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