Hello, on my mail server running postfix + amavisd, amavisd was dying occasionally when using File::LibMagic to analyze mail messages.
I can reproduce it on the server (OpenBSD the-server 5.9 GENERIC.MP#3 amd64) with this Perl script: > #!/usr/bin/perl > > use File::LibMagic; > > my $file = shift; > $file || die "usage: $0 <file>\n"; > > my $magic = File::LibMagic->new(); > > for(my $i = 0; $i < 100000; $i++) { > my $desc = $magic->describe_filename($file); > if ($i % 100 == 0) { print "."; } > } using the following file (see bottom for b64 encoded version): # cat -tv p005 > $OpenBSD$ > > Use C codegen for mlton-20130715. > See https://github.com/MLton/mlton/issues/148 for details. > > --- mlyacc/Makefile.orig^IThu May 26 13:14:56 2016 > +++ mlyacc/Makefile^IThu May 26 13:15:10 2016 > @@ -13,7 +13,7 @@ BIN := $(BUILD)/bin > LIB := $(BUILD)/lib > MLTON := mlton > TARGET := self > -FLAGS := -target $(TARGET) > +FLAGS := -codegen c -target $(TARGET) > NAME := mlyacc > PATH := $(BIN):$(shell echo $$PATH) > Sometimes it core dumps on the very first iteration, sometimes it takes 100. I've fixed the problem on my server by configuring amavisd to use /usr/bin/file instead, which is not a problem because the server does not handle a high volume. Maybe someone who is more skilled debugging perl core dumps than I would like to have a crack at fixing the problem? cheers, Rob Urban -- snip -- base-64 encoded version of "p005": > begin-base64 644 p005.gz > H4sICEQHXVcCA3AwMDUAbZDLbsJADEXX9Vd4kQUonQzDs4pUiaRQGimBqoQPSIKTjDokiBkW/H3z > aFUVdWPJ9rm+tq3dmSp/v7IADprwBbP6SAVVmNcXPClTV2w8EpPRQswc2BNhacxZu5wX0pTX1Mnq > E4/CBuMdzKXWV9JcTJ+6CUcyiVTaAWCMNfNuSZbxKPmkXCpy6ossHuLyilFyw/EcxcQVU3c2x8Zy > DrZt3yvu4ZkrRj28XCITk8cF2l1sUj/YovuM1sA/BOFqyFNZAYaB/6eoZAoYhfGuY7sTAGPvY7OO > 24ImlQN7Db3Nvk2ZSS4FmUbeI0Owf3s/j8v+wXDrReveob0H8N2L374XCbZD1xrokpRCysoaLavt > NiL4At4kOzWdAQAA > ====