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

invoke pure virtual function error #2

Closed
tanbro opened this issue Sep 19, 2011 · 2 comments
Closed

invoke pure virtual function error #2

tanbro opened this issue Sep 19, 2011 · 2 comments

Comments

@tanbro
Copy link

tanbro commented Sep 19, 2011

code:

!/usr/bin/env python

-- coding: utf-8 --

import datetime
import uuid
import leveldb

def main():
n=10000

print("%s: write %d items to db.."%(datetime.datetime.now(),n))

db = leveldb.LevelDB("./leveldb.db")
for i in range(n):
    db.Put(str(i), "this is item %d"%(i))

print("%s: lookup a item from map..."%(datetime.datetime.now()))
print(db.Get("43"))
print("%s: ok"%(datetime.datetime.now()))



return 0

if name == 'main':
main()

error when exit
#0 0x008aa410 in __kernel_vsyscall ()
#1 0x0099ddf0 in raise () from /lib/libc.so.6
#2 0x0099f701 in abort () from /lib/libc.so.6
#3 0x00275b10 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#4 0x00273515 in ?? () from /usr/lib/libstdc++.so.6
#5 0x00273552 in std::terminate() () from /usr/lib/libstdc++.so.6
#6 0x00273c75 in __cxa_pure_virtual () from /usr/lib/libstdc++.so.6
#7 0x0013c91f in leveldb::InternalKeyComparator::Compare(leveldb::Slice const&, leveldb::Slice const&) const ()

from /usr/local/lib/python2.7/site-packages/leveldb.so
#8 0x0014d779 in leveldb::(anonymous namespace)::MergingIterator::FindSmallest() () from /usr/local/lib/python2.7/site-packages/leveldb.so
#9 0x0014e05c in leveldb::(anonymous namespace)::MergingIterator::Next() () from /usr/local/lib/python2.7/site-packages/leveldb.so
#10 0x0013698e in leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) () from /usr/local/lib/python2.7/site-packages/leveldb.so
#11 0x00137241 in leveldb::DBImpl::BackgroundCompaction() () from /usr/local/lib/python2.7/site-packages/leveldb.so
#12 0x001377e8 in leveldb::DBImpl::BackgroundCall() () from /usr/local/lib/python2.7/site-packages/leveldb.so
#13 0x00153f92 in leveldb::(anonymous namespace)::PosixEnv::BGThreadWrapper(void*) () from /usr/local/lib/python2.7/site-packages/leveldb.so
#14 0x00af1832 in start_thread () from /lib/libpthread.so.0
#15 0x00a46e0e in clone () from /lib/libc.so.6

@forhappy
Copy link
Owner

Hello, thank you for testing at first!

But would you please provide a little more detailed information about your system environment(x86 or x64) and OS(ubuntu, centos,gentoo??), since the script you listed above could ran correctly on my computer, and here is the output:
$vim test-issue-1.py

#!/usr/bin/env python

-- coding: utf-8 --

import datetime
import uuid
import leveldb

def main():
n=10000
print("%s: write %d items to db.."%(datetime.datetime.now(),n))

db = leveldb.LevelDB("./leveldb.db")
for i in range(n):
    db.Put(str(i), "this is item %d"%(i))


print("%s: lookup a item from map..."%(datetime.datetime.now()))
print(db.Get("43"))
print("%s: ok"%(datetime.datetime.now()))

return 0

if name == 'main':
main()
Here are output, python exited normally:
$ python test-issue.py
2011-09-19 15:37:02.489891: write 10000 items to db..
2011-09-19 15:37:02.708287: lookup a item from map...
this is item 43
2011-09-19 15:37:02.708381: ok

And there was another guy met the same problem,here is the posts on google leveldb's offical issues site
(http://code.google.com/p/leveldb/issues/detail?id=40#c0)

So, I think this issues has to do with system configuration.

By the way, my platform and OS configuration:

OS: Ubuntu Linux forhappy 2.6.37.2utrace-generic #1 SMP Sat Mar 5 02:12:16 CST 2011 i686 GNU/Linux
CPU: Intel(R) Core(TM)2 Duo CPU
GCC: gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Python: Python 2.6.6

@tanbro
Copy link
Author

tanbro commented Sep 23, 2011

thanks!
my environment:
OS: Linux centosHost 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 EDT 2010 i686 i686 i386 GNU/Linux
gcc: 4.1.2 20080704 (Red Hat 4.1.2-48)
Python: 2.7.1
CPU: Intel(R) Xeon(R) CPU E5335 @ 2.00GHz(1 CPU, 4 cores)

@tanbro tanbro closed this as completed Sep 23, 2011
@tanbro tanbro reopened this Sep 23, 2011
@tanbro tanbro closed this as completed Oct 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants