Sam Trenholme's webpage
Support this website

Deadwood update


July 21 2012

Deadwood update

I have updated the patch resolving the problem Deadwood had with last month so that, should a similar issue pop up in the future, Deadwood logs messages (starting at log level 100) describing the issue. In addition, in light of Rich Felker's concerns a couple of months ago with MaraDNS' handling of malloc() I have replaced all calls to "malloc()" in the code with "dw_malloc()", which is simply a macro that is replaced with "malloc()".

Doing this would make it easier for one to replace malloc() in Deadwood with something that more gracefully handles malloc() failures, such as blocking Deadwood until malloc() succeeds again, or by having malloc() failures terminate Deadwood and wrapping Deadwood in a script that restarts it when terminated. Since I am in debug, not develop mode, I have no plans to implement this kind of code myself. Deadwood was written for Linux and Windows; Linux does not, by default, have malloc() fail; it simply terminates processes that use too much memory.

For the record: MaraDNS terminates upon a malloc() failure. Deadwood's behavior is undefined should malloc() fail. If anyone is using MaraDNS in an environment where a kernel allows malloc() to return a NULL pointer, it is best to wrap MaraDNS in a script that restarts it when it terminates. If using Deadwood in an environment where malloc() may return NULL, please replace the dw_malloc() macro with a function that can properly handle a malloc() failure.

It can be downloaded here:
I plan to work on MaraDNS/Deadwood again one day next month in August, after the 20th, unless a critical security bug with a CVE number is found.

To post a comment about an entry, send me an email and I may or may not post your comment (with or without editing)