';损坏的双链接列表';内存错误-ARM上的OpenCV Python 3.0.0和Numpy
我正在NVIDIA Jetson TK1开发板(基于ARM)上使用OpenCV 3.0.0-dev和Numpy 1.8.2。我从源代码处编译了OpenCV,并使用apt get安装了python numpy。我有Python 2.7.6 我遇到了内存损坏问题:';损坏的双链接列表';内存错误-ARM上的OpenCV Python 3.0.0和Numpy,python,c++,c,opencv,numpy,Python,C++,C,Opencv,Numpy,我正在NVIDIA Jetson TK1开发板(基于ARM)上使用OpenCV 3.0.0-dev和Numpy 1.8.2。我从源代码处编译了OpenCV,并使用apt get安装了python numpy。我有Python 2.7.6 我遇到了内存损坏问题: *** Error in `python': corrupted double-linked list: 0x008f2fb8 *** 这似乎不一致。有时它位于“cap.read()”,有时“np.zeros()”调用将触发它,或者有时
*** Error in `python': corrupted double-linked list: 0x008f2fb8 ***
这似乎不一致。有时它位于“cap.read()”,有时“np.zeros()”调用将触发它,或者有时可以通过将“solvePnP()”中的旋转和平移向量写入值为None的变量来复制它。例如:
如果rvec和tvec是solvePnP的输出:
var = None
var2 = None
var = rvec
var2 = tvec
有时会导致错误。偶尔,仅访问rvec和tvec就会导致这种情况
这在NumPy中似乎是个问题,因为np.zero可以生成它,而这与OpenCV无关
这是gdb对一个问题案例的追踪
*** Error in `/usr/bin/python': corrupted double-linked list: 0x008eb8c8 ***
Program received signal SIGABRT, Aborted.
__libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:44
44 ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory.
(gdb) bt
#0 __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:44
#1 0xb66e4f0e in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2 0xb66e7766 in __GI_abort () at abort.c:89
#3 0xb670bbf0 in __libc_message (do_abort=<optimized out>, fmt=0xb678d084 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#4 0xb671279e in malloc_printerr (action=1, str=0xb678d0c8 "corrupted double-linked list", ptr=<optimized out>) at malloc.c:4996
#5 0xb6713492 in _int_free (av=0xb67a24e8 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3996
#6 0x00063efe in list_dealloc.18562 (op=0xa7d21da0) at ../Objects/listobject.c:311
#7 0x0006458a in frame_dealloc.16591 (
f=Frame 0xa7c97208, for file sf.py, line 169, in track (frame_descrs=<numpy.ndarray at remote 0x8ee8c8>, target=<ARTarget(name='', url='', image=<numpy.ndarray at remote 0x732870>, keypoints=[<cv2.KeyPoint at remote 0xa7c95e08>, <cv2.KeyPoint at remote 0xa7c95e30>, <cv2.KeyPoint at remote 0xa7c95e58>, <cv2.KeyPoint at remote 0xa7c95e80>, <cv2.KeyPoint at remote 0xa7c95ea8>, <cv2.KeyPoint at remote 0xa7c95ed0>, <cv2.KeyPoint at remote 0xa7c95ef8>, <cv2.KeyPoint at remote 0xa7c95f20>, <cv2.KeyPoint at remote 0xa7c95f48>, <cv2.KeyPoint at remote 0xa7c95f70>, <cv2.KeyPoint at remote 0xa7c95f98>, <cv2.KeyPoint at remote 0xa7c95fc0>, <cv2.KeyPoint at remote 0xa7c9c020>, <cv2.KeyPoint at remote 0xa7c9c048>, <cv2.KeyPoint at remote 0xa7c9c070>, <cv2.KeyPoint at remote 0xa7c9c098>, <cv2.KeyPoint at remote 0xa7c9c0c0>, <cv2.KeyPoint at remote 0xa7c9c0e8>, <cv2.KeyPoint at remote 0xa7c9c110>, <cv2.KeyPoint at remote 0xa7c9c138>, <cv2.KeyPoint at remote 0xa7c9c160>, <cv2.KeyPoint at remote 0xa7c9c188>, <cv2.KeyPoint at rem...(truncated)) at ../Objects/frameobject.c:460
在我看来,当NumPy试图分配或释放内存时,似乎出现了问题。不过,系统并没有耗尽RAM
编辑:奇怪的是,此代码不会重现错误:
import numpy as np
while True:
dist_coef = np.zeros(4)
这是否表明程序中使用的一些Numpy变量/数组以某种方式破坏了其他变量/数组
任何想法都将不胜感激!谢谢。你应该检查一下你的内存。安装memtest86,重新启动,让它运行几个小时
大多数Linux发行版都有一个免费版本的软件包,但不清楚它是否在UEFI系统上运行良好,以防您使用专有版本。这听起来像是预构建的numpy二进制文件有问题-您是否尝试过从源代码处编译它?是的-我尝试过从源代码处构建numpy 1.8.2。发生了相同的错误。您在编译过程中看到错误了吗?它是否未通过任何单元测试(
import numpy as np;np.test()
)?否,编译期间没有错误。所有的单元测试都通过了。在这种情况下,你肯定应该在测试中提出一个问题。基于单元测试都通过这一事实,你的问题可能在一段时间内没有被numpy开发人员注意到。恐怕我对numpy的内部结构了解不够,无法提供更多的指导。
import numpy as np
while True:
dist_coef = np.zeros(4)