Re: [Mingw-w64-public] How to backtrace a crash with gdb on Windows 7

2018-01-18 Thread sisyphus1



-Original Message- 
From: Hannes Domani via Mingw-w64-public

Sent: Thursday, January 18, 2018 10:11 PM
To: mingw-w64-public@lists.sourceforge.net
Cc: Hannes Domani
Subject: Re: [Mingw-w64-public] How to backtrace a crash with gdb on Windows 
7



(gdb) run
Starting program: C:\_64\comp\mpfr_bug\ggdb\mpfr-4.0.0\tests\tfprintf.exe
[New Thread 4680.0x160c]

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
repl-vsnprintf.c:358: GNU MP assertion failed: 0
[Inferior 1 (process 4680) exited with code 03]
(gdb) bt
No stack.


That's because it didn't crash, but an assertion failed.
This calls abort(), which then normally exits with exit code 3.

A crash looks in gdb like this:
Thread 1 received signal SIGSEGV, Segmentation fault.

To get a proper stacktrace for an assertion failure, just use "break 
abort"

before "run".


Aaah ... yes, that makes all the difference.
Thank you, Hannes.

Cheers,
Rob



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] How to backtrace a crash with gdb on Windows 7

2018-01-18 Thread Hannes Domani via Mingw-w64-public
> (gdb) run
> Starting program: C:\_64\comp\mpfr_bug\ggdb\mpfr-4.0.0\tests\tfprintf.exe
> [New Thread 4680.0x160c]
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> repl-vsnprintf.c:358: GNU MP assertion failed: 0
> [Inferior 1 (process 4680) exited with code 03]
> (gdb) bt
> No stack.

That's because it didn't crash, but an assertion failed.
This calls abort(), which then normally exits with exit code 3.

A crash looks in gdb like this:
Thread 1 received signal SIGSEGV, Segmentation fault.

To get a proper stacktrace for an assertion failure, just use "break abort"
before "run".


Regards
Hannes

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] How to backtrace a crash with gdb on Windows 7

2018-01-18 Thread sisyphus1

Hi,

In the msys2 shell, I'm building gmp (with specific configure args) and then 
mpfr.
But there are 3 crashing tests in the mpfr test suite for which I would like 
to obtain a backtrace - but so far, all I'm getting is "No stack".


In the hope that someone might be able to see how I can improve on this 
(non) result, here's exactly what I'm doing.


gmp-6.1.2 source and mpfr-4.0.0 source are in /c/scratch.

In /c/scratch/gmp-6.1.2 I run:
./configure disable-shared --enable-static --enable-assert CC="gcc -ggdb" && 
make && make check.


That works fine, the -ggdb is propagated throughout the build, even to the 
compiling of the gmp test executables (all of which pass).


Then, in /c/scratch/mpfr-4.0.0 I run:
./configure 
disable-shared --enable-static --with-gmp-build=/c/scratch/gmp-6.1.2 && make 
&& make check


Again, the -ggdb flag (which mpfr inherits from gmp) is propagated 
throughout the build, including the compiling of the mpfr test executables 
(all of which pass except for the 3 crashing test programs).


The first crashing test is tests/tfprintf.exe, so I 'cd' to the tests 
directory and run:


###
$ gdb tfprintf.exe
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 


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-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tfprintf.exe...done.
(gdb) run
Starting program: C:\_64\comp\mpfr_bug\ggdb\mpfr-4.0.0\tests\tfprintf.exe
[New Thread 4680.0x160c]

This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.
repl-vsnprintf.c:358: GNU MP assertion failed: 0
[Inferior 1 (process 4680) exited with code 03]
(gdb) bt
No stack.
(gdb) q
###

And it's the same for the other 2 crashing test scripts (tprintf.exe and 
tsprint.exe).


Is there something I can do here to obtain a useful backtrace ?

Cheers,
Rob


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public