Missing lib leads to SIGSEGV
Hi,
I've got Segmentation fault while performing scan in python client. The reason was that I had not installed pybloom lib on the machine where I was performing the scan, but I had some pybloom objects stored in the DB. I get that the code should fail but it should raise some resonable Exception. I had to find the problem with strace.
If I will have some spare time I will try to improve that. I think that the code below is responsible for that and should be wrapped somehow: https://github.com/aerospike/aerospike-client-python/blob/master/src/main/scan/foreach.c#L61
strace output:
setsockopt(23, SOL_TCP, TCP_NODELAY, [1], 4) = 0 connect(23, {sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("10.53.12.196")}, 16) = -1 EINPROGRESS (Operation now in progress) fcntl(23, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK) select(24, NULL, [23], NULL, {60, 0}) = 1 (out [23], left {59, 999987}) write(23, "\2\3\0\0\0\0\0G\26\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\0"..., 79) = 79 fcntl(23, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK) fcntl(23, F_SETFL, O_RDWR) = 0 read(23, "\2\3\0\0\0\20\0\21", 8) = 8 mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8aee33d000 fcntl(23, F_GETFL) = 0x2 (flags O_RDWR) read(23, "\26\0\0\0\0\0\0\0\0\f\va?\307\0\0\0\0\0\3\0\f\0\0\0\25\4u\360\373\312\5"..., 1048593) = 372088 read(23, "7\nI6\nsS'num_slices'\np18\nI14\nsS'n"..., 676505) = 547200 read(23, "l\16A\337A\252\0\0\0\5\0scan\0\0\0\20\1rcptdb3-send"..., 129305) = 129305 stat("/home/jelen/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/home/jelen/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/jelen/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/jelen/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/jelen/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib/python2.6/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib/python2.6/plat-linux2/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/plat-linux2/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/plat-linux2/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/plat-linux2/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/plat-linux2/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib/python2.6/lib-tk/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-tk/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-tk/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-tk/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-tk/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib/python2.6/lib-dynload/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-dynload/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-dynload/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-dynload/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/lib-dynload/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/local/lib/python2.6/dist-packages/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/local/lib/python2.6/dist-packages/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/python2.6/dist-packages/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/python2.6/dist-packages/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/python2.6/dist-packages/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib/python2.6/dist-packages/pybloom", 0x7fff860b8840) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/dist-packages/pybloom.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/dist-packages/pybloommodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/dist-packages/pybloom.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.6/dist-packages/pybloom.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Segmentation fault