kern/62216: perl syswrite not writing the buffer under (heavy) disk
load
Henri Hennebert
hlh at cocoon.cercle.be
Sun Feb 1 05:22:01 PST 2004
>Number: 62216
>Category: kern
>Synopsis: perl syswrite not writing the buffer under (heavy) disk load
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 01 05:20:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Henri Hennebert
>Release: FreeBSD 5.2-RELEASE i386
>Organization:
CIGER sa
>Environment:
System: FreeBSD norquay.cocoon.bel 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 15:03:32 CET 2004 hlh at norquay.cocoon.bel:/usr/obj/usr/src/sys/NORQUAY i386
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=freebsd, osvers=5.2-rc, archname=i386-freebsd
uname='freebsd norquay.cocoon.bel 5.2-rc freebsd 5.2-rc #0: thu dec 11 08:00:25 cet 2003 hlh at norquay.cocoon.bel:usrobjusrsrcsysnorquay i386 '
config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.2/mach -Dprivlib=/usr/local/lib/perl5/5.8.2 -Dman3dir=/usr/local/lib/perl5/5.8.2/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.2/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.2 -Dscriptdir=/usr/local/bin -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe -march=pentium3 -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include',
optimize='-O -pipe -march=pentium3',
cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.3 [FreeBSD] 20031106', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-Wl,-E -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lbind -lgdbm -lm -lcrypt -lutil -lc
perllibs=-lbind -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.8.2/mach/CORE'
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under freebsd
Compiled at Dec 20 2003 13:33:01
@INC:
/usr/local/lib/perl5/site_perl/5.8.2/mach
/usr/local/lib/perl5/site_perl/5.8.2
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.2/BSDPAN
/usr/local/lib/perl5/5.8.2/mach
/usr/local/lib/perl5/5.8.2
.
>Description:
When I install p5-Mail-Spamassassin, {site-perl}/Mail/Spamassassin.pm
and modules in {site-perl}/Mail/Spamassassin/ are truncated to 16384 bytes!
strange isn't it :-o .
After digging I trace the culprit in
/usr/local/lib/perl5/5.8.2/ExtUtils/Install.pm.
In fuction run_filter, I add 2 lines of debugging:
sub run_filter {
my ($cmd, $src, $dest) = @_;
local(*CMD, *SRC);
open(CMD, "|$cmd >$dest") || die "Cannot fork: $!";
open(SRC, $src) || die "Cannot open $src: $!";
my $buf;
my $sz = 1024;
while (my $len = sysread(SRC, $buf, $sz)) {
print STDERR "$len="; //DEBUG - print length read
my $len_w = syswrite(CMD, $buf, $len);
print STDERR "$len_w "; //DEBUG - print length written
}
close SRC;
close CMD or die "Filter command '$cmd' failed for $src";
}
If I run make
(in /usr/ports/mail/p5-Mail-SpamAssassin/work/Mail-SpamAssassin-2.61)
on a quiet machine, all is running well. My trace give me something like:
1024=1024 1024=1024 ... 390=390
Without the 2 `print STDERR', the files are truncated if make is run in
the same quiet condition. So the print modify the experiment (some
quantum theory here).
If I run make (after `make clean' and `perl Makefile.PL') during
a large copy from disk to disk, the trace give me:
1024=1024 10240=1024 ... 1024=1024 1024= 1024= 1024= ... 390=
^ ^ ^ ^
I conclude that syswrite do nothing, and don't return 0 as expected in
this case (maybe undef)!
For the record, I encounter this same problem in 5.1 some time ago but
don't study the problem at the time.
I make some google and mailing list searches and can't find any trace of
this problem elsewhere??? Maybe I am in a fold of spacetime ?
Any light is welcome.
Henri
>How-To-Repeat:
See above.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list