git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* send-email: Net::SMTP::SSL failure
@ 2017-06-07  5:47 Liam Breck
  2017-06-07 17:00 ` Liam Breck
  0 siblings, 1 reply; 12+ messages in thread
From: Liam Breck @ 2017-06-07  5:47 UTC (permalink / raw)
  To: git

This is configured to send via a gmail account
git send-email --to-cover --cc-cover <patch-list>

I See
Attempt to reload IO/Socket/SSL.pm aborted.
Compilation failed in require at
/usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
BEGIN failed--compilation aborted at
/usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
fatal: 'send-email' appears to be a git command, but we were not
able to execute it. Maybe git-send-email is broken?

Net/SMTP/SSL.pm v1.04

perl v5.26.0

Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07  5:47 send-email: Net::SMTP::SSL failure Liam Breck
@ 2017-06-07 17:00 ` Liam Breck
  2017-06-07 17:16   ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 12+ messages in thread
From: Liam Breck @ 2017-06-07 17:00 UTC (permalink / raw)
  To: git

On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>
> This is configured to send via a gmail account
> git send-email --to-cover --cc-cover <patch-list>
>
> I See
> Attempt to reload IO/Socket/SSL.pm aborted.
> Compilation failed in require at
> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
> BEGIN failed--compilation aborted at
> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
> fatal: 'send-email' appears to be a git command, but we were not
> able to execute it. Maybe git-send-email is broken?
>
> Net/SMTP/SSL.pm v1.04
>
> perl v5.26.0
>
> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux

Also fails with perl 5.24.1 & 5.24.0

Last working config was git 2.9.3 on perl 5.24.1

The relevant code from git-send-email is:

            require Net::SMTP;
            $smtp_domain ||= maildomain();
            $smtp_server_port ||= 25;
            $smtp ||= Net::SMTP->new($smtp_server,
                         Hello => $smtp_domain,
                         Debug => $debug_net_smtp,
                         Port => $smtp_server_port);
            if ($smtp_encryption eq 'tls' && $smtp) {
                require Net::SMTP::SSL;
                $smtp->command('STARTTLS');

I really wish git bundled its non-core perl libs...
.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 17:00 ` Liam Breck
@ 2017-06-07 17:16   ` Ævar Arnfjörð Bjarmason
  2017-06-07 18:04     ` Liam Breck
  2017-06-09 16:37     ` Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-07 17:16 UTC (permalink / raw)
  To: Liam Breck; +Cc: Git Mailing List

On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>
>> This is configured to send via a gmail account
>> git send-email --to-cover --cc-cover <patch-list>
>>
>> I See
>> Attempt to reload IO/Socket/SSL.pm aborted.
>> Compilation failed in require at
>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>> BEGIN failed--compilation aborted at
>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>> fatal: 'send-email' appears to be a git command, but we were not
>> able to execute it. Maybe git-send-email is broken?
>>
>> Net/SMTP/SSL.pm v1.04
>>
>> perl v5.26.0
>>
>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>
> Also fails with perl 5.24.1 & 5.24.0
>
> Last working config was git 2.9.3 on perl 5.24.1
>
> The relevant code from git-send-email is:
>
>             require Net::SMTP;
>             $smtp_domain ||= maildomain();
>             $smtp_server_port ||= 25;
>             $smtp ||= Net::SMTP->new($smtp_server,
>                          Hello => $smtp_domain,
>                          Debug => $debug_net_smtp,
>                          Port => $smtp_server_port);
>             if ($smtp_encryption eq 'tls' && $smtp) {
>                 require Net::SMTP::SSL;
>                 $smtp->command('STARTTLS');
>
> I really wish git bundled its non-core perl libs...

What's the output from just:

    perl -MNet::SMTP -we1

I have not looked deeply at this, but the error you're getting means
"we tried to load it before and failed, and here you are trying
again".

This is almost definitely due to this line in git-send-email:

        if (eval { require Net::SMTP; 1 }) {

And more generally, this code is all buggy:

    4 matches for "eval.*require" in buffer: git-send-email.perl
    153:my $have_email_valid = eval { require Email::Valid; 1 };
    154:my $have_mail_address = eval { require Mail::Address; 1 };
   1118:        if (eval { require Net::Domain; 1 }) {
   1129:        if (eval { require Net::SMTP; 1 }) {

Well, "buggy" in the sense that we're just happy-go-lucky trying to
load these modules, and if they have an error we don't report it, then
when we try to load them again perl just emits a generic error saying
you're trying to require() something that already failed somewhere
before, a minimal test case for that is:

    $ cat /tmp/Fails.pm
    package Fails;
    die "oh noes";
    $ perl -I/tmp -we 'eval { require Fails }; require Fails'
    Attempt to reload Fails.pm aborted.
    Compilation failed in require at -e line 1.

Whereas what we really want to do is some variant of:

    $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
$@; require Fails'
    oh noes at /tmp/Fails.pm line 2.
    Compilation failed in require at -e line 1.
    Attempt to reload Fails.pm aborted.
    Compilation failed in require at -e line 1.

Or even the more adventerous, this can have some bad side-effects with
some libraries (you lie to perl saying you haven't seen it before),
but I doubt Net::SMTP cares much, particularly when we're just about
to report an error:

    $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
delete $INC{"Fails.pm"} }; require Fails'
    oh noes at /tmp/Fails.pm line 2.
    Compilation failed in require at -e line 1.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 17:16   ` Ævar Arnfjörð Bjarmason
@ 2017-06-07 18:04     ` Liam Breck
  2017-06-07 19:30       ` Ævar Arnfjörð Bjarmason
  2017-06-09 16:37     ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Liam Breck @ 2017-06-07 18:04 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List

Thanks for your help!

On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>
>>> This is configured to send via a gmail account
>>> git send-email --to-cover --cc-cover <patch-list>
>>>
>>> I See
>>> Attempt to reload IO/Socket/SSL.pm aborted.
>>> Compilation failed in require at
>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>> BEGIN failed--compilation aborted at
>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>>> fatal: 'send-email' appears to be a git command, but we were not
>>> able to execute it. Maybe git-send-email is broken?
>>>
>>> Net/SMTP/SSL.pm v1.04
>>>
>>> perl v5.26.0
>>>
>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>>
>> Also fails with perl 5.24.1 & 5.24.0
>>
>> Last working config was git 2.9.3 on perl 5.24.1
>>
>> The relevant code from git-send-email is:
>>
>>             require Net::SMTP;
>>             $smtp_domain ||= maildomain();
>>             $smtp_server_port ||= 25;
>>             $smtp ||= Net::SMTP->new($smtp_server,
>>                          Hello => $smtp_domain,
>>                          Debug => $debug_net_smtp,
>>                          Port => $smtp_server_port);
>>             if ($smtp_encryption eq 'tls' && $smtp) {
>>                 require Net::SMTP::SSL;
>>                 $smtp->command('STARTTLS');
>>
>> I really wish git bundled its non-core perl libs...
>
> What's the output from just:
>
>     perl -MNet::SMTP -we1

No output, exit code 0, however...

$ perl -MIO::Socket::SSL -we1
Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for
module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:
No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm
line 193.
at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
Compilation failed in require at
/usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
BEGIN failed--compilation aborted at
/usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
Compilation failed in require.
BEGIN failed--compilation aborted.

I don't have {vendor,site}_perl/auto/ tho I have the package for
ssleay installed.

Since which git release was that required?


> I have not looked deeply at this, but the error you're getting means
> "we tried to load it before and failed, and here you are trying
> again".
>
> This is almost definitely due to this line in git-send-email:
>
>         if (eval { require Net::SMTP; 1 }) {
>
> And more generally, this code is all buggy:
>
>     4 matches for "eval.*require" in buffer: git-send-email.perl
>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>    1118:        if (eval { require Net::Domain; 1 }) {
>    1129:        if (eval { require Net::SMTP; 1 }) {
>
> Well, "buggy" in the sense that we're just happy-go-lucky trying to
> load these modules, and if they have an error we don't report it, then
> when we try to load them again perl just emits a generic error saying
> you're trying to require() something that already failed somewhere
> before, a minimal test case for that is:
>
>     $ cat /tmp/Fails.pm
>     package Fails;
>     die "oh noes";
>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'
>     Attempt to reload Fails.pm aborted.
>     Compilation failed in require at -e line 1.
>
> Whereas what we really want to do is some variant of:
>
>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
> $@; require Fails'
>     oh noes at /tmp/Fails.pm line 2.
>     Compilation failed in require at -e line 1.
>     Attempt to reload Fails.pm aborted.
>     Compilation failed in require at -e line 1.
>
> Or even the more adventerous, this can have some bad side-effects with
> some libraries (you lie to perl saying you haven't seen it before),
> but I doubt Net::SMTP cares much, particularly when we're just about
> to report an error:
>
>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
> delete $INC{"Fails.pm"} }; require Fails'
>     oh noes at /tmp/Fails.pm line 2.
>     Compilation failed in require at -e line 1.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 18:04     ` Liam Breck
@ 2017-06-07 19:30       ` Ævar Arnfjörð Bjarmason
  2017-06-07 19:39         ` Liam Breck
  0 siblings, 1 reply; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-07 19:30 UTC (permalink / raw)
  To: Liam Breck; +Cc: Git Mailing List

On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:
> Thanks for your help!
>
> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>
>>>> This is configured to send via a gmail account
>>>> git send-email --to-cover --cc-cover <patch-list>
>>>>
>>>> I See
>>>> Attempt to reload IO/Socket/SSL.pm aborted.
>>>> Compilation failed in require at
>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>> BEGIN failed--compilation aborted at
>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>>>> fatal: 'send-email' appears to be a git command, but we were not
>>>> able to execute it. Maybe git-send-email is broken?
>>>>
>>>> Net/SMTP/SSL.pm v1.04
>>>>
>>>> perl v5.26.0
>>>>
>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>>>
>>> Also fails with perl 5.24.1 & 5.24.0
>>>
>>> Last working config was git 2.9.3 on perl 5.24.1
>>>
>>> The relevant code from git-send-email is:
>>>
>>>             require Net::SMTP;
>>>             $smtp_domain ||= maildomain();
>>>             $smtp_server_port ||= 25;
>>>             $smtp ||= Net::SMTP->new($smtp_server,
>>>                          Hello => $smtp_domain,
>>>                          Debug => $debug_net_smtp,
>>>                          Port => $smtp_server_port);
>>>             if ($smtp_encryption eq 'tls' && $smtp) {
>>>                 require Net::SMTP::SSL;
>>>                 $smtp->command('STARTTLS');
>>>
>>> I really wish git bundled its non-core perl libs...
>>
>> What's the output from just:
>>
>>     perl -MNet::SMTP -we1
>
> No output, exit code 0, however...
>
> $ perl -MIO::Socket::SSL -we1
> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for
> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:
> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm
> line 193.
> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
> Compilation failed in require at
> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
> BEGIN failed--compilation aborted at
> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
> Compilation failed in require.
> BEGIN failed--compilation aborted.
>
> I don't have {vendor,site}_perl/auto/ tho I have the package for
> ssleay installed.
>
> Since which git release was that required?

The actual issue here is that your Net::SSLeay package is broken
because it's linked to libssl.so.1.0.0 which has since gone away. You
should see that it's missing if you run whatever the Arch equivalent
is of these Debian commands:

    $ dpkg -L libnet-ssleay-perl|grep \.so$
    /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
    $ /usr/bin/perldoc -l Net::SSLeay
    /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
    $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
    libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
    $ dpkg -L libnet-ssleay-perl|grep \.so$
    /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
    $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
2>&1|grep libssl
            libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
(0x00007f2523bb5000)
    $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1

But that this isn't reported is a bug in git-send-email. This
(untested) patch is probably the least invasive and easiest way to
deal with this:

diff --git a/git-send-email.perl b/git-send-email.perl
index 7fd5874436..3f0fcf9040 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1354,6 +1354,8 @@ EOF
                        die __("The required SMTP server is not
properly defined.")
                }

+               delete $INC{"Net/SMTP.pm"} if exists $INC{"Net/SMTP.pm"}
+                                             and !defined $INC{"Net/SMTP.pm"};
                require Net::SMTP;
                my $use_net_smtp_ssl =
version->parse($Net::SMTP::VERSION) < version->parse("2.34");
                $smtp_domain ||= maildomain();

on closer inspection none of the other require() uses in that script
are run twice, so they don't have the same issue with hiding the
initial error.


>> I have not looked deeply at this, but the error you're getting means
>> "we tried to load it before and failed, and here you are trying
>> again".
>>
>> This is almost definitely due to this line in git-send-email:
>>
>>         if (eval { require Net::SMTP; 1 }) {
>>
>> And more generally, this code is all buggy:
>>
>>     4 matches for "eval.*require" in buffer: git-send-email.perl
>>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>>    1118:        if (eval { require Net::Domain; 1 }) {
>>    1129:        if (eval { require Net::SMTP; 1 }) {
>>
>> Well, "buggy" in the sense that we're just happy-go-lucky trying to
>> load these modules, and if they have an error we don't report it, then
>> when we try to load them again perl just emits a generic error saying
>> you're trying to require() something that already failed somewhere
>> before, a minimal test case for that is:
>>
>>     $ cat /tmp/Fails.pm
>>     package Fails;
>>     die "oh noes";
>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'
>>     Attempt to reload Fails.pm aborted.
>>     Compilation failed in require at -e line 1.
>>
>> Whereas what we really want to do is some variant of:
>>
>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
>> $@; require Fails'
>>     oh noes at /tmp/Fails.pm line 2.
>>     Compilation failed in require at -e line 1.
>>     Attempt to reload Fails.pm aborted.
>>     Compilation failed in require at -e line 1.
>>
>> Or even the more adventerous, this can have some bad side-effects with
>> some libraries (you lie to perl saying you haven't seen it before),
>> but I doubt Net::SMTP cares much, particularly when we're just about
>> to report an error:
>>
>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
>> delete $INC{"Fails.pm"} }; require Fails'
>>     oh noes at /tmp/Fails.pm line 2.
>>     Compilation failed in require at -e line 1.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 19:30       ` Ævar Arnfjörð Bjarmason
@ 2017-06-07 19:39         ` Liam Breck
  2017-06-07 20:43           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 12+ messages in thread
From: Liam Breck @ 2017-06-07 19:39 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List

On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:
>> Thanks for your help!
>>
>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason
>> <avarab@gmail.com> wrote:
>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>>
>>>>> This is configured to send via a gmail account
>>>>> git send-email --to-cover --cc-cover <patch-list>
>>>>>
>>>>> I See
>>>>> Attempt to reload IO/Socket/SSL.pm aborted.
>>>>> Compilation failed in require at
>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>> BEGIN failed--compilation aborted at
>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>>>>> fatal: 'send-email' appears to be a git command, but we were not
>>>>> able to execute it. Maybe git-send-email is broken?
>>>>>
>>>>> Net/SMTP/SSL.pm v1.04
>>>>>
>>>>> perl v5.26.0
>>>>>
>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>>>>
>>>> Also fails with perl 5.24.1 & 5.24.0
>>>>
>>>> Last working config was git 2.9.3 on perl 5.24.1
>>>>
>>>> The relevant code from git-send-email is:
>>>>
>>>>             require Net::SMTP;
>>>>             $smtp_domain ||= maildomain();
>>>>             $smtp_server_port ||= 25;
>>>>             $smtp ||= Net::SMTP->new($smtp_server,
>>>>                          Hello => $smtp_domain,
>>>>                          Debug => $debug_net_smtp,
>>>>                          Port => $smtp_server_port);
>>>>             if ($smtp_encryption eq 'tls' && $smtp) {
>>>>                 require Net::SMTP::SSL;
>>>>                 $smtp->command('STARTTLS');
>>>>
>>>> I really wish git bundled its non-core perl libs...
>>>
>>> What's the output from just:
>>>
>>>     perl -MNet::SMTP -we1
>>
>> No output, exit code 0, however...
>>
>> $ perl -MIO::Socket::SSL -we1
>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for
>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:
>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm
>> line 193.
>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>> Compilation failed in require at
>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>> BEGIN failed--compilation aborted at
>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>> Compilation failed in require.
>> BEGIN failed--compilation aborted.
>>
>> I don't have {vendor,site}_perl/auto/ tho I have the package for
>> ssleay installed.
>>
>> Since which git release was that required?
>
> The actual issue here is that your Net::SSLeay package is broken
> because it's linked to libssl.so.1.0.0 which has since gone away. You
> should see that it's missing if you run whatever the Arch equivalent
> is of these Debian commands:
>
>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>     $ /usr/bin/perldoc -l Net::SSLeay
>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
> 2>&1|grep libssl
>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
> (0x00007f2523bb5000)
>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>
> But that this isn't reported is a bug in git-send-email. This
> (untested) patch is probably the least invasive and easiest way to
> deal with this:
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 7fd5874436..3f0fcf9040 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1354,6 +1354,8 @@ EOF
>                         die __("The required SMTP server is not
> properly defined.")
>                 }
>
> +               delete $INC{"Net/SMTP.pm"} if exists $INC{"Net/SMTP.pm"}
> +                                             and !defined $INC{"Net/SMTP.pm"};
>                 require Net::SMTP;
>                 my $use_net_smtp_ssl =
> version->parse($Net::SMTP::VERSION) < version->parse("2.34");
>                 $smtp_domain ||= maildomain();
>
> on closer inspection none of the other require() uses in that script
> are run twice, so they don't have the same issue with hiding the
> initial error.

Arch didn't have packages for these perl modules until recently,
forcing git users to install them with cpan. And then the new packages
didn't emit a warning about checking for conflicts in the site_perl/
directories. Grrr.

Fixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had
only cleaned out share/ previously.

Agreed that send-email should be report errors properly. It's a rather
essential tool.

>>> I have not looked deeply at this, but the error you're getting means
>>> "we tried to load it before and failed, and here you are trying
>>> again".
>>>
>>> This is almost definitely due to this line in git-send-email:
>>>
>>>         if (eval { require Net::SMTP; 1 }) {
>>>
>>> And more generally, this code is all buggy:
>>>
>>>     4 matches for "eval.*require" in buffer: git-send-email.perl
>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>>>    1118:        if (eval { require Net::Domain; 1 }) {
>>>    1129:        if (eval { require Net::SMTP; 1 }) {
>>>
>>> Well, "buggy" in the sense that we're just happy-go-lucky trying to
>>> load these modules, and if they have an error we don't report it, then
>>> when we try to load them again perl just emits a generic error saying
>>> you're trying to require() something that already failed somewhere
>>> before, a minimal test case for that is:
>>>
>>>     $ cat /tmp/Fails.pm
>>>     package Fails;
>>>     die "oh noes";
>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'
>>>     Attempt to reload Fails.pm aborted.
>>>     Compilation failed in require at -e line 1.
>>>
>>> Whereas what we really want to do is some variant of:
>>>
>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
>>> $@; require Fails'
>>>     oh noes at /tmp/Fails.pm line 2.
>>>     Compilation failed in require at -e line 1.
>>>     Attempt to reload Fails.pm aborted.
>>>     Compilation failed in require at -e line 1.
>>>
>>> Or even the more adventerous, this can have some bad side-effects with
>>> some libraries (you lie to perl saying you haven't seen it before),
>>> but I doubt Net::SMTP cares much, particularly when we're just about
>>> to report an error:
>>>
>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
>>> delete $INC{"Fails.pm"} }; require Fails'
>>>     oh noes at /tmp/Fails.pm line 2.
>>>     Compilation failed in require at -e line 1.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 19:39         ` Liam Breck
@ 2017-06-07 20:43           ` Ævar Arnfjörð Bjarmason
  2017-06-07 21:06             ` Liam Breck
  2017-06-08  0:06             ` Samuel Lijin
  0 siblings, 2 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-07 20:43 UTC (permalink / raw)
  To: Liam Breck; +Cc: Git Mailing List

On Wed, Jun 7, 2017 at 9:39 PM, Liam Breck <liam@networkimprov.net> wrote:
> On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:
>>> Thanks for your help!
>>>
>>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason
>>> <avarab@gmail.com> wrote:
>>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>>>
>>>>>> This is configured to send via a gmail account
>>>>>> git send-email --to-cover --cc-cover <patch-list>
>>>>>>
>>>>>> I See
>>>>>> Attempt to reload IO/Socket/SSL.pm aborted.
>>>>>> Compilation failed in require at
>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>>> BEGIN failed--compilation aborted at
>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>>>>>> fatal: 'send-email' appears to be a git command, but we were not
>>>>>> able to execute it. Maybe git-send-email is broken?
>>>>>>
>>>>>> Net/SMTP/SSL.pm v1.04
>>>>>>
>>>>>> perl v5.26.0
>>>>>>
>>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>>>>>
>>>>> Also fails with perl 5.24.1 & 5.24.0
>>>>>
>>>>> Last working config was git 2.9.3 on perl 5.24.1
>>>>>
>>>>> The relevant code from git-send-email is:
>>>>>
>>>>>             require Net::SMTP;
>>>>>             $smtp_domain ||= maildomain();
>>>>>             $smtp_server_port ||= 25;
>>>>>             $smtp ||= Net::SMTP->new($smtp_server,
>>>>>                          Hello => $smtp_domain,
>>>>>                          Debug => $debug_net_smtp,
>>>>>                          Port => $smtp_server_port);
>>>>>             if ($smtp_encryption eq 'tls' && $smtp) {
>>>>>                 require Net::SMTP::SSL;
>>>>>                 $smtp->command('STARTTLS');
>>>>>
>>>>> I really wish git bundled its non-core perl libs...
>>>>
>>>> What's the output from just:
>>>>
>>>>     perl -MNet::SMTP -we1
>>>
>>> No output, exit code 0, however...
>>>
>>> $ perl -MIO::Socket::SSL -we1
>>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for
>>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:
>>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm
>>> line 193.
>>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>> Compilation failed in require at
>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>> BEGIN failed--compilation aborted at
>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>> Compilation failed in require.
>>> BEGIN failed--compilation aborted.
>>>
>>> I don't have {vendor,site}_perl/auto/ tho I have the package for
>>> ssleay installed.
>>>
>>> Since which git release was that required?
>>
>> The actual issue here is that your Net::SSLeay package is broken
>> because it's linked to libssl.so.1.0.0 which has since gone away. You
>> should see that it's missing if you run whatever the Arch equivalent
>> is of these Debian commands:
>>
>>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>>     $ /usr/bin/perldoc -l Net::SSLeay
>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>> 2>&1|grep libssl
>>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>> (0x00007f2523bb5000)
>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>>
>> But that this isn't reported is a bug in git-send-email. This
>> (untested) patch is probably the least invasive and easiest way to
>> deal with this:
>>
>> diff --git a/git-send-email.perl b/git-send-email.perl
>> index 7fd5874436..3f0fcf9040 100755
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -1354,6 +1354,8 @@ EOF
>>                         die __("The required SMTP server is not
>> properly defined.")
>>                 }
>>
>> +               delete $INC{"Net/SMTP.pm"} if exists $INC{"Net/SMTP.pm"}
>> +                                             and !defined $INC{"Net/SMTP.pm"};
>>                 require Net::SMTP;
>>                 my $use_net_smtp_ssl =
>> version->parse($Net::SMTP::VERSION) < version->parse("2.34");
>>                 $smtp_domain ||= maildomain();
>>
>> on closer inspection none of the other require() uses in that script
>> are run twice, so they don't have the same issue with hiding the
>> initial error.
>
> Arch didn't have packages for these perl modules until recently,
> forcing git users to install them with cpan. And then the new packages
> didn't emit a warning about checking for conflicts in the site_perl/
> directories. Grrr.
>
> Fixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had
> only cleaned out share/ previously.

Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch
openssl, breaking the CPAN-built *.so object?

> Agreed that send-email should be report errors properly. It's a rather
> essential tool.

Indeed, do you get a meaningful error if you apply my patch?

>>>> I have not looked deeply at this, but the error you're getting means
>>>> "we tried to load it before and failed, and here you are trying
>>>> again".
>>>>
>>>> This is almost definitely due to this line in git-send-email:
>>>>
>>>>         if (eval { require Net::SMTP; 1 }) {
>>>>
>>>> And more generally, this code is all buggy:
>>>>
>>>>     4 matches for "eval.*require" in buffer: git-send-email.perl
>>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>>>>    1118:        if (eval { require Net::Domain; 1 }) {
>>>>    1129:        if (eval { require Net::SMTP; 1 }) {
>>>>
>>>> Well, "buggy" in the sense that we're just happy-go-lucky trying to
>>>> load these modules, and if they have an error we don't report it, then
>>>> when we try to load them again perl just emits a generic error saying
>>>> you're trying to require() something that already failed somewhere
>>>> before, a minimal test case for that is:
>>>>
>>>>     $ cat /tmp/Fails.pm
>>>>     package Fails;
>>>>     die "oh noes";
>>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'
>>>>     Attempt to reload Fails.pm aborted.
>>>>     Compilation failed in require at -e line 1.
>>>>
>>>> Whereas what we really want to do is some variant of:
>>>>
>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
>>>> $@; require Fails'
>>>>     oh noes at /tmp/Fails.pm line 2.
>>>>     Compilation failed in require at -e line 1.
>>>>     Attempt to reload Fails.pm aborted.
>>>>     Compilation failed in require at -e line 1.
>>>>
>>>> Or even the more adventerous, this can have some bad side-effects with
>>>> some libraries (you lie to perl saying you haven't seen it before),
>>>> but I doubt Net::SMTP cares much, particularly when we're just about
>>>> to report an error:
>>>>
>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
>>>> delete $INC{"Fails.pm"} }; require Fails'
>>>>     oh noes at /tmp/Fails.pm line 2.
>>>>     Compilation failed in require at -e line 1.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 20:43           ` Ævar Arnfjörð Bjarmason
@ 2017-06-07 21:06             ` Liam Breck
  2017-06-08  0:06             ` Samuel Lijin
  1 sibling, 0 replies; 12+ messages in thread
From: Liam Breck @ 2017-06-07 21:06 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List

On Wed, Jun 7, 2017 at 1:43 PM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Wed, Jun 7, 2017 at 9:39 PM, Liam Breck <liam@networkimprov.net> wrote:
>> On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason
>> <avarab@gmail.com> wrote:
>>> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>> Thanks for your help!
>>>>
>>>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason
>>>> <avarab@gmail.com> wrote:
>>>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>>>>
>>>>>>> This is configured to send via a gmail account
>>>>>>> git send-email --to-cover --cc-cover <patch-list>
>>>>>>>
>>>>>>> I See
>>>>>>> Attempt to reload IO/Socket/SSL.pm aborted.
>>>>>>> Compilation failed in require at
>>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>>>> BEGIN failed--compilation aborted at
>>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.
>>>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.
>>>>>>> fatal: 'send-email' appears to be a git command, but we were not
>>>>>>> able to execute it. Maybe git-send-email is broken?
>>>>>>>
>>>>>>> Net/SMTP/SSL.pm v1.04
>>>>>>>
>>>>>>> perl v5.26.0
>>>>>>>
>>>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux
>>>>>>
>>>>>> Also fails with perl 5.24.1 & 5.24.0
>>>>>>
>>>>>> Last working config was git 2.9.3 on perl 5.24.1
>>>>>>
>>>>>> The relevant code from git-send-email is:
>>>>>>
>>>>>>             require Net::SMTP;
>>>>>>             $smtp_domain ||= maildomain();
>>>>>>             $smtp_server_port ||= 25;
>>>>>>             $smtp ||= Net::SMTP->new($smtp_server,
>>>>>>                          Hello => $smtp_domain,
>>>>>>                          Debug => $debug_net_smtp,
>>>>>>                          Port => $smtp_server_port);
>>>>>>             if ($smtp_encryption eq 'tls' && $smtp) {
>>>>>>                 require Net::SMTP::SSL;
>>>>>>                 $smtp->command('STARTTLS');
>>>>>>
>>>>>> I really wish git bundled its non-core perl libs...
>>>>>
>>>>> What's the output from just:
>>>>>
>>>>>     perl -MNet::SMTP -we1
>>>>
>>>> No output, exit code 0, however...
>>>>
>>>> $ perl -MIO::Socket::SSL -we1
>>>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for
>>>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:
>>>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm
>>>> line 193.
>>>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>>> Compilation failed in require at
>>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>>> BEGIN failed--compilation aborted at
>>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.
>>>> Compilation failed in require.
>>>> BEGIN failed--compilation aborted.
>>>>
>>>> I don't have {vendor,site}_perl/auto/ tho I have the package for
>>>> ssleay installed.
>>>>
>>>> Since which git release was that required?
>>>
>>> The actual issue here is that your Net::SSLeay package is broken
>>> because it's linked to libssl.so.1.0.0 which has since gone away. You
>>> should see that it's missing if you run whatever the Arch equivalent
>>> is of these Debian commands:
>>>
>>>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>>>     $ /usr/bin/perldoc -l Net::SSLeay
>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod
>>>     $ dpkg -L libnet-ssleay-perl|grep \.so$
>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>>>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so
>>> 2>&1|grep libssl
>>>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>>> (0x00007f2523bb5000)
>>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>>>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>>>
>>> But that this isn't reported is a bug in git-send-email. This
>>> (untested) patch is probably the least invasive and easiest way to
>>> deal with this:
>>>
>>> diff --git a/git-send-email.perl b/git-send-email.perl
>>> index 7fd5874436..3f0fcf9040 100755
>>> --- a/git-send-email.perl
>>> +++ b/git-send-email.perl
>>> @@ -1354,6 +1354,8 @@ EOF
>>>                         die __("The required SMTP server is not
>>> properly defined.")
>>>                 }
>>>
>>> +               delete $INC{"Net/SMTP.pm"} if exists $INC{"Net/SMTP.pm"}
>>> +                                             and !defined $INC{"Net/SMTP.pm"};
>>>                 require Net::SMTP;
>>>                 my $use_net_smtp_ssl =
>>> version->parse($Net::SMTP::VERSION) < version->parse("2.34");
>>>                 $smtp_domain ||= maildomain();
>>>
>>> on closer inspection none of the other require() uses in that script
>>> are run twice, so they don't have the same issue with hiding the
>>> initial error.
>>
>> Arch didn't have packages for these perl modules until recently,
>> forcing git users to install them with cpan. And then the new packages
>> didn't emit a warning about checking for conflicts in the site_perl/
>> directories. Grrr.
>>
>> Fixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had
>> only cleaned out share/ previously.
>
> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch
> openssl, breaking the CPAN-built *.so object?

Trouble started after an Arch system upgrade which didn't uninstall
site_perl/*, so yes probably. I actually fixed the problem first by
installing SSLeay via cpan, then noticed where it installed and
removed all the cpan stuff.

>> Agreed that send-email should be report errors properly. It's a rather
>> essential tool.
>
> Indeed, do you get a meaningful error if you apply my patch?

I'm not a git hacker, so I'm not set up to test this quickly, and I
lost a day's work trying to fix Arch :-(

>>>>> I have not looked deeply at this, but the error you're getting means
>>>>> "we tried to load it before and failed, and here you are trying
>>>>> again".
>>>>>
>>>>> This is almost definitely due to this line in git-send-email:
>>>>>
>>>>>         if (eval { require Net::SMTP; 1 }) {
>>>>>
>>>>> And more generally, this code is all buggy:
>>>>>
>>>>>     4 matches for "eval.*require" in buffer: git-send-email.perl
>>>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>>>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>>>>>    1118:        if (eval { require Net::Domain; 1 }) {
>>>>>    1129:        if (eval { require Net::SMTP; 1 }) {
>>>>>
>>>>> Well, "buggy" in the sense that we're just happy-go-lucky trying to
>>>>> load these modules, and if they have an error we don't report it, then
>>>>> when we try to load them again perl just emits a generic error saying
>>>>> you're trying to require() something that already failed somewhere
>>>>> before, a minimal test case for that is:
>>>>>
>>>>>     $ cat /tmp/Fails.pm
>>>>>     package Fails;
>>>>>     die "oh noes";
>>>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'
>>>>>     Attempt to reload Fails.pm aborted.
>>>>>     Compilation failed in require at -e line 1.
>>>>>
>>>>> Whereas what we really want to do is some variant of:
>>>>>
>>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn
>>>>> $@; require Fails'
>>>>>     oh noes at /tmp/Fails.pm line 2.
>>>>>     Compilation failed in require at -e line 1.
>>>>>     Attempt to reload Fails.pm aborted.
>>>>>     Compilation failed in require at -e line 1.
>>>>>
>>>>> Or even the more adventerous, this can have some bad side-effects with
>>>>> some libraries (you lie to perl saying you haven't seen it before),
>>>>> but I doubt Net::SMTP cares much, particularly when we're just about
>>>>> to report an error:
>>>>>
>>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {
>>>>> delete $INC{"Fails.pm"} }; require Fails'
>>>>>     oh noes at /tmp/Fails.pm line 2.
>>>>>     Compilation failed in require at -e line 1.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 20:43           ` Ævar Arnfjörð Bjarmason
  2017-06-07 21:06             ` Liam Breck
@ 2017-06-08  0:06             ` Samuel Lijin
  2017-06-08  0:26               ` Liam Breck
  2017-06-08  6:28               ` Ævar Arnfjörð Bjarmason
  1 sibling, 2 replies; 12+ messages in thread
From: Samuel Lijin @ 2017-06-08  0:06 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Liam Breck, Git Mailing List

On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch
> openssl, breaking the CPAN-built *.so object?
>
>> Agreed that send-email should be report errors properly. It's a rather
>> essential tool.
>
> Indeed, do you get a meaningful error if you apply my patch?

FWIW I'm on Arch as well and am getting what I assume is a related error:

SSLeay.c: loadable library and perl binaries are mismatched (got
handshake key 0xdb80080, needed 0xde00080)

The last patch I sent out was on 5/23, and I just ran a system upgrade
today (only one I've done since then), which presumably is what
"broke" send-email. I used CPAN to install Net::SMTP::SSL,
Mime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed
as a dependency of one of the three (presumably the first)?

I know Net::SSLeay isn't controlled by Arch's package manager:

$ perldoc -l Net::SSLeay
/usr/lib/perl5/site_perl/Net/SSLeay.pod
$ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod
error: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod

Ævar's patch unfortunately does not fix or change anything for me.

Liam: when you say "uninstall" /usr/{lib,share}/perl5/site_perl/*, do
you just mean rm -rf?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-08  0:06             ` Samuel Lijin
@ 2017-06-08  0:26               ` Liam Breck
  2017-06-08  6:28               ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 12+ messages in thread
From: Liam Breck @ 2017-06-08  0:26 UTC (permalink / raw)
  To: Samuel Lijin; +Cc: Ævar Arnfjörð Bjarmason, Git Mailing List

On Wed, Jun 7, 2017 at 5:06 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
> On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch
>> openssl, breaking the CPAN-built *.so object?
>>
>>> Agreed that send-email should be report errors properly. It's a rather
>>> essential tool.
>>
>> Indeed, do you get a meaningful error if you apply my patch?
>
> FWIW I'm on Arch as well and am getting what I assume is a related error:
>
> SSLeay.c: loadable library and perl binaries are mismatched (got
> handshake key 0xdb80080, needed 0xde00080)
>
> The last patch I sent out was on 5/23, and I just ran a system upgrade
> today (only one I've done since then), which presumably is what
> "broke" send-email. I used CPAN to install Net::SMTP::SSL,
> Mime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed
> as a dependency of one of the three (presumably the first)?
>
> I know Net::SSLeay isn't controlled by Arch's package manager:
>
> $ perldoc -l Net::SSLeay
> /usr/lib/perl5/site_perl/Net/SSLeay.pod
> $ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod
> error: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod
>
> Ævar's patch unfortunately does not fix or change anything for me.

Right because it attempts to log a diff issue.

> Liam: when you say "uninstall" /usr/{lib,share}/perl5/site_perl/*, do
> you just mean rm -rf?

You need these new arch packages:
perl-mime-tools perl-net-smtp-ssl perl-authen-sasl

To uninstall the cpan stuff I did this in case I need to put anything back

mkdir -p siteperl_uninstall/{lib,share}
sudo mv /usr/share/perl5/site_perl/*  siteperl_uninstall/share/
sudo mv /usr/lib/perl5/site_perl/*  siteperl_uninstall/lib/

You could comment on this issue here
https://bugs.archlinux.org/task/54334

.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-08  0:06             ` Samuel Lijin
  2017-06-08  0:26               ` Liam Breck
@ 2017-06-08  6:28               ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-08  6:28 UTC (permalink / raw)
  To: Samuel Lijin; +Cc: Liam Breck, Git Mailing List

On Thu, Jun 8, 2017 at 2:06 AM, Samuel Lijin <sxlijin@gmail.com> wrote:
> On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch
>> openssl, breaking the CPAN-built *.so object?
>>
>>> Agreed that send-email should be report errors properly. It's a rather
>>> essential tool.
>>
>> Indeed, do you get a meaningful error if you apply my patch?
>
> FWIW I'm on Arch as well and am getting what I assume is a related error:
>
> SSLeay.c: loadable library and perl binaries are mismatched (got
> handshake key 0xdb80080, needed 0xde00080)
>
> The last patch I sent out was on 5/23, and I just ran a system upgrade
> today (only one I've done since then), which presumably is what
> "broke" send-email. I used CPAN to install Net::SMTP::SSL,
> Mime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed
> as a dependency of one of the three (presumably the first)?
>
> I know Net::SSLeay isn't controlled by Arch's package manager:
>
> $ perldoc -l Net::SSLeay
> /usr/lib/perl5/site_perl/Net/SSLeay.pod
> $ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod
> error: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod
>
> Ævar's patch unfortunately does not fix or change anything for me.

It doesn't fix anything, it should make you get a better error message
when the thing does break, i.e. not an "Attempt to reload" error,
doesn't that happen? What error do you get with/without my patch?

> Liam: when you say "uninstall" /usr/{lib,share}/perl5/site_perl/*, do
> you just mean rm -rf?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: send-email: Net::SMTP::SSL failure
  2017-06-07 17:16   ` Ævar Arnfjörð Bjarmason
  2017-06-07 18:04     ` Liam Breck
@ 2017-06-09 16:37     ` Junio C Hamano
  1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2017-06-09 16:37 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Liam Breck, Git Mailing List

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I have not looked deeply at this, but the error you're getting means
> "we tried to load it before and failed, and here you are trying
> again".
>
> This is almost definitely due to this line in git-send-email:
>
>         if (eval { require Net::SMTP; 1 }) {
>
> And more generally, this code is all buggy:
>
>     4 matches for "eval.*require" in buffer: git-send-email.perl
>     153:my $have_email_valid = eval { require Email::Valid; 1 };
>     154:my $have_mail_address = eval { require Mail::Address; 1 };
>    1118:        if (eval { require Net::Domain; 1 }) {
>    1129:        if (eval { require Net::SMTP; 1 }) {
>
> Well, "buggy" in the sense that we're just happy-go-lucky trying to
> load these modules, and if they have an error we don't report it, then
> when we try to load them again perl just emits a generic error saying
> you're trying to require() something that already failed somewhere
> before...

Thanks for the discussion.  My short summary from reading the thread
from the sideline is:

 * "eval { require module; 1 }" pattern seems to have spread by
   copying and pasting without thinking, all of which should be
   corrected not to retry;

 * The error OP encountered is not an issue in git-send-email
   per-se, but was made harder to diagnose due to the above.

I think we still lack the definite "here is the right way to fix
these not to retry" patch for application, but anything else I
missed?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-06-09 16:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07  5:47 send-email: Net::SMTP::SSL failure Liam Breck
2017-06-07 17:00 ` Liam Breck
2017-06-07 17:16   ` Ævar Arnfjörð Bjarmason
2017-06-07 18:04     ` Liam Breck
2017-06-07 19:30       ` Ævar Arnfjörð Bjarmason
2017-06-07 19:39         ` Liam Breck
2017-06-07 20:43           ` Ævar Arnfjörð Bjarmason
2017-06-07 21:06             ` Liam Breck
2017-06-08  0:06             ` Samuel Lijin
2017-06-08  0:26               ` Liam Breck
2017-06-08  6:28               ` Ævar Arnfjörð Bjarmason
2017-06-09 16:37     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).