assert creates unusable core dump on current stable Cygwin release

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Wed Oct 9 15:31:00 GMT 2019


On 2019-10-09 01:14, Biswapriyo Nath wrote:
> * mintty version: mintty 3.0.6 (x86_64-pc-cygwin)
> * cygwin version: 3.1.0-0.6
> * code:
> 
> #include <assert.h>
> 
> int main() {
>   int x = 1;
>   assert(x == 0);
> }
> 
> * Expected result: The terminal should show this message which appers
> in latest stable cygwin version.
> assertion "x == 0" failed: file "test.c", line 6, function: main
> 
> * Actual result: terminal only shows "Aborted (core dumped)".

I also get the core dump, which is un-gdb-able below, as is it's core dump, on
*current stable* Cygwin 64 releases *AND* see the message!

$ gcc -g -Og -Wall -Wextra -o t t.c
$ ./t
assertion "x == 0" failed: file "t.c", line 5, function: main
*** starting debugger for pid 52441, tid 15616
*** continuing pid 52441 from debugger call (1)
Aborted (core dumped)
$ gdb ./t.exe ./t.exe.core
GNU gdb (GDB) (Cygwin 8.1.1-1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t.exe...done.

warning: core file may not match specified executable file.
[New Thread 0x3df4]
[New Thread 0x6850]
[New Thread 0x56dc]
[New Thread 0xf854]
[New Thread 0xd3cc]
[New Thread 0xbda8]

warning: Unexpected size of section `.reg/15860' in core file.
/wip/cygport-git/gdb/gdb-8.1.1-1.x86_64/src/gdb-8.1.1/gdb/corelow.c:548:
internal-error: void get_core_register_section(regcache*, const regset*, const
char*, int, int, const char*, int): Assertion `core_vec' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/wip/cygport-git/gdb/gdb-8.1.1-1.x86_64/src/gdb-8.1.1/gdb/corelow.c:548:
internal-error: void get_core_register_section(regcache*, const regset*, const
char*, int, int, const char*, int): Assertion `core_vec' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
$ gdb ./t
GNU gdb (GDB) (Cygwin 8.1.1-1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t...done.
(gdb) run
Starting program: /home/bwi/src/t
[New Thread 40060.0x1073c]
[New Thread 40060.0x2df0]
[New Thread 40060.0x49b4]
[New Thread 40060.0x12b8]
assertion "x == 0" failed: file "t.c", line 5, function: main

Thread 1 "t" received signal SIGABRT, Aborted.
0x00000000ffffe458 in ?? ()
(gdb) bt
#0  0x00000000ffffe458 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) q
A debugging session is active.

        Inferior 1 [process 40060] will be killed.

Quit anyway? (y or n) y
$ uname -srvmo
CYGWIN_NT-10.0 3.0.7(0.338/5/3) 2019-04-30 18:08 x86_64 Cygwin
$ head /proc/version
CYGWIN_NT-10.0-17763 version 3.0.7-338.x86_64 (corinna@calimero) (gcc version
7.4.0 20181206 (Fedora Cygwin 7.4.0-1) (GCC) ) 2019-04-30 18:08 UTC
$ gcc --version
gcc (GCC) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list