heapwolf / ldb

A C++ REPL / CLI for LevelDB
MIT License
201 stars 23 forks source link

Segfault on tab completion #42

Closed brainstorm closed 6 years ago

brainstorm commented 8 years ago

The REPL correctly lists a moderately sized leveldb test db:

$ du -hs .
76M     .

But it crashes when I'm about to tab-complete one of the keys:

 $ ldb -i .

> get a
       terminate called after throwing an instance of 'std::regex_error'
                                                                          what():  regex_error
                                                                                              Aborted

Those keys have a format such as:

abu/day/foobaruserid/2015-05-15
heapwolf commented 8 years ago

does it work on smaller a database? if so, that sounds weird, if it's a consistent problem it might be an easy fix :)

brainstorm commented 8 years ago

Yes, it seems to work... could it be that the /'s in the key (abu/day/foobaruserid/) clashes with the regexp engine? Yeah! I just tried this with an empty db:

testdb2$ ldb -i . -c

> put abu/day/boofarbab;foo
> get a
       terminate called after throwing an instance of 'std::regex_error'
                                                                          what():  regex_error
                                                                                              Aborted

But also when I start totally anew and put non-weird keys:

$ ldb -i . -c

> put abu
> get
     terminate called after throwing an instance of 'std::regex_error'
                                                                        what():  regex_error
                                                                                            Aborted

Bizarre...

brainstorm commented 8 years ago

Tried to enable -g on ldb, leveldb and the other deps but I cannot get the debugging symbols to work when examining the core with gdb:

Core was generated by `ldb -i . -c'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f8df8db0cc9 in ?? ()
(gdb) bt
#0  0x00007f8df8db0cc9 in ?? ()
#1  0x00007f8df8db40d8 in ?? ()
#2  0x0000000000000020 in ?? ()
#3  0x0000000000000000 in ?? ()

Any hints on how to get those?

heapwolf commented 8 years ago

wasn't able to reproduce, i also used the same keys. i'll leave it open until i get some free time to work on this project again.

heapwolf commented 6 years ago

Seems fixed in recent versions. If this is still a problem for you, please feel free to re-open.