Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detachdb - coredump backtrace #1472

Closed
grarpamp opened this issue Jun 16, 2012 · 4 comments
Closed

detachdb - coredump backtrace #1472

grarpamp opened this issue Jun 16, 2012 · 4 comments

Comments

@grarpamp
Copy link

Without detachdb and rm -r , breaks things and crashes.
database/ db.log .lock debug.log addr.dat wallet.dat __db.*

Bitcoin version v0.6.2.2-unk-beta ()
Default data directory /.../.bitcoin
Loading addresses...
dbenv.open LogDir=/.../.bitcoin/database ErrorFile=/.../.bitcoin/db.log


EXCEPTION: 11DbException
Db::open: Invalid argument
bitcoin in AppInit()
terminate called after throwing an instance of 'DbException'
what(): Db::open: Invalid argument
sh: abort (core dumped)

file unknown has LSN 38/7968116, past end of log at 1/28
Commonly caused by moving a database from one database environment
to another without clearing the database LSNs, or by removing all of
the log files from a database environment
__db_meta_setup: /.../.bitcoin/addr.dat: unexpected file type or format

[New Thread 28801140 (LWP 100964/initial thread)]
#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 0x0816d2ea in PrintException (pex=0x288251b0, pszThread=0x82f4cfa "AppInit()") at util.cpp:792
#8 0x08087625 in AppInit (argc=2, argv=0xbfbfedf0) at init.cpp:113
#9 0x0808766d in main (argc=Cannot access memory at address 0x3) at init.cpp:96

@gavinandresen
Copy link
Contributor

I don't understand -- what did you do to cause the crash?

@sipa
Copy link
Member

sipa commented Jun 16, 2012

He deleted database logfiles, without using -detachdb.

@grarpamp
Copy link
Author

I don't understand -- what did you do to cause the crash?
He deleted database logfiles, without using -detachdb.

github apparently snips stuff in carets. It should have said:
'rm -r '. Or more simply, nuke everything after
shutdown except: blkindex.dat and blk0001.dat
I used to do this under an old 0.5.x, ok semantics changed.
It's a crash issue.

@laanwj
Copy link
Member

laanwj commented Sep 21, 2012

This is the expected behavior when not using -detachdb. And in contrary to many cases, the error message is clear:

Commonly caused by moving a database from one database environment
to another without clearing the database LSNs, or by removing all of
the log files from a database environment

Use -detachdb when you plan to remove log files or move around the databases between machines.

@laanwj laanwj closed this as completed Sep 21, 2012
lateminer pushed a commit to lateminer/bitcoin that referenced this issue May 6, 2020
3e9081c [Tests] Fix tests duration and sorting in test_runner.py (random-zebra)
57dd5e7 [Tests][Refactor] Move connect_nodes_bi to p2p_time_offset (random-zebra)
9b36468 test: Replace connect_nodes_bi with connect_nodes (random-zebra)
c2a701e test: Use connect_nodes when connecting nodes in the test_framework (random-zebra)
5d3f2a1 test: Reformat python imports to aid scripted diff (random-zebra)

Pull request description:

  Mostly from upstream bitcoin#16898

  > By default all test nodes are connected in a chain. However, instead of just a single connection between each pair of nodes, we end up with up to four connections for a "middle" node (two outbound, two inbound, from each side).
  >
  > This is generally redundant (tx and block relay should succeed with just a single connection) and confusing. For example, test timeouts after a call to sync_ may be racy and hard to reproduce. On top of that, the test debug.logs are hard to read because txs and block invs may be relayed on the same connection multiple times.
  >
  > Fix this by inlining connect_nodes_bi in the two tests that need it, and then replace it with a single connect_nodes in all other tests.
  >
  > Historic background:
  >
  > connect_nodes_bi has been introduced as a (temporary?) workaround for bug bitcoin#5113 and bitcoin#5138, which has long been fixed in bitcoin#5157 and bitcoin#5662.

ACKs for top commit:
  furszy:
    Tested ACK 3e9081c .

Tree-SHA512: 4af3223c7e5a4b130855d9364b7ec3df5e141151fd1e108c55ef80dd523522780b6130e69cacd467906215c15da9a50496f12298246eb67876fcaa181463cae9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants