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 -main::die_catcher('Assertion ((svtype)((sv)->sv_flags & 0xff)) != 0xff + failed: f...') called at /usr/local/lib/perl5/5.10.1/mach/IO/Handle. +pm line 480 IO::Handle::autoflush('IO::Socket::UNIX=GLOB(0x802a5bff0)', 1) called +at /usr/local/lib/perl5/5.10.1/mach/IO/Socket.pm line 44 IO::Socket::new('IO::Socket::UNIX', 'Peer', '/var/HA/myUNIXDomainSocke +t', 'Type', 1) called at /usr/local/lib/perl5/5.10.1/mach/IO/Socket/U +NIX.pm line 23 IO::Socket::UNIX::new('IO::Socket::UNIX', 'Peer', '/var/HA/myUNIXDomai +nSocket', 'Type', 1) called at /usr/local/lib/perl5/site_perl/5.10.1/ +myLibrary.pm line 290
my $connection = IO::Socket::UNIX->new( Peer => $uds_path, Type => SOCK_STREAM );
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--babel17Assertion ((svtype)((sv)->sv_flags & 0xff)) != 0xff failed: file "sv.c +", line 5400 at /usr/local/lib/perl5/5.10.1/mach/IO/Handle.pm line 48 +0.
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.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |