{"id":180,"date":"2009-01-24T15:21:28","date_gmt":"2009-01-24T23:21:28","guid":{"rendered":"http:\/\/www.outflux.net\/blog\/?p=180"},"modified":"2009-01-24T15:21:28","modified_gmt":"2009-01-24T23:21:28","slug":"debugging-hangs-in-mimedefang","status":"publish","type":"post","link":"https:\/\/outflux.net\/blog\/archives\/2009\/01\/24\/debugging-hangs-in-mimedefang\/","title":{"rendered":"debugging hangs in MIMEDefang"},"content":{"rendered":"<p>I spent a while this morning hunting down the root cause of a 100% CPU MIMEDefang process.  (Turned out to be one specific email triggering one of my custom SpamAssassin rules that seems to get processed really <a href=\"http:\/\/rt.perl.org\/rt3\/\/Public\/Bug\/Display.html?id=62718\">inefficiently<\/a>.)  I wasn&#8217;t able to find any documentation on how to debug where in MIMEDefang an email was getting stuck, and even jacking up the debugging output of my mimedefang-filter script seemed to imply it was happening late in the filtering process.  After digging through <code>mimedefang.pl<\/code>, I found a &#8220;status reporting&#8221; subsystem and tracked it back out into configuration in <code>\/etc\/default\/mimedefang<\/code>:<\/p>\n<blockquote><p><code># Uncomment next line to have busy slaves send status updates to the<br \/>\n# multiplexor.  NOTE: Consumes one extra file descriptor per slave, plus<br \/>\n# a bit of CPU time.<br \/>\n# MX_STATUS_UPDATES=yes<br \/>\n<\/code><\/p><\/blockquote>\n<p>Turning this on, and then using &#8220;<code><a href=\"http:\/\/manpages.ubuntu.com\/manpages\/hardy\/man8\/md-mx-ctrl.8.html\">md-mx-ctrl<\/a> busyslaves<\/code>&#8221; (I command I didn&#8217;t know existed until today either) I got to see exactly where it was stuck:<\/p>\n<blockquote><p><code>3 B 13380 (Running SpamAssassin j951iX1t025805)<br \/>\n<\/code><\/p><\/blockquote>\n<p>Now I&#8217;m having fun running <code>md-mx-ctl<\/code> with <code>histo<\/code>, <code>barstatus<\/code>, and <code>load<\/code>.  :)<\/p>\n<p style='text-align:left'>&copy; 2009, <a href=\"https:\/\/outflux.net\/blog\/\">Kees Cook<\/a>. This work is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 License<\/a>.<br \/><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><img decoding=\"async\" alt=\"CC BY-SA 4.0\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-sa\/4.0\/88x31.png\" \/><\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent a while this morning hunting down the root cause of a 100% CPU MIMEDefang process. (Turned out to be one specific email triggering one of my custom SpamAssassin rules that seems to get processed really inefficiently.) I wasn&#8217;t able to find any documentation on how to debug where in MIMEDefang an email was [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,18,14,19],"tags":[],"_links":{"self":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/180"}],"collection":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":0,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"wp:attachment":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}