BitcoinTalk

CryptoPP Assertion Error

BitcoinTalk
#1
From:
chaseadam
Subject:
CryptoPP Assertion Error
Date:
When running with revision 146 (trunk) I get the following when the miner attempts to start:

bitcoind: cryptopp/secblock.h:187: void CryptoPP::NullAllocator<T>::deallocate(void*, typename CryptoPP::AllocatorBase<T>::size_type) [with T = unsigned char]: Assertion `false' failed.

+ cd '/tmp/rmake/builds/bitcoin/bitcoin--trunk/'; CFLAGS="-O2 -g -D_FORTIFY_SOURCE=2 -fstack-protector" CXXFLAGS="-O2 -g -D_FORTIFY_SOURCE=2 -fstack-protector " CPPFLAGS="" CLASSPATH=""  LDFLAGS="-g -O1 " CC=gcc CXX=g++  make    
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/util.o util.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/script.o script.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/db.o db.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/net.o net.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/irc.o irc.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/main.o main.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/rpc.o rpc.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/init.o init.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -O3 -o cryptopp/obj/sha.o cryptopp/sha.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -O3 -o cryptopp/obj/cpu.o cryptopp/cpu.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/ui.o ui.cpp
ui.h: In constructor 'CGetTextFromUserDialog::CGetTextFromUserDialog(wxWindow*, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)':
ui.h:308: warning: converting to 'int' from 'double'
ui.h:309: warning: converting to 'int' from 'double'
ui.cpp: In constructor 'CMainFrame::CMainFrame(wxWindow*)':
ui.cpp:264: warning: passing 'double' for argument 1 to 'void wxWindowBase::SetSize(int, int)'
ui.cpp:264: warning: passing 'double' for argument 2 to 'void wxWindowBase::SetSize(int, int)'
ui.cpp:287: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:288: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:289: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:290: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:291: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:292: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:293: warning: passing 'double' for argument 4 to 'long int wxGenericListCtrl::InsertColumn(long int, const wxString&, int, int)'
ui.cpp:299: warning: converting to 'int' from 'double'
ui.cpp:300: warning: converting to 'int' from 'double'
ui.cpp: In member function 'virtual void CMainFrame::OnIconize(wxIconizeEvent&)':
ui.cpp:379: warning: 'Iconized' is deprecated (declared at /usr/include/wx-2.9/wx/event.h:1950)
ui.cpp:387: warning: 'Iconized' is deprecated (declared at /usr/include/wx-2.9/wx/event.h:1950)
ui.cpp: In constructor 'CSendingDialog::CSendingDialog(wxWindow*, const CAddress&, int64, const CWalletTx&)':
ui.cpp:2005: warning: passing 'double' for argument 1 to 'void wxWindowBase::SetSize(int, int)'
ui.cpp:2005: warning: passing 'double' for argument 2 to 'void wxWindowBase::SetSize(int, int)'
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -DGUI -o obj/uibase.o uibase.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -msse2 -O3 -march=amdfam10 -o obj/sha256.o sha256.cpp
g++ -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o bitcoin obj/util.o obj/script.o obj/db.o obj/net.o obj/irc.o obj/main.o obj/rpc.o obj/init.o cryptopp/obj/sha.o cryptopp/obj/cpu.o obj/ui.o obj/uibase.o obj/sha256.o -Wl,-Bstatic -l wx_gtk2ud-2.9 -Wl,-Bdynamic -l gtk-x11-2.0 -l SM -Wl,-Bstatic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx -l crypto -Wl,-Bdynamic -l gthread-2.0
+ strip bitcoin
+ copying /tmp/rmake/builds/bitcoin/bitcoin--trunk/bitcoin to /tmp/rmake/builds/bitcoin/_ROOT_/usr/bin/bitcoin
+ cd '/tmp/rmake/builds/bitcoin/bitcoin--trunk/'; CFLAGS="-O2 -g -D_FORTIFY_SOURCE=2 -fstack-protector" CXXFLAGS="-O2 -g -D_FORTIFY_SOURCE=2 -fstack-protector " CPPFLAGS="" CLASSPATH=""  LDFLAGS="-g -O1 " CC=gcc CXX=g++  make    bitcoind
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/util.o util.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/script.o script.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/db.o db.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/net.o net.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/irc.o irc.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/main.o main.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/rpc.o rpc.cpp
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o obj/nogui/init.o init.cpp
g++ -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -I"/usr/include/wx-2.9" -I"/usr/lib64/wx/include/gtk2-unicode-debug-static-2.9" -o bitcoind obj/nogui/util.o obj/nogui/script.o obj/nogui/db.o obj/nogui/net.o obj/nogui/irc.o obj/nogui/main.o obj/nogui/rpc.o obj/nogui/init.o cryptopp/obj/sha.o cryptopp/obj/cpu.o obj/sha256.o -Wl,-Bstatic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx -l crypto -Wl,-Bdynamic -l gthread-2.0
BitcoinTalk
#2
From:
denger
Subject:
Re: CryptoPP Assertion Error
Date:
I get a similar error with version 3.11 compile for CentOS 5.5:

bitcoind: cryptopp/secblock.h:187: void CryptoPP::NullAllocator<T>::deallocate(void*, typename CryptoPP::AllocatorBase<T>::size_type) [with T = unsigned char]: Assertion `false' failed.

I have tried wiping .bitcoin directory thinking some old stuff is incompatible, but get the same when starting fresh.
Anyone can help?
BitcoinTalk
#3
From:
denger
Subject:
Re: CryptoPP Assertion Error
Date:
Forgot to mention that I only see this error when trying to run bitcoind with sox proxy:

~/bitcoind -proxy=127.0.0.1:10000 -gen -server


My proxy is the ssh channel:

ssh -n -D localhost:10000 [email protected] "bash -c \"while true; do sleep 100; done\"" &
BitcoinTalk
#4
From:
satoshi
Subject:
Re: CryptoPP Assertion Error
Date:
You can probably just comment out the line
cryptopp/secblock.h:187
  //assert(false);

Let me know if it works, and watch if it memory leaks.

It looks like a template class to make sure the derived class defines its own version of allocate and deallocate.  It would be weird if that was the actual problem and it made it all the way to release.  Probably a false alarm.