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.

segmentation fault

See original GitHub issue

Something went wrong when i delete the db pointer 😃 For me it is not a critical, because i never close the database without ending my program.

(fsPython) root@srv:/own/services/back/src/database/new# python
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rocksdb
>>> opt = rocksdb.Options()
>>> db = rocksdb.DB("/tmp/2323", rocksdb.Options(create_if_missing=True))
>>> db.close()
>>> del db
Segmentation fault
(fsPython) root@srv:/own/services/back/src/database/new# 

Maybe it is not good when i got this during exit:

(fsPython) root@srv:/own/services/back/src/database/new# python
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rocksdb
>>> opt = rocksdb.Options()
>>> db = rocksdb.DB("/tmp/2323", rocksdb.Options(create_if_missing=True))
>>> db.close()
>>> exit()
Segmentation fault
(fsPython) root@srv:/own/services/back/src/database/new# 

Linux srv 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux

Update

Debug: https://gist.github.com/iFA88/1e688ea42a2e58d0f8ca88f16657acfa

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
binh-vucommented, Sep 3, 2021

I have the same issue when I close and reopen the db again. If I use the db.close() function I get segmentation fault. If I only run del db; gc.collect() then I get “No Locks available” like @itboyljm.

UPDATE:

I found that @iFA88 created a fork (https://github.com/iFA88/python-rocksdb) that fixed this issue. I put it out here in case anyone encounter the same problem. Thanks @iFA88

1reaction
itboyljmcommented, Sep 3, 2020

thank you so much for your fast reply. I try your version and it does solve the double free problem. But I still will meet the problem–“No Locks available” if I open, close and reopen, close same db object. Have you ever met this problem when you try to open after close same db?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation fault - Wikipedia
Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to...
Read more >
c++ - What is a segmentation fault? - Stack Overflow
A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to...
Read more >
Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >
Core Dump (Segmentation fault) in C/C++ - GeeksforGeeks
Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.”.
Read more >
What Is a Segmentation Fault in Linux?
A segmentation fault, or segfault, is a memory error in which a program tries to access a memory address that does not exist...
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