Boost exceptions in ReadConfigFile() not caught #1505

issue grarpamp opened this issue on June 22, 2012
  1. grarpamp commented at 8:51 PM on June 22, 2012: none

    Specifying syntax in bitcoin.conf or cmdline on 0.6.x...

    ok

    upgradewallet= upgradewallet=<0..100k...>

    crash

    upgradewallet


    EXCEPTION: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options14invalid_syntaxEEEEE unrecognized line in 'upgradewallet' bitcoin in AppInit()

    terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost ::program_options::invalid_syntax> >' what(): unrecognized line in 'upgradewallet'

    New Thread 28801140 (LWP 100948/initial thread) bt #0 0x2873e9a7 in kill () from /lib/libc.so.7 #1 0x2852d397 in raise () from /lib/libthr.so.3 #2 0x2873d4da in abort () from /lib/libc.so.7 #3 0x285a0880 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #4 0x285a508a in std::set_unexpected () from /usr/lib/libstdc++.so.6 #5 0x285a50d2 in std::terminate () from /usr/lib/libstdc++.so.6 #6 0x285a4f58 in __cxa_rethrow () from /usr/lib/libstdc++.so.6 #7 0x0816ceda in PrintException (pex=0x288590d0, pszThread=0x82f4f1a "AppInit()") at util.cpp:795 #8 0x08088695 in AppInit (argc=2, argv=0xbfbfedd8) at init.cpp:127 #9 0x080886dd in main (argc=Cannot access memory at address 0x3) at init.cpp:110

  2. grarpamp commented at 8:53 PM on June 22, 2012: none

    with carets this time?

    upgradewallet=<0..100k+>

    terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::program_options::invalid_syntax >'

  3. Diapolo commented at 11:49 PM on June 22, 2012: none

    Seems the argument parsing routine doesn't like what you fed to it IMHO.

  4. grarpamp commented at 11:54 PM on June 22, 2012: none

    Seems the argument parsing routine doesn't like what you fed to it IMHO.

    Obviously. Though it should not crash, crashing is poor form.

  5. Diapolo commented at 11:58 PM on June 22, 2012: none

    Indeed ... makes me wonder, if only upgradewallet makes the client crash or also other stuff. This needs to be looked into.

    I tried to reproduce with a build based on current master using bitcoin-qt.exe -upgradewallet -> no crash and bitcoin-qt.exe -upgradewallet=FOO -> no crash. Does it crash for you on bitcoind or bitcoin-qt?

  6. grarpamp commented at 1:09 AM on July 2, 2012: none

    Tracking stable 0.6.x at that time, not master. And bitcoind on FreeBSD, not qt. There are three ways to say upgradewallet... Nothing after the 't', only '=' after, and '=n' after. n could perhaps be numeric, alpha, printable, etc. Placing the exact string 'upgradewallet' in the conf crashed for sure. Others may have, I don't recall.

  7. TheBlueMatt commented at 12:49 PM on July 2, 2012: member

    I cant reproduce on current master, does it depend on having a wallet of a specific version, or could it be a stable-only issue?

  8. grarpamp commented at 12:15 AM on July 4, 2012: none

    v0.6.3, new wallet on current blockchain, 'upgradewallet' in bitcoin.conf, coredump. freebsd 8.x boost149 db4830. that's all i know.

    EXCEPTION: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options14invalid_syntaxEEEEE bitcoin in AppInit() terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::program_options::invalid_syntax

    ' what(): unrecognized line in 'upgradewallet'

    [New Thread 28801140 (LWP 100943/initial thread)] #0 0x2874b9a7 in kill () from /lib/libc.so.7 #1 0x2853a397 in raise () from /lib/libthr.so.3 #2 0x2874a4da in abort () from /lib/libc.so.7 #3 0x285ad880 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #4 0x285b208a in std::set_unexpected () from /usr/lib/libstdc++.so.6 #5 0x285b20d2 in std::terminate () from /usr/lib/libstdc++.so.6 #6 0x285b1f58 in __cxa_rethrow () from /usr/lib/libstdc++.so.6 #7 0x0817739a in PrintException (pex=0x288590d0, pszThread=0x82ff75a "AppInit()") at util.cpp:801 #8 0x0808b1f5 in AppInit (argc=2, argv=0xbfbfedd8) at init.cpp:127 #9 0x0808b23d in main (argc=Cannot access memory at address 0x3) at init.cpp:110

  9. gavinandresen commented at 7:14 PM on July 5, 2012: contributor

    The real problem is we're digging down into boost internals to parse the config file (the documented, supported config-file-parsing API doesn't do exactly what we need).

    Easiest fix will be to catch the exception and Do the Right Thing.

  10. Diapolo commented at 10:48 AM on January 27, 2014: none

    Can't reproduce this on current master, perhaps fixed by a more recent Boost version and changes to parsing.

  11. laanwj commented at 10:57 AM on January 27, 2014: member

    Thanks for testing @diapolo, closing this

  12. laanwj closed this on Jan 27, 2014

  13. suprnurd referenced this in commit ac6c3c9008 on Dec 5, 2017
  14. lateminer referenced this in commit 941fbf39b6 on Jan 22, 2019
  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me