1

I am running with a simple python script which is giving

*** Error in `python': free(): invalid pointer: 0x00000000029b7420 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f23d6dc67e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f23d6dcf37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f23d6dd353c]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf8internal28DestroyDefaultRepeatedFieldsEv+0x1f)[0x7f23ae6e18af]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf23ShutdownProtobufLibraryEv+0x8b)[0x7f23ae6e0b3b]
/usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3(+0x233b9)[0x7f2398fc03b9]
/lib64/ld-linux-x86-64.so.2(+0x10de7)[0x7f23d7346de7]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7f23d6d88ff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7f23d6d89045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7f23d6d6f837]
python(_start+0x29)[0x4933e9]

My sample code is

import sys
sys.path.append('../../python')
import caffe
import io
from PIL import Image
import numpy as np
import math
import leveldb

video_list = 'images/test_list.txt'
f = open(video_list, 'r')
f_lines = f.readlines()
f.close()

linenum = 0
predict_right = 0;
db1 = leveldb.LevelDB('./rgb_test_rst')
db2 = leveldb.LevelDB('./depth_test_rst')
datum1 = caffe.proto.caffe_pb2.Datum()
datum2 = caffe.proto.caffe_pb2.Datum()
for idx, line in enumerate(f_lines):
  key_str = '%06d' %(linenum)
  value1 = db1.Get(key_str)
  value2 = db2.Get(key_str)
  datum1.ParseFromString(value1)
  datum2.ParseFromString(value2)

. . . Running with Ubuntu 16.04, Numpy 1.14.0. Python 2.7

Further, i have checked my all files are reads correctly from text file.

Sanjay
  • 107
  • 1
  • 4
  • 17
  • It's a `KeyError` - the issue is in this line `value1 = db1.Get(key_str)` looks like your `key_str` doesn't exist – usernamenotfound Feb 16 '18 at 05:44
  • @Usernamenotfound no, this about `C LIB`. Something wrong on `system C` and `required C` version. I don't think the system is up to date or an imported module is affecting the other(Never need to raise a pointer error). – dsgdfg Feb 16 '18 at 07:36
  • @dsgdfg i have checked my system and other library is up-to-date. – Sanjay Feb 16 '18 at 10:35
  • @Usernamenotfound i have cross verify with one image and i found that key_str for particular image is available in leveldb file – Sanjay Feb 16 '18 at 10:38
  • @Usernamenotfound i have slightly modified my code and now i am not receiving KeyError in value1 = db1.Get(key_str). Now i am only getting python': free(): invalid pointer – Sanjay Feb 16 '18 at 12:16
  • Seems like the Python interpreter itself has some problem, irrespective of whether the program exits with an error or normally. Do you get the same error when running a different script? Starting with your script, what's the most you can prune away while still getting the error? – tobias_k Feb 16 '18 at 12:32
  • NULL file ? Check file access rights and write the `DB` path fully(don't use relative paths.). – dsgdfg Feb 16 '18 at 13:30
  • 1
    @tobias_k There is no error when i run different script without import caffe but if i used import caffe in other script same error persist. So i guess error is coming from caffe python?? – Sanjay Feb 17 '18 at 12:16

0 Answers0