sympa-community / sympa

Sympa, Mailing List Management Software
https://www.sympa.community/sympa
GNU General Public License v2.0
248 stars 98 forks source link

A review command mail makes sympa_msg crash #308

Closed ldidry closed 6 years ago

ldidry commented 6 years ago

A simple mail with a review command make sympa_msg crash

Configuration: Debian 9, PostgreSQL 9.6, Sympa 6.2.16, libmime-tools-perl 5.508-1 (Debian package)

Log:

May 16 20:16:13 rod2 sympa_msg[5972]: notice Sympa::Spindle::ProcessMessage::_twist() Processing Sympa::Request <action=review;context=list_name@framalistes.org>
May 16 20:16:13 rod2 sympa_msg[5972]: err main::#240 > Sympa::Spindle::spin#92 > Sympa::Spindle::DoCommand::_twist#117 > Sympa::Spindle::spin#92 > Sympa::Request::Handler::review::_twist#85 > Sympa::send_file#387 > Sympa::Spindle::new#39 > Sympa::Message::Template::new#181 > Sympa::Message::Template::_new_from_template#449 > Sympa::Message::new#149 > MIME::Parser::parse_data#1130 > MIME::Parser::parse#1158 > MIME::Parser::process_part#1018 > MIME::Parser::process_header#628 > MIME::Parser::Reader::read_chunk#236 > MIME::Parser::Reader::native_handle#186 DIED: Can't call method "isa" on an undefined value at /usr/share/perl5/MIME/Parser/Reader.pm line 186.

The (anonimized) mail:

X-Sympa-To: sympa@framalistes.org
Return-Path: <address@domain.com>
X-Original-To: sympa@framalistes.org
Delivered-To: sympa@framalistes.org
Received: from smtpfb2-g21.free.fr (smtpfb2-g21.free.fr [212.27.42.10])
        by rod2.framasoft.org (Postfix) with ESMTP id F0CA213F25F
        for <sympa@framalistes.org>; Wed, 16 May 2018 20:16:04 +0200 (CEST)
Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6])
        by smtpfb2-g21.free.fr (Postfix) with ESMTP id 4C8604290A3
        for <sympa@framalistes.org>; Wed, 16 May 2018 20:06:48 +0200 (CEST)
Received: from [192.168.1.11] (unknown [XX.XX.XX.XX])
        by smtp6-g21.free.fr (Postfix) with ESMTPS id 67386780310
        for <sympa@framalistes.org>; Wed, 16 May 2018 20:06:47 +0200 (CEST)
Date: Wed, 16 May 2018 20:06:46 +0200 (CEST)
From: First_name Last_name <address@domain.com>
X-X-Sender: xxx@localhost
To: Sympa Framalistes <sympa@framalistes.org>
Message-ID: <alpine.LNX.numbers@localhost>
User-Agent: Alpine 2.20.13 (LNX numbers)
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII

review list_name
ldidry commented 6 years ago

After sympa_msg restart stack trace:

Le processus sympa_msg.pl précédent (avec le pid 5972) est mort brutalement.
Date du crash : 16 mai 2018  20:16
Erreurs : 

Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 22.
[lot of same lines]
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
[lot of same lines]
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.

Warning: Could not parse date for message
         Message-Id: <sympa.1526466151.30872.268@framalistes.org>
         Date: 
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 313.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 313.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 313.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
[lot of same lines]
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 645.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 645.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391, <FILE> line 645.
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
[lot of same lines]
Use of uninitialized value in numeric le (<=) at /home/sympa/bin/Sympa/List.pm line 1391.
Use of uninitialized value in string eq at /home/sympa/bin/Sympa/Request/Handler/review.pm line 77.
[lot of same lines]
Use of uninitialized value in string eq at /home/sympa/bin/Sympa/Request/Handler/review.pm line 77.
DIED: Can't call method "isa" on an undefined value at /usr/share/perl5/MIME/Parser/Reader.pm line 186.
 at /usr/share/perl5/MIME/Parser/Reader.pm line 186.
        MIME::Parser::Reader::native_handle(undef) called at /usr/share/perl5/MIME/Parser/Reader.pm line 236
        MIME::Parser::Reader::read_chunk(MIME::Parser::Reader=HASH(0x564916295610), undef, GLOB(0x56490ea750b0), 0, 1) called at /usr/share/perl5/MIME/Parser.pm line 628
        MIME::Parser::process_header(MIME::Parser=HASH(0x56490f68ae20), undef, MIME::Parser::Reader=HASH(0x564915adee78)) called at /usr/share/perl5/MIME/Parser.pm line 1018
        MIME::Parser::process_part(MIME::Parser=HASH(0x56490f68ae20), undef, undef) called at /usr/share/perl5/MIME/Parser.pm line 1158
        MIME::Parser::parse(MIME::Parser=HASH(0x56490f68ae20), undef) called at /usr/share/perl5/MIME/Parser.pm line 1130
        MIME::Parser::parse_data(MIME::Parser=HASH(0x56490f68ae20), SCALAR(0x5649094ccec8)) called at /home/sympa/bin/Sympa/Message.pm line 149
        Sympa::Message::new('Sympa::Message::Template', 'Message-Id: <sympa.1526494573.5972.88@framalistes.org>\x{a}Date: ...', 'context', Sympa::List <list_name@framalistes.org>) called at /home/sympa/bin/Sympa/Message/Template.pm line 449
        Sympa::Message::Template::_new_from_template('Sympa::Message::Template', Sympa::List <list_name@framalistes.org>, 'review.tt2', 'address@domain.com', HASH(0x5649220586c8), 'template', 'review', 'context', ...) called at /home/sympa/bin/Sympa/Message/Template.pm line 181
        Sympa::Message::Template::new('Sympa::Message::Template', 'data', HASH(0x56491700f390), 'rcpt', 'address@domain.com', 'context', Sympa::List <list_name@framalistes.org>, 'template', ...) called at /home/sympa/bin/Sympa/Spindle.pm line 39
        Sympa::Spindle::new('Sympa::Spindle::ProcessTemplate', 'context', Sympa::List <list_name@framalistes.org>, 'template', 'review', 'rcpt', 'address@domain.com', 'data', ...) called at /home/sympa/bin/Sympa.pm line 387
        Sympa::send_file(Sympa::List <list_name@framalistes.org>, 'review', 'address@domain.com', HASH(0x56491700f390)) called at /home/sympa/bin/Sympa/Request/Handler/review.pm line 85
        Sympa::Request::Handler::review::_twist(Sympa::Spindle::ProcessMessage=HASH(0x56491294e9e0), Sympa::Request <action=review;context=list_name@framalistes.org>) called at /home/sympa/bin/Sympa/Spindle.pm line 92
        Sympa::Spindle::spin(Sympa::Spindle::ProcessMessage=HASH(0x56491294e9e0)) called at /home/sympa/bin/Sympa/Spindle/DoCommand.pm line 117
        Sympa::Spindle::DoCommand::_twist(Sympa::Spindle::ProcessIncoming=HASH(0x564909e02df8), Sympa::Message <sympa@framalistes.org.1526494569.6179>) called at /home/sympa/bin/Sympa/Spindle.pm line 92
        Sympa::Spindle::spin(Sympa::Spindle::ProcessIncoming=HASH(0x564909e02df8)) called at /home/sympa/bin/sympa_msg.pl line 240
ldidry commented 6 years ago

In fact, it's not the mail itself that makes sympa crash, but in fact the creation of the mail: I sent a mail from the listmaster address and it crashes Sympa as well, but I can send a review command for an other list and it works well.

ikedas commented 6 years ago

@ldidry, I suppose this behavior (and #305) may depend on version of external module (on this issue see also CPAN RT#119166).

If possible, could you please check following versions?

Or at least, specify versions you used.

ikedas commented 6 years ago

Perhaps I got it.

#! /usr/local/perl-5.24.0/bin/perl

use warnings;
use IO::File;
$x = "\x{fffd}";
$io = IO::File->new(\$x, "<:");
print $io;

Result:

Strings with code points over 0xFF may not be mapped into in-memory file handles
Use of uninitialized value $io in print at xxxx.pl line 7.
ldidry commented 6 years ago

Yeah \o/ The patch suggested in #305 worked! No more crash! (DBD::Pg 3.5.3)

ikedas commented 6 years ago

Duplicate of #305.