On Wed, Jan 06, 2010 at 11:50:21AM -0800, Jonathan Swartz wrote:
> This is one of the most bizarre and specific bugs I've ever seen.
> I've minimized it as much as I can. Please bear with me. :)

It's certainly an interesting bug :)

> That is, $dbh2 goes "bad" when the pipe to sendmail is closed. (?!)

Which would trigger all sorts of activity in sendmail.

> Note that ping() still returns 1, I have to call do() to get the
> error.
> 
> Just about everything here is necessary to generate the bug. In
> particular, I cannot generate the bug...
> * If I move the code from connect.pl into the handler, even as a string eval
> * If I remove the "BEGIN" from connect.pl
> * If I replace sendmail with another program

That's the most interesting one to me. Try replacing it with a perl
script that reports what open file descriptors have been inherited.

> * If I run this in a script outside of mod_perl - even a script that forks
> 
> Obviously, I can change around our current code base to not hit this
> particular condition, but that gives me no confidence that it won't
> accidentally arise again, in this or another form.
> 
> Any advice on how to proceed appreciated!

Has the value of $^F ($SYSTEM_FD_MAX) been changed (from the default 2)?

Use a system call tracing tool (truss, strace, dtrace etc) to see what's
*actually* happening at a low level. Focus on identifying the sybase
file descriptor and tracing what happens to it.

Report back your findings so we can all play along with you ;-)

Tim.

Reply via email to