You're welcome. Still crashes, unfortunately. Just to consolidate all the info, 0.94.1 on OSX doesn't crash, and these files don't crash on Linux at all. (I copied the testnet blockchain to Linux, and it was fine.)
Try the unit tests in the gtest folder. Both test binaries should pass valgrind --tool=massif
Hmmm. I'm seeing a couple of odd things after running Valgrind a few times.
[ RUN ] BlockDir.HeadersFirst
--6464-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--6464-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
--6464-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
--6464-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 8 times)
[ OK ] BlockDir.HeadersFirst (21467 ms)
These messages pop up consistently at this point. These messages seem to be considered spurious by a lot of valgrind users. They apparently pop up quite a bit when running on OSX, which valgrind is slow to support. (In fact, AFAIK, they still haven't implemented full OSX 10.11 support.) I believe they sometimes come up when valgrind doesn't fully understand system calls. It's hard to say but it might be worth looking at this code anyway.
Failed to create map of file. Error Code: 22
Saw this once last night but can't reproduce it now for unknown reasons. I
think it happened during the Load3Blocks_ZCchain test but I can't remember. Anyway, I believe 22 = EINVAL on OSX. I've written a small patch that uses strerror() in the future. The patch might be why this only came up once. (See below.)
Anyway, for some reason, valgrind tripped up here and caused some Armory error code to be triggered (or maybe valgrind just caught the error?). This is actually code that
was put in place 6 months ago in order for Armory to compile properly after some other changes. Might be worth looking here too, even though I never see the message when running ArmoryDB.
[ RUN ] BlockUtilsBare.Load3Blocks_ZC_Plus3_TestLedgers
==6785==
==6785== Process terminating with default action of signal 10 (SIGBUS)
==6785== Non-existent physical address at address 0x1027D6000
==6785== at 0x101935DA0: _platform_memcmp (in /usr/lib/system/libsystem_platform.dylib)
==6785== by 0x100107213: BinaryDataRef::operator==(BinaryData const&) const (BinaryData.h:891)
==6785== by 0x1000F97DC: BinaryDataRef::operator!=(BinaryData const&) const (BinaryData.h:901)
==6785== by 0x1002E7C46: DatabaseBuilder::parseBlockFile(unsigned char const*, unsigned long, unsigned long, std::__1::function) (DatabaseBuilder.cpp:381)
==6785== by 0x1002E67BD: DatabaseBuilder::addBlocksToDB(BlockDataLoader&, unsigned short, unsigned long, std::__1::shared_ptr) (DatabaseBuilder.cpp:327)
==6785== by 0x1002E62EA: DatabaseBuilder::updateBlocksInDB(std::__1::function const&, bool, bool)::$_2::operator()(unsigned short, unsigned long, std::__1::shared_ptr, bool) const (DatabaseBuilder.cpp:217)
==6785== by 0x1002E4C06: DatabaseBuilder::updateBlocksInDB(std::__1::function const&, bool, bool) (DatabaseBuilder.cpp:257)
==6785== by 0x1002E8586: DatabaseBuilder::update() (DatabaseBuilder.cpp:473)
==6785== by 0x10013C241: BlockDataManager::readBlkFileUpdate(BlockDataManager::BlkFileUpdateCallbacks const&) (BlockUtils.cpp:1559)
==6785== by 0x1001F160D: BlockDataManagerThread::run()::$_4::operator()() const (BDM_mainthread.cpp:178)
==6785== by 0x1001F0EB2: BlockDataManagerThread::run() (BDM_mainthread.cpp:236)
==6785== by 0x1001F04AC: BlockDataManagerThread::thrun(void*) (BDM_mainthread.cpp:261)
--6785:0:schedule VG_(sema_down): read returned -4
==6785==
Killed: 9
Seeing this consistently after one successful run. The invalid address varies slightly but it's always around this particular value. Definitely not good.
[----------] 18 tests from BlockUtilsBare
[ RUN ] BlockUtilsBare.Load5Blocks
[ OK ] BlockUtilsBare.Load5Blocks (30152 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_DamagedBlkFile
[ OK ] BlockUtilsBare.Load5Blocks_DamagedBlkFile (6538 ms)
[ RUN ] BlockUtilsBare.Load4Blocks_Plus2
[ OK ] BlockUtilsBare.Load4Blocks_Plus2 (44924 ms)
[ RUN ] BlockUtilsBare.Load4Blocks_ReloadBDM_ZC_Plus2
[ OK ] BlockUtilsBare.Load4Blocks_ReloadBDM_ZC_Plus2 (82404 ms)
[ RUN ] BlockUtilsBare.Load3Blocks_ZC_Plus3_TestLedgers
[ OK ] BlockUtilsBare.Load3Blocks_ZC_Plus3_TestLedgers (89746 ms)
[ RUN ] BlockUtilsBare.Load3Blocks_ZCchain
[ OK ] BlockUtilsBare.Load3Blocks_ZCchain (11110 ms)
[ RUN ] BlockUtilsBare.Load3Blocks_RBF
[ OK ] BlockUtilsBare.Load3Blocks_RBF (497 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_FullReorg
[ OK ] BlockUtilsBare.Load5Blocks_FullReorg (3000 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_DoubleReorg
[ OK ] BlockUtilsBare.Load5Blocks_DoubleReorg (4670 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_ReloadBDM_Reorg
[ OK ] BlockUtilsBare.Load5Blocks_ReloadBDM_Reorg (19694 ms)
[ RUN ] BlockUtilsBare.CorruptedBlock
[ OK ] BlockUtilsBare.CorruptedBlock (8482 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_RescanOps
[ OK ] BlockUtilsBare.Load5Blocks_RescanOps (136481 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_RescanEmptyDB
[ OK ] BlockUtilsBare.Load5Blocks_RescanEmptyDB (22092 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_RebuildEmptyDB
[ OK ] BlockUtilsBare.Load5Blocks_RebuildEmptyDB (68415 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_SideScan
[ OK ] BlockUtilsBare.Load5Blocks_SideScan (39226 ms)
[ RUN ] BlockUtilsBare.Load5Blocks_GetUtxos
[ OK ] BlockUtilsBare.Load5Blocks_GetUtxos (55087 ms)
[ RUN ] BlockUtilsBare.Load4Blocks_ZC_GetUtxos
[ OK ] BlockUtilsBare.Load4Blocks_ZC_GetUtxos (43231 ms)
[ RUN ] BlockUtilsBare.LedgerSeDer
[ OK ] BlockUtilsBare.LedgerSeDer (20928 ms)
[----------] 18 tests from BlockUtilsBare (686681 ms total)
When the tests do succeed under valgrind, the BlockUtilsBare tests take forever. On their own, they don't take too long.