The libsm library in the sendmail source distribution offers a way to provide memory leak detection and error checking that overlays the usual malloc (3), realloc (3), and free (3) C-language library routines. To disable extra checking, define SM_HEAP_CHECK as zero: APPENDDEF(`confENVDEF', `-DSM_HEAP_CHECK=0') If you choose to enable extra checking, it will not be turned on by default. Instead you will need to turn it on and off with special debugging command-line switches (we cover this soon). To enable extra checking, define SM_HEAP_CHECK as 1: APPENDDEF(`confENVDEF', `-DSM_HEAP_CHECK=1') Once extra checking has been included in your sendmail code, you can turn it on and off with debugging command-line switches. The category is sm_check_heap , and there are four meaningful levels: # /usr/sbin/sendmail -dsm_check_heap. level .. . The four meaningful values for level are shown in Table 3-12. Table 3-12. Debugging levels for memory validity checking
The -dsm_check_heap command-line switch is most useful when porting sendmail to a new machine. It can also be valuable when adding new functions to sendmail or to its companion programs. To see if this compile-time macro is defined with your sendmail binary, use the -d0.12 debugging command-line switch. |