Closed GoogleCodeExporter closed 9 years ago
Hi,
I believe you made wrong assumptions here: tcmalloc, as ptmalloc2 (glibc), does
not
provide a mechanism to trap on invalid memory access as some runtime
environments
provides (java/python for instance). Since it run as native code, it relies on
OS to
provide memory protection and since it is also a general purpose memory
allocator, it
does not provide extra runtime checks for such things.
If you having issues with your program related to invalid memory access, you
will
need to use memory access analyzers as valgring or asan to correct such issues.
Original comment by zatr...@gmail.com
on 2 May 2013 at 5:10
Thank you for your reply. And I am sorry, I fail to describe question.
I just want the allocator fail if user program try to access invalid memory,
such as access the freeed object.
Yestoday, I have use debugallocation in tcmalloc, which can detect
overflow/invalid memory access , but debugallocation is too slow and consume
much memory. I want to know, is there a method whose behavior is like
debugallocation and perform is not bad.
thanks again.
Original comment by shiqu...@gmail.com
on 4 May 2013 at 1:50
Usually memory analyzer imposes a memory and cpu overhead on observed programs
and
debugallocation is not different. You might try to profile the debugallocation
to
check if it is possible to came up with a performance optimization on the code
or
try to use alternatives, like valgrind or asan.
Original comment by zatr...@gmail.com
on 9 May 2013 at 12:58
thank you, I have bulit a test program with debugallocation with reuse disable,
and it is useful to find memory overflow.
Original comment by shiqu...@gmail.com
on 16 May 2013 at 1:11
Original comment by alkondratenko
on 6 Jul 2013 at 10:56
Original issue reported on code.google.com by
shiqu...@gmail.com
on 27 Apr 2013 at 3:05