我通过创建一个c++包装器来扩展python,以建立用c++ 11编写的库。当我测试代码时,我收到以下错误:
python(46809,0x7fff728e7300) malloc: *** mach_vm_map(size=140735135109120) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
python(46809,0x7fff728e7300) malloc: *** error for object 0x7fff73bc4c70: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
我探查了这段代码,并确认这发生在预编译的外部库中。valgrind
的输出是无用的,-fsanitize=address
标志导致这个错误:Symbol not found: ___asan_option_detect_stack_use_after_return
。谁能给我推荐一些调试内存泄漏的新方法?
升级到Mavericks解决了这个问题。显然升级重写了一些关键的/System
文件。