久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何追查“雙重免費或腐敗"錯誤

How to track down a quot;double free or corruptionquot; error(如何追查“雙重免費或腐敗錯誤)
本文介紹了如何追查“雙重免費或腐敗"錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

當我運行我的 (C++) 程序時,它會因為這個錯誤而崩潰.

When I run my (C++) program it crashes with this error.

* glibc 檢測到 * ./load: double free or corruption (!prev):0x0000000000c6ed50 ***

* glibc detected * ./load: double free or corruption (!prev): 0x0000000000c6ed50 ***

如何追蹤錯誤?

我嘗試使用打印 (std::cout) 語句,但沒有成功.gdb 能讓這更容易嗎?

I tried using print (std::cout) statements, without success. Could gdb make this easier?

推薦答案

如果你使用 glibc,你可以將 MALLOC_CHECK_ 環境變量設置為 2,這將導致 glibc 使用 malloc 的容錯版本,這將導致您的程序在雙釋放完成時中止.

If you're using glibc, you can set the MALLOC_CHECK_ environment variable to 2, this will cause glibc to use an error tolerant version of malloc, which will cause your program to abort at the point where the double free is done.

您可以在運行程序之前使用 set environment MALLOC_CHECK_2 命令從 gdb 設置它;程序應該中止,free() 調用在回溯中可見.

You can set this from gdb by using the set environment MALLOC_CHECK_ 2 command before running your program; the program should abort, with the free() call visible in the backtrace.

請參閱 malloc() 的手冊頁,了解更多信息

see the man page for malloc() for more information

這篇關于如何追查“雙重免費或腐敗"錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Algorithm to convert RGB to HSV and HSV to RGB in range 0-255 for both(將 RGB 轉換為 HSV 并將 HSV 轉換為 RGB 的算法,范圍為 0-255)
How to convert an enum type variable to a string?(如何將枚舉類型變量轉換為字符串?)
When to use inline function and when not to use it?(什么時候使用內聯函數,什么時候不使用?)
Examples of good gotos in C or C++(C 或 C++ 中好的 goto 示例)
Significance of ios_base::sync_with_stdio(false); cin.tie(NULL);(ios_base::sync_with_stdio(false) 的意義;cin.tie(NULL);)
Is TCHAR still relevant?(TCHAR 仍然相關嗎?)
主站蜘蛛池模板: 国产一区二区三区视频在线观看 | 久久久久黄色 | 国产精品区一区二区三 | av永久 | 久久久久久久一区 | 久久精品国产一区二区三区 | 久久精品男人的天堂 | 亚洲欧美精品国产一级在线 | 精品久久久久久久人人人人传媒 | 久久久网 | 国产高清久久 | av一二三四 | 在线观看av网站永久 | 久久一视频 | 国产av毛片| 国产精品久久国产愉拍 | 人人九九精 | av黄色在线 | 成人精品高清 | 一区二区免费 | 一级片免费视频 | 国产视频日韩 | 国产不卡视频 | 国产精品色av | а√中文在线8 | 在线免费国产 | 99精品久久久 | 青青激情网 | 久久久精品 | 成人精品鲁一区一区二区 | 国产精品视频免费看 | 国产亚洲精品a | 免费一级黄色 | 久久久久久久久中文字幕 | 一区观看 | 午夜一区二区三区在线观看 | 国产一区二区精品在线观看 | 欧美一级欧美三级在线观看 | 一区| 亚洲aⅴ精品 | 亚洲成人精品 |