Diagnosing Memory Heap Corruption in glibc with MALLOC_CHECK_
This document (3113982) is provided subject to the disclaimer at the end of this document.
Setting MALLOC_CHECK_ :
- If MALLOC_CHECK_ is set to 0 (zero), the memory management functions are simply most tolerant of errors and do not give warnings.
- Maybe be useful if we are prevented from finding one memory bug by another that is not convenient to fix at the moment; it might allow us to use other tools to chase down the other memory bug.
- It may also be useful if you are running code that works on another system but not on Linux. It can provide a quick workaround that may allow the code to temporarily function, before you have the chance to resolve the error.
- If MALLOC_CHECK_ is set to 1 (one), the memory management functions print out warning messages on standard error when problems are noticed.
- It is useful if we are not aware of any problems and just want to be notified if any problem exist.
- If MALLOC_CHECK_ is set to 2 (two), the memory management functions call abort()when problems are noticed.
- This is most useful from inside the debugger or a shell starting an application or daemon. It allows a backtrace to be obtained as soon as the memory management functions discover an error, providing information closest to the point at which the error has happened.
- If a core is caused by a memory corruption, we have more information about memory allocations. This is better for troubleshooting and determining where/which application overwrote a memory address.
- Settings 1 and 2 can be combined by setting MALLOC_CHECK_ to 3 (three).
This will enable the print out of warning messages on standard error (1), and will call abort() when problems are noticed (2).
- Add the following to the /opt/novell/eDirectory/sbin/pre_ndsd_start file:
Note: the pre_ndsd_start script/file is usually empty. If there are other lines in the file, this should go first.
- Restart ndsd (/etc/init.d/ndsd restart) to activate.
You must add all the environment variables required for eDirectory service in the env file located in the /etc/opt/novell/eDirectory/conf directory due to systemd requirements.
- Add MALLOC_CHECK_=3 to NAMCD script (/etc/init.d/namcd):
The script will then look similar to:
# Template configuration variables
- Restart NAMCD (/etc/init.d/namcd restart) to activate
- improved readability of the last part of situation.
- updated additional info section to improve readability and consistency of potential performance impact.
- changed from MALLOC_CHECK_=2 to MALLOC_CHECK_=3 per conversation with Darren McGary.
- updated resolution section to enhance readability and understanding.
This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3113982
- Creation Date:11-MAR-08
- Modified Date:27-DEC-17
- NovellOpen Enterprise Server
- SUSESUSE Linux Enterprise Server
Did this document solve your problem? Provide Feedback