SA Bugzilla – Bug 6333
Win32: Bad file descriptor in SubProcBackChannel
Last modified: 2010-06-03 17:17:04 UTC
Another error during execution of spamd in Win32: backchannel: set non-blocking failed: Bad file descriptor at C:/Perl/site/lib/Mail/SpamAssassin/SubProcBackChannel.pm line 81. Line 81: $self->{parent}->blocking(0)
Can be "solved" like this: @@ -74,12 +74,14 @@ ($self->{latest_kid_fh}, $self->{parent}) = $io->socketpair(AF_UNIX,SOCK_STREAM,PF_UNSPEC) or die "backchannel: socketpair failed: $!"; - - # set those to use non-blocking I/O - $self->{parent}->blocking(0) - or die "backchannel: set non-blocking failed: $!"; - $self->{latest_kid_fh}->blocking(0) - or die "backchannel: set non-blocking failed: $!"; + + # set those to use non-blocking I/O + if (!Mail::SpamAssassin::Util::am_running_on_windows()) { + $self->{parent}->blocking(0) + or die "backchannel: set non-blocking failed: $!"; + $self->{latest_kid_fh}->blocking(0) + or die "backchannel: set non-blocking failed: $!"; + } } sub setup_backchannel_parent_post_fork {
um, I would assume that would have pretty serious consequences. Can you use round robin instead?
That may be but for now it's working fine and the spamd is running pretty stable (next step is to replace the old 323 spamd and testing it in production environment). Most of these fixes were already documented in SAWin32 and ran very stable. If there don't appear any bigger issues, I'd suggest to add the fixes to the sa source (since it's irrelevant to the stability of the unix version anyway).
After some research it appears to be a windows specific problem with the IO::Socket module so there is no need to patch it into SA source. A bugfix is mentioned here: http://rt.perl.org/rt3/Public/Bug/Display.html?id=27044 Commenting out both "$self->{parent}->blocking(0)" - lines works pretty stable for me but the bugfix mentioned above should be much more solid. If I'm able to make it work with it, I'll mention here.
(In reply to comment #4) > After some research it appears to be a windows specific problem with the > IO::Socket module so there is no need to patch it into SA source. > > A bugfix is mentioned here: > http://rt.perl.org/rt3/Public/Bug/Display.html?id=27044 > > Commenting out both "$self->{parent}->blocking(0)" - lines works pretty stable > for me but the bugfix mentioned above should be much more solid. If I'm able to > make it work with it, I'll mention here. I see this as a bug in perl than a bug in SA. However, is there a dependency for IO::Socket that could be enforced or at least warned for Windows users during configure?
Changing target to 3.3.2 but that could easily be bumped. I see this as a small is_windows and IO::Socket version check to warn the user or enforce during the initial configuration of the Makefile.PL Similar to the existing: 'Net::DNS' => (RUNNING_ON_WINDOWS ? 0.46 : 0.34), # bugs in older revs Do we know what version of IO::Socket resolved the issue?
Hmmm, made a build of latest trunk with Net-DNS 0.66 and ActivePerl 5.8.9 on a win7 and winXP machine, none of them having that error occuring. This may be due using another repository version of Net-DNS (if available I use precompiled modules via ActiveState repository) so this issue could appear again for other perl and / or repository distributions. Daniel
(In reply to comment #7) > Hmmm, made a build of latest trunk with Net-DNS 0.66 and ActivePerl 5.8.9 on a > win7 and winXP machine, none of them having that error occuring. > > This may be due using another repository version of Net-DNS (if available I use > precompiled modules via ActiveState repository) so this issue could appear > again for other perl and / or repository distributions. > > Daniel OK, closing again as resolved, invalid.