当前位置:网站首页>C: Free (): thinking about invalid pointer abort (core dump)
C: Free (): thinking about invalid pointer abort (core dump)
2022-07-18 11:10:00 【Fog_ in】
Catalog
Some errors appear and their solutions
When running the program , Report errors ( Pictured ):

free(): invalid pointer Aborted
Use valgrind Screening errors
valgrind Use methods and their commands in another blog :http://t.csdn.cn/tAsfN
Read the following information :

Some errors appear and their solutions
Reference from http://t.csdn.cn/iQvuu
Use of uninitialised value of size 4
// Uninitialized address used , At this time, you should check whether the program uses uninitialized pointers
Address 0x0 is not stack’d, malloc’d or (recently) free’d
// The reason for this error is to write a value to the wrong address , At this time, we should also check that the program assigns values with uninitialized pointers , Or the pointer is not assigned . Conditional jump or move depends on uninitialised value(s)
// The reason for this error is that the variable used is not initialized Invalid free() / delete / delete[] / realloc()
// The reason for this error is free Lost the space that doesn't belong to you , The reason for the error may be that the memory pointed to by the pointer no longer belongs to it
HEAP SUMMARY:
in use at exit: 412 bytes in 1 blocks
total heap usage: 2 allocs, 1 frees, 924 bytes allocated
// The last one is heap memory analysis , As indicated above , When the program exits , There is still a 412 The space of bytes is not free
But my program doesn't use malloc Allocate memory , Then I'll go on to screen the cause of the error :
It may be a lack of libtcmalloc-minimal4 library
sudo apt-get install libtcmalloc-minimal4 // installvim ~/.bashrc // Modify the configuration fileexport LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4" // Add the library path to the configuration filesource ~/.bashrc // Execute configuration file
Look at the file path :ldconfig -p |grep libtcmalloc_minimal.so.4
边栏推荐
- Application of generator mode
- Buckle exercise - 19 find and minimum K pairs of numbers
- 4 * 4 * 4 Light Cube production and sharing
- Introduction to istio component mixer
- 如何测试移动端APP
- Chapter 3 business function development (import market activities, Apache POI)
- Lucas theorem
- 双线程猜数字
- 静态库和动态库
- Buckle practice - 15 rain
猜你喜欢
随机推荐
Deployment practice of skywalking test environment
生成器模式的应用
Chrome 插件开发
We overestimate the value of coding
Written at the end of the recruitment of Huazhong University of science and technology
微信小程序如何实现下拉刷新?
JVM 问题定位工具
数码管循环显示数字
C: free(): 无效指针中止(核心转储)的思考
Design of pattern water lamp based on 51 single chip microcomputer
MGRE and GRE comprehensive experiment
实验四 图像复原及几何校正
Buckle practice - 20 rain II
文件的上传与下载
Do you want to be an engineer or a product manager?
双线程猜数字
MGRE及GRE综合实验
Lombok introduction
wireshark 抓包调试(三路握手、四路断开)
基于Fitnesse的验收测试实验









