Check for illegal read and write operation of memory

Source: Internet
Author: User

Valgrind or something like that.

Addresssanitizer

Besides Heap,stack, it can be.

Https://en.wikipedia.org/wiki/AddressSanitizer#Stack-buffer-overflow

http://developerblog.redhat.com/2014/12/02/address-and-thread-sanitizers-gcc/

Page Fence of Tcmalloc

Limitation is that the heap can only be checked for cross-read and write

Http://www.xuebuyuan.com/1466812.html

Http://gperftools.googlecode.com/files/gperftools-2.0.tar.gz

changed the code, a file that has the memory out of bounds check turned on. Modify the following:

Sed-i "S/envtobool (\" Tcmalloc_page_fence\ ", false)/envtobool (\" Tcmalloc_page_fence\ ", true)/g" src/ debugallocation.cc
It means:
Src/debugallocation.cc:101
Define_bool (Malloc_page_fence,
Envtobool ("Tcmalloc_page_fence", false),
"Enables putting of memory allocations at page boundaries"
"With a guard page following the allocation (to catch buffer"
"Overruns right when they happen).");
Will
Envtobool ("Tcmalloc_page_fence", false)
Changed it.
Envtobool ("Tcmalloc_page_fence", True)

CD gperftools-2.0 &&./configure--enable-frame-pointers && make

Check for illegal read and write operation of memory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.