question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hard crash on DB.close()

See original GitHub issue

I experience a hard crash when closing a DB.

I have experimented with a number of diverse settings. No matter the load or the contents of the database it always seems to happen.

This is the case both in master with Python 3 and in Python 2 with the fix from #40. I also tested with both librocksdb-dev 5.17 (from Debian stretch-backports) and the facebook/rocksdb master (>6.1.2).

At one point I got a detailed stack trace and memory map but I can’t seem to recover them. I will edit this post if I can produce them later on. I do know that the error was “double free or corruption”.

Closing a DB is a critical feature for my use case. I need to be able to reliably populate DBs in subprocesses and transfer the control to the master process afterwards. This is not possible unless the database is properly closed before the transfer. I have tried the del db; gc.collect() strategy from #10 and the unit tests, but, as expected, del is not deterministic and the file lock is not freed in most cases. In any case, if del run it would likely also crash in the close() method.

I believe #46 might be experiencing the same issue.

Please, let me know if this is the case for everyone or if it is an environment issue.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
binh-vucommented, Sep 3, 2021

@maxibor I found that @iFA88 created a fork (https://github.com/iFA88/python-rocksdb) that fixed this issue. Original thread: #46. I repost it here to increase visibility.

1reaction
maxiborcommented, Feb 10, 2021

Any update on this @twmht @oersted ? Being able to close the database would be lovely 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Will database file of SQLite3 be damaged when suddenly ...
If there occurs an unexpected error such as computer's suddenly power-off or OS crash, will the mode of the database file be damaged,...
Read more >
Crash when db.close() - Mobile - Couchbase Forums
My app calls db.close() and the crash comes quickly after that. I'm looking for any advice on what's going on.
Read more >
B.3.3.3 What to Do If MySQL Keeps Crashing
Many unexpected server exits are caused by corrupted data files or index files. MySQL updates the files on disk with the write() system...
Read more >
How to troubleshoot kernel crashes, hangs, or reboots with ...
Issue. How do I configure kexec/kdump on RHEL systems? Root Cause Analysis (RCA) of kernel panic / server crash is required ...
Read more >
How To Corrupt An SQLite Database File
If an application crash, or an operating-system crash, or even a ... But the close() system call caused the locks held on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found