This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to troubleshoot a crash under Cygwin at -O3?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 11 Aug 2015 19:03:12 -0400
- Subject: How to troubleshoot a crash under Cygwin at -O3?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
I'm experiencing a crash under Cygwin with -O3. The crash is reproducible:
Program received signal SIGSEGV, Segmentation fault.
DL_GroupParameters_IntegerBased::GetEncodedElementSize (this=0x11,
reversible=true) at gfpcrypt.h:55
55 unsigned int GetEncodedElementSize(bool reversible)
const {return GetModulus().ByteCount();}
Above, this = 0x11, and I believe its a private exponent (17). I'm
guessing its related to the vtable generated under Cygwin at -O3.
Note that there are no virtual methods. There is a base class that
provides an interface, and then derived classes provide the
implementation. In fact, there's a macro #define CRYPTOPP_NO_VTABLE
__declspec(novtable). (Also see
http://www.cryptopp.com/docs/ref/gfpcrypt_8h_source.html and
http://www.cryptopp.com/docs/ref/gfpcrypt_8cpp_source.html).
*If* I force -fPIC on the command line and endure 135 or so of these:
$ make
g++ -DNDEBUG -g -O3 -fPIC -march=native -pipe -c shacal2.cpp
shacal2.cpp:1:0: warning: -fPIC ignored for target (all code is
position independent)
// shacal2.cpp - by Kevin Springle, 2003
^
Then the program executes fine. But its a very messy compile, and its
probably not going to be worth forcing -fPIC because we will get too
much negative feedback.
How can I begin to troubleshoot the crash under Cygwin at -O3? (Or, if
anyone has seen this in the past, then cut to the chase: what is the
work around?).
*****
$ g++ --version
g++ (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
$ uname -a
CYGWIN_NT-6.1-WOW windows-7-x64 2.0.4(0.287/5/3) 2015-06-09 12:20 i686 Cygwin