|Think about Loose Coupling|
[Solved] Request help for work around for bug in perl 5.10.1by babel17 (Acolyte)
|on Dec 12, 2012 at 19:31 UTC||Need Help??|
babel17 has asked for the
wisdom of the Perl Monks concerning the following question:
Let me start by saying that I know the correct thing to do is upgrade to a newer version of perl, but I request that you trust me on this - right now, upgrade is not an option.
The host OS is FreeBSD 8.0 ( and no, upgrading the OS isn't an option either. )
The problem is that perl sometimes panics when I try to open a UNIX domain socket to communicate with a C program.
The offending code is -
So my question is, "Is anyone familiar with this bug?" I could find very little about it on the web ( mainly http://www.nntp.perl.org/group/perl.perl5.porters/2009/11/msg153316.html ), and nothing in the perl bug database. What I'm really looking for is the conditions that trigger it, as it is a fairly low frequency occurrence, but once it gets triggered, it seems to keep happening. Is it possible that it is triggered by the state of the other side of the socket? ( This seems unlikely, as it looks as though autoflush is set before trying to connect )
Failing controlling the conditions that trigger the bug, is there a reasonable workaround? The one that comes to mind is to open the socket inside of an eval. Your thoughts on the matter will be appreciated.Edit: OK here is full diag
So in the end this turned out to be be programmer error. For complicated reasons, and simple ones (like stupidity), I was calling Sys::Syslog->syslog() after syslog had been closed. Strangely enough this all seemed to work fine until syslogd was SIGHUP'd by log rotation, and then things started to go wrong. Presumably something got terribly screwed up in the relationship between perl filehandles and C file descriptors.