This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67918] -fdevirtualize causes binary to crash with Segmentation Fault (CryptoPP involved)
- From: "11throwaway11 at outlook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 10 Oct 2015 20:52:50 +0000
- Subject: [Bug c++/67918] -fdevirtualize causes binary to crash with Segmentation Fault (CryptoPP involved)
- Auto-submitted: auto-generated
- References: <bug-67918-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67918
--- Comment #4 from Nameless <11throwaway11 at outlook dot com> ---
A little update.
I decided to check the piece of code that was causing "execution reached
__builtin_unreachable() call". So here's it:
virtual void ResizeBuffers()
{
m_register.New(m_cipher->BlockSize());
}
Here's the BlockSize:
inline unsigned int BlockSize() const {assert(m_register.size() > 0); return
(unsigned int)m_register.size();}
I thought: probably __builtin_unreachable() is what happens when the assert
gets called with 'false'.
So I changed ResizeBuffers() to:
virtual void ResizeBuffers()
{
printf("m_register: %p\nm_cipher: %p\n", &m_register, m_cipher); //
m_cipher is a pointer
m_register.New(m_cipher->BlockSize());
}
To check whether it does something with a NULL pointer.
And now's the weird part: it made the code work.
If I comment out printf(), it breaks again.
I've no idea what's going on.