Bitcoind crashes when -datadir directory doesn't exist #1950

issue tucenaber opened this issue on October 23, 2012
  1. tucenaber commented at 1:00 PM on October 23, 2012: contributor

    Version 0.7.99 (#16eec89) on Linux

    $ ./bitcoind -datadir=/blabla getinfo Error: Specified directory does not exist Segmentation fault

    Edit to include gdb log;

    $ gdb --args ./bitcoind -datadir="/non-existent" getinfo GNU gdb (GDB) 7.4.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/tucenaber/src/git/bitcoin/src/bitcoind...done. (gdb) run Starting program: /home/tucenaber/src/git/bitcoin/src/bitcoind -datadir=/non-existent getinfo warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". Error: Specified directory does not exist

    Program received signal SIGSEGV, Segmentation fault. CCoinsViewCache::Flush (this=0x0) at main.cpp:246 246 bool fOk = base->BatchWrite(cacheCoins, pindexTip); (gdb) backtrace #0 CCoinsViewCache::Flush (this=0x0) at main.cpp:246 #1 0x0000000000446cf1 in Shutdown (parg=parg@entry=0x0) at init.cpp:81 #2 0x0000000000451006 in AppInit (argc=argc@entry=3, argv=argv@entry=0x7fffffffe8d8) at init.cpp:141 #3 0x000000000041bc1a in main (argc=3, argv=0x7fffffffe8d8) at init.cpp:192

  2. qubez commented at 1:35 PM on October 23, 2012: none

    Note: The command line for launching bitcoind should not have RPC commands such as getinfo included, those should be issued by a second instance of bitcoind to issue rpcconnect commands. e.g.: console 1: bitcoind -datadir=/home/foo/bar console 2 (after bitcoind has started): bitcoind getinfo

    Behavior with Bitcoin 0.7.0 PPA on Kubuntu 12.04 (with no extra "getinfo"; can't test with "getinfo" right now) and Bitcoin 0.7.1 on Win7 x64 (with or without extra "getinfo"): no crash, just the directory does not exist error.

  3. laanwj commented at 1:43 PM on October 23, 2012: member

    Fyi: Providing -datadir with rpc commands is fine if you have multiple instances of bitcoind running on different RPC ports and want your command to go to the right one.

  4. tucenaber commented at 1:52 PM on October 23, 2012: contributor

    About the RPC command: yes it's unnecessary for reproducing the bug, but I just happened to run it that way ;-)

  5. Diapolo commented at 10:47 AM on October 26, 2012: none

    @tucenaber Can you please try current master again, there was a fix merged related to the Shutdown() function.

  6. tucenaber commented at 3:11 PM on October 26, 2012: contributor

    It works as expected. Close it.

  7. sipa closed this on Oct 26, 2012

  8. KolbyML referenced this in commit ce702dabb8 on Dec 5, 2020
  9. KolbyML referenced this in commit 676f6a79bf on Dec 5, 2020
  10. 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-16 18:16 UTC

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