1
我通過創建一個C++包裝來建立C++編碼的庫來擴展python。當我測試的代碼,我收到以下錯誤:OSX如何在用C++擴展python時調試malloc錯誤?
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
。任何人都可以推薦我可以用來調試這種內存泄漏的新方法嗎?
我已更新我的評論,以反映我的包裝是C++,編譯的庫是C++ 11。感謝評論:) – kilojoules