XDEBUG

Support sanity checks Debug with confENVDEF

In past releases of sendmail, changes in file descriptors and other key variables have sometimes occurred for reasons that remain a mystery to this day. Small “sanity checks” have been included in the code to discover such anomalies, should they happen again. To exclude these checks, redefine XDEBUG to 0:

APPENDDEF(`confENVDEF', `-DXDEBUG=0')

Generally, however, XDEBUG should always remain enabled. It adds only a microscopic amount of overhead to sendmail and helps to certify sendmail’s rational behavior.

If sendmail’s notion of who it is (as defined by the $j defined macro, $j on page 830) gets trashed by losing all its dots, sendmail will log the following at LOG_ALERT if XDEBUG is defined, dump its state (SIGUSR1 on page 510), and abort(3):

daemon process $j lost dot; see syslog

At startup, the value in the $j defined macro ($j on page 830) is added to the class w ($=w on page 876). If sendmail is compiled with XDEBUG, it periodically checks to make sure that $j is still listed in class w. If $j should vanish, sendmail will log the following at LOG_ALERT, dump its state (SIGUSR1 on page 510), and abort(3):

daemon process doesn't have $j in $=w; see syslog

With XDEBUG defined, sendmail periodically checks to see whether its standard I/O file descriptors have gotten clobbered. If so, it logs the following and tries to recover by connecting it to /dev/null:

where: fd which not open

Here, where will reflect the internal subroutine name and ...

Get sendmail, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.