{"action":"created","issue":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/81","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/81/comments","events_url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/81/events","html_url":"https://github.com/libbitcoin/libbitcoin-server/issues/81","id":80812977,"number":81,"title":"Double-free on exit while running test suite","user":{"login":"swansontec","id":276214,"avatar_url":"https://avatars.githubusercontent.com/u/276214?v=3","gravatar_id":"","url":"https://api.github.com/users/swansontec","html_url":"https://github.com/swansontec","followers_url":"https://api.github.com/users/swansontec/followers","following_url":"https://api.github.com/users/swansontec/following{/other_user}","gists_url":"https://api.github.com/users/swansontec/gists{/gist_id}","starred_url":"https://api.github.com/users/swansontec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swansontec/subscriptions","organizations_url":"https://api.github.com/users/swansontec/orgs","repos_url":"https://api.github.com/users/swansontec/repos","events_url":"https://api.github.com/users/swansontec/events{/privacy}","received_events_url":"https://api.github.com/users/swansontec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-26T06:11:22Z","updated_at":"2015-05-26T23:05:55Z","closed_at":null,"body":"Running `make check` gives this:\r\n\r\n```\r\nmake[2]: Entering directory `/home/bitcoin/build-libbitcoin-server/libbitcoin-server'\r\n*** Error in `/home/bitcoin/build-libbitcoin-server/libbitcoin-server/test/.libs/lt-libbitcoin_server_test': double free or corruption (!prev): 0x0000000000a311c0 ***\r\nFAIL: libbitcoin_server_test_runner.sh\r\n```\r\n\r\nRunning under valgrind gives:\r\n\r\n```\r\n==13633== Memcheck, a memory error detector\r\n==13633== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.\r\n==13633== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info\r\n==13633== Command: ./lt-libbitcoin_server_test\r\n==13633== \r\n\r\n*** No errors detected\r\n==13633== Invalid read of size 4\r\n==13633==    at 0x596C64D: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)\r\n==13633==    by 0x59CB4DE: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib/x86_64-linux-g\r\nnu/libstdc++.so.6.0.19)\r\n==13633==    by 0x5E675E9: __cxa_finalize (cxa_finalize.c:56)\r\n==13633==    by 0x79D07B2: ??? (in /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.54.0)\r\n==13633==    by 0x4010739: _dl_fini (dl-fini.c:252)\r\n==13633==    by 0x5E67258: __run_exit_handlers (exit.c:82)\r\n==13633==    by 0x5E672A4: exit (exit.c:104)\r\n==13633==    by 0x5E4CECB: (below main) (libc-start.c:321)\r\n==13633==  Address 0xa983350 is 16 bytes inside a block of size 28 free'd\r\n==13633==    at 0x4C2C2BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==13633==    by 0x59CB4DE: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib/x86_64-linux-g\r\nnu/libstdc++.so.6.0.19)\r\n==13633==    by 0x5E675E9: __cxa_finalize (cxa_finalize.c:56)\r\n==13633==    by 0x6904C42: ??? (in /usr/local/lib/libboost_program_options.so.1.55.0)\r\n==13633==    by 0x4010739: _dl_fini (dl-fini.c:252)\r\n==13633==    by 0x5E67258: __run_exit_handlers (exit.c:82)\r\n==13633==    by 0x5E672A4: exit (exit.c:104)\r\n==13633==    by 0x5E4CECB: (below main) (libc-start.c:321)\r\n==13633== \r\n==13633== Invalid free() / delete / delete[] / realloc()\r\n==13633==    at 0x4C2C2BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==13633==    by 0x59CB4DE: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib/x86_64-linux-g\r\nnu/libstdc++.so.6.0.19)\r\n==13633==    by 0x5E675E9: __cxa_finalize (cxa_finalize.c:56)\r\n==13633==    by 0x79D07B2: ??? (in /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.54.0)\r\n==13633==    by 0x4010739: _dl_fini (dl-fini.c:252)\r\n==13633==    by 0x5E67258: __run_exit_handlers (exit.c:82)\r\n==13633==    by 0x5E672A4: exit (exit.c:104)\r\n==13633==    by 0x5E4CECB: (below main) (libc-start.c:321)\r\n==13633==  Address 0xa983340 is 0 bytes inside a block of size 28 free'd\r\n==13633==    at 0x4C2C2BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==13633==    by 0x59CB4DE: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib/x86_64-linux-g\r\nnu/libstdc++.so.6.0.19)\r\n==13633==    by 0x5E675E9: __cxa_finalize (cxa_finalize.c:56)\r\n==13633==    by 0x6904C42: ??? (in /usr/local/lib/libboost_program_options.so.1.55.0)\r\n==13633==    by 0x4010739: _dl_fini (dl-fini.c:252)\r\n==13633==    by 0x5E67258: __run_exit_handlers (exit.c:82)\r\n==13633==    by 0x5E672A4: exit (exit.c:104)\r\n==13633==    by 0x5E4CECB: (below main) (libc-start.c:321)\r\n==13633== \r\n==13633== \r\n==13633== HEAP SUMMARY:\r\n==13633==     in use at exit: 28 bytes in 1 blocks\r\n==13633==   total heap usage: 742 allocs, 742 frees, 128,988 bytes allocated\r\n==13633== \r\n==13633== LEAK SUMMARY:\r\n==13633==    definitely lost: 28 bytes in 1 blocks\r\n==13633==    indirectly lost: 0 bytes in 0 blocks\r\n==13633==      possibly lost: 0 bytes in 0 blocks\r\n==13633==    still reachable: 0 bytes in 0 blocks\r\n==13633==         suppressed: 0 bytes in 0 blocks\r\n==13633== Rerun with --leak-check=full to see details of leaked memory\r\n==13633== \r\n==13633== For counts of detected and suppressed errors, rerun with: -v\r\n==13633== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 0 from 0)\r\n```\r\n\r\nIt seems like everything runs cleanly (`*** No errors detected`), but something goes wrong during the shutdown procedure. This is a freshly-updated Ubuntu 14.04 box, and the libbitcoin-server is the latest version (`525e3950`), compiled like `sudo ./install.sh --build-boost --without-consensus`."},"comment":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/comments/105693267","html_url":"https://github.com/libbitcoin/libbitcoin-server/issues/81#issuecomment-105693267","issue_url":"https://api.github.com/repos/libbitcoin/libbitcoin-server/issues/81","id":105693267,"user":{"login":"swansontec","id":276214,"avatar_url":"https://avatars.githubusercontent.com/u/276214?v=3","gravatar_id":"","url":"https://api.github.com/users/swansontec","html_url":"https://github.com/swansontec","followers_url":"https://api.github.com/users/swansontec/followers","following_url":"https://api.github.com/users/swansontec/following{/other_user}","gists_url":"https://api.github.com/users/swansontec/gists{/gist_id}","starred_url":"https://api.github.com/users/swansontec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swansontec/subscriptions","organizations_url":"https://api.github.com/users/swansontec/orgs","repos_url":"https://api.github.com/users/swansontec/repos","events_url":"https://api.github.com/users/swansontec/events{/privacy}","received_events_url":"https://api.github.com/users/swansontec/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T23:05:55Z","updated_at":"2015-05-26T23:05:55Z","body":"It might be as simple as a warning like \"You are using `--build-boost`. Please consider specifying a `--prefix` for safety.\""}}