[英]OSX how can I debug malloc errors when extending python with C++?
我通過創建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
。 誰能推薦我可以用來調試此內存泄漏的新方法?
升級到小牛可以解決此問題。 正確地,升級重新編寫了一些關鍵的/System
文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.