{"thread":{"id":"46130","subject":"send-email: Net::SMTP::SSL failure","startedAt":"2017-06-07T05:47:49Z","lastAt":"2017-06-09T16:37:16Z","messageCount":12,"participants":["Liam Breck","Ævar Arnfjörð Bjarmason","Samuel Lijin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321662","messageId":"CAKvHMgTBmdKrz-i9-uBFtx08pegjuY2=jKQE21pi=MabTuicrw@mail.gmail.com","threadId":"46130","inReplyTo":null,"subject":"send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-07T05:47:38Z","receivedAt":"2017-06-07T05:47:49Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"This is configured to send via a gmail account\ngit send-email --to-cover --cc-cover <patch-list>\n\nI See\nAttempt to reload IO/Socket/SSL.pm aborted.\nCompilation failed in require at\n/usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\nBEGIN failed--compilation aborted at\n/usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\nCompilation failed in require at /usr/lib/git-core/git-send-email line 1386.\nfatal: 'send-email' appears to be a git command, but we were not\nable to execute it. Maybe git-send-email is broken?\n\nNet/SMTP/SSL.pm v1.04\n\nperl v5.26.0\n\nSeen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n"},{"id":"321691","messageId":"CAKvHMgSgOyDhffPm=-QEQNzoCoPtmWbV_R7JDtBFTHQ-sL3Wug@mail.gmail.com","threadId":"46130","inReplyTo":"CAKvHMgTBmdKrz-i9-uBFtx08pegjuY2=jKQE21pi=MabTuicrw@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-07T17:00:02Z","receivedAt":"2017-06-07T17:00:12Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>\n> This is configured to send via a gmail account\n> git send-email --to-cover --cc-cover <patch-list>\n>\n> I See\n> Attempt to reload IO/Socket/SSL.pm aborted.\n> Compilation failed in require at\n> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n> BEGIN failed--compilation aborted at\n> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n> fatal: 'send-email' appears to be a git command, but we were not\n> able to execute it. Maybe git-send-email is broken?\n>\n> Net/SMTP/SSL.pm v1.04\n>\n> perl v5.26.0\n>\n> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n\nAlso fails with perl 5.24.1 & 5.24.0\n\nLast working config was git 2.9.3 on perl 5.24.1\n\nThe relevant code from git-send-email is:\n\n            require Net::SMTP;\n            $smtp_domain ||= maildomain();\n            $smtp_server_port ||= 25;\n            $smtp ||= Net::SMTP->new($smtp_server,\n                         Hello => $smtp_domain,\n                         Debug => $debug_net_smtp,\n                         Port => $smtp_server_port);\n            if ($smtp_encryption eq 'tls' && $smtp) {\n                require Net::SMTP::SSL;\n                $smtp->command('STARTTLS');\n\nI really wish git bundled its non-core perl libs...\n.\n"},{"id":"321692","messageId":"CACBZZX6AKYA5PmE6Le4cxCTCOOix1ErHyT21C=L83CQBYaN=RQ@mail.gmail.com","threadId":"46130","inReplyTo":"CAKvHMgSgOyDhffPm=-QEQNzoCoPtmWbV_R7JDtBFTHQ-sL3Wug@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-07T17:16:41Z","receivedAt":"2017-06-07T17:17:11Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>\n>> This is configured to send via a gmail account\n>> git send-email --to-cover --cc-cover <patch-list>\n>>\n>> I See\n>> Attempt to reload IO/Socket/SSL.pm aborted.\n>> Compilation failed in require at\n>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>> BEGIN failed--compilation aborted at\n>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>> fatal: 'send-email' appears to be a git command, but we were not\n>> able to execute it. Maybe git-send-email is broken?\n>>\n>> Net/SMTP/SSL.pm v1.04\n>>\n>> perl v5.26.0\n>>\n>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>\n> Also fails with perl 5.24.1 & 5.24.0\n>\n> Last working config was git 2.9.3 on perl 5.24.1\n>\n> The relevant code from git-send-email is:\n>\n>             require Net::SMTP;\n>             $smtp_domain ||= maildomain();\n>             $smtp_server_port ||= 25;\n>             $smtp ||= Net::SMTP->new($smtp_server,\n>                          Hello => $smtp_domain,\n>                          Debug => $debug_net_smtp,\n>                          Port => $smtp_server_port);\n>             if ($smtp_encryption eq 'tls' && $smtp) {\n>                 require Net::SMTP::SSL;\n>                 $smtp->command('STARTTLS');\n>\n> I really wish git bundled its non-core perl libs...\n\nWhat's the output from just:\n\n    perl -MNet::SMTP -we1\n\nI have not looked deeply at this, but the error you're getting means\n\"we tried to load it before and failed, and here you are trying\nagain\".\n\nThis is almost definitely due to this line in git-send-email:\n\n        if (eval { require Net::SMTP; 1 }) {\n\nAnd more generally, this code is all buggy:\n\n    4 matches for \"eval.*require\" in buffer: git-send-email.perl\n    153:my $have_email_valid = eval { require Email::Valid; 1 };\n    154:my $have_mail_address = eval { require Mail::Address; 1 };\n   1118:        if (eval { require Net::Domain; 1 }) {\n   1129:        if (eval { require Net::SMTP; 1 }) {\n\nWell, \"buggy\" in the sense that we're just happy-go-lucky trying to\nload these modules, and if they have an error we don't report it, then\nwhen we try to load them again perl just emits a generic error saying\nyou're trying to require() something that already failed somewhere\nbefore, a minimal test case for that is:\n\n    $ cat /tmp/Fails.pm\n    package Fails;\n    die \"oh noes\";\n    $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n    Attempt to reload Fails.pm aborted.\n    Compilation failed in require at -e line 1.\n\nWhereas what we really want to do is some variant of:\n\n    $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n$@; require Fails'\n    oh noes at /tmp/Fails.pm line 2.\n    Compilation failed in require at -e line 1.\n    Attempt to reload Fails.pm aborted.\n    Compilation failed in require at -e line 1.\n\nOr even the more adventerous, this can have some bad side-effects with\nsome libraries (you lie to perl saying you haven't seen it before),\nbut I doubt Net::SMTP cares much, particularly when we're just about\nto report an error:\n\n    $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\ndelete $INC{\"Fails.pm\"} }; require Fails'\n    oh noes at /tmp/Fails.pm line 2.\n    Compilation failed in require at -e line 1.\n"},{"id":"321696","messageId":"CAKvHMgRpS3AgRAm1ukH18kX5jNF6PEU8YTsq7mQ36myQgRe=Pw@mail.gmail.com","threadId":"46130","inReplyTo":"CACBZZX6AKYA5PmE6Le4cxCTCOOix1ErHyT21C=L83CQBYaN=RQ@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-07T18:04:58Z","receivedAt":"2017-06-07T18:05:08Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"Thanks for your help!\n\nOn Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>\n>>> This is configured to send via a gmail account\n>>> git send-email --to-cover --cc-cover <patch-list>\n>>>\n>>> I See\n>>> Attempt to reload IO/Socket/SSL.pm aborted.\n>>> Compilation failed in require at\n>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>> BEGIN failed--compilation aborted at\n>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>>> fatal: 'send-email' appears to be a git command, but we were not\n>>> able to execute it. Maybe git-send-email is broken?\n>>>\n>>> Net/SMTP/SSL.pm v1.04\n>>>\n>>> perl v5.26.0\n>>>\n>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>>\n>> Also fails with perl 5.24.1 & 5.24.0\n>>\n>> Last working config was git 2.9.3 on perl 5.24.1\n>>\n>> The relevant code from git-send-email is:\n>>\n>>             require Net::SMTP;\n>>             $smtp_domain ||= maildomain();\n>>             $smtp_server_port ||= 25;\n>>             $smtp ||= Net::SMTP->new($smtp_server,\n>>                          Hello => $smtp_domain,\n>>                          Debug => $debug_net_smtp,\n>>                          Port => $smtp_server_port);\n>>             if ($smtp_encryption eq 'tls' && $smtp) {\n>>                 require Net::SMTP::SSL;\n>>                 $smtp->command('STARTTLS');\n>>\n>> I really wish git bundled its non-core perl libs...\n>\n> What's the output from just:\n>\n>     perl -MNet::SMTP -we1\n\nNo output, exit code 0, however...\n\n$ perl -MIO::Socket::SSL -we1\nCan't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for\nmodule Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:\nNo such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm\nline 193.\nat /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\nCompilation failed in require at\n/usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\nBEGIN failed--compilation aborted at\n/usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\nCompilation failed in require.\nBEGIN failed--compilation aborted.\n\nI don't have {vendor,site}_perl/auto/ tho I have the package for\nssleay installed.\n\nSince which git release was that required?\n\n\n> I have not looked deeply at this, but the error you're getting means\n> \"we tried to load it before and failed, and here you are trying\n> again\".\n>\n> This is almost definitely due to this line in git-send-email:\n>\n>         if (eval { require Net::SMTP; 1 }) {\n>\n> And more generally, this code is all buggy:\n>\n>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>    1118:        if (eval { require Net::Domain; 1 }) {\n>    1129:        if (eval { require Net::SMTP; 1 }) {\n>\n> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n> load these modules, and if they have an error we don't report it, then\n> when we try to load them again perl just emits a generic error saying\n> you're trying to require() something that already failed somewhere\n> before, a minimal test case for that is:\n>\n>     $ cat /tmp/Fails.pm\n>     package Fails;\n>     die \"oh noes\";\n>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n>     Attempt to reload Fails.pm aborted.\n>     Compilation failed in require at -e line 1.\n>\n> Whereas what we really want to do is some variant of:\n>\n>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n> $@; require Fails'\n>     oh noes at /tmp/Fails.pm line 2.\n>     Compilation failed in require at -e line 1.\n>     Attempt to reload Fails.pm aborted.\n>     Compilation failed in require at -e line 1.\n>\n> Or even the more adventerous, this can have some bad side-effects with\n> some libraries (you lie to perl saying you haven't seen it before),\n> but I doubt Net::SMTP cares much, particularly when we're just about\n> to report an error:\n>\n>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\n> delete $INC{\"Fails.pm\"} }; require Fails'\n>     oh noes at /tmp/Fails.pm line 2.\n>     Compilation failed in require at -e line 1.\n"},{"id":"321705","messageId":"CACBZZX5dwUq58nghuMqnuGfe9sPm1VBxVwZGZcTCYgeO5OdyTg@mail.gmail.com","threadId":"46130","inReplyTo":"CAKvHMgRpS3AgRAm1ukH18kX5jNF6PEU8YTsq7mQ36myQgRe=Pw@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-07T19:30:05Z","receivedAt":"2017-06-07T19:30:37Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:\n> Thanks for your help!\n>\n> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>\n>>>> This is configured to send via a gmail account\n>>>> git send-email --to-cover --cc-cover <patch-list>\n>>>>\n>>>> I See\n>>>> Attempt to reload IO/Socket/SSL.pm aborted.\n>>>> Compilation failed in require at\n>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>> BEGIN failed--compilation aborted at\n>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>>>> fatal: 'send-email' appears to be a git command, but we were not\n>>>> able to execute it. Maybe git-send-email is broken?\n>>>>\n>>>> Net/SMTP/SSL.pm v1.04\n>>>>\n>>>> perl v5.26.0\n>>>>\n>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>>>\n>>> Also fails with perl 5.24.1 & 5.24.0\n>>>\n>>> Last working config was git 2.9.3 on perl 5.24.1\n>>>\n>>> The relevant code from git-send-email is:\n>>>\n>>>             require Net::SMTP;\n>>>             $smtp_domain ||= maildomain();\n>>>             $smtp_server_port ||= 25;\n>>>             $smtp ||= Net::SMTP->new($smtp_server,\n>>>                          Hello => $smtp_domain,\n>>>                          Debug => $debug_net_smtp,\n>>>                          Port => $smtp_server_port);\n>>>             if ($smtp_encryption eq 'tls' && $smtp) {\n>>>                 require Net::SMTP::SSL;\n>>>                 $smtp->command('STARTTLS');\n>>>\n>>> I really wish git bundled its non-core perl libs...\n>>\n>> What's the output from just:\n>>\n>>     perl -MNet::SMTP -we1\n>\n> No output, exit code 0, however...\n>\n> $ perl -MIO::Socket::SSL -we1\n> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for\n> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:\n> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm\n> line 193.\n> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n> Compilation failed in require at\n> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n> BEGIN failed--compilation aborted at\n> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n> Compilation failed in require.\n> BEGIN failed--compilation aborted.\n>\n> I don't have {vendor,site}_perl/auto/ tho I have the package for\n> ssleay installed.\n>\n> Since which git release was that required?\n\nThe actual issue here is that your Net::SSLeay package is broken\nbecause it's linked to libssl.so.1.0.0 which has since gone away. You\nshould see that it's missing if you run whatever the Arch equivalent\nis of these Debian commands:\n\n    $ dpkg -L libnet-ssleay-perl|grep \\.so$\n    /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n    $ /usr/bin/perldoc -l Net::SSLeay\n    /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n    $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n    libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n    $ dpkg -L libnet-ssleay-perl|grep \\.so$\n    /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n    $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n2>&1|grep libssl\n            libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n(0x00007f2523bb5000)\n    $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n    libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n\nBut that this isn't reported is a bug in git-send-email. This\n(untested) patch is probably the least invasive and easiest way to\ndeal with this:\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 7fd5874436..3f0fcf9040 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1354,6 +1354,8 @@ EOF\n                        die __(\"The required SMTP server is not\nproperly defined.\")\n                }\n\n+               delete $INC{\"Net/SMTP.pm\"} if exists $INC{\"Net/SMTP.pm\"}\n+                                             and !defined $INC{\"Net/SMTP.pm\"};\n                require Net::SMTP;\n                my $use_net_smtp_ssl =\nversion->parse($Net::SMTP::VERSION) < version->parse(\"2.34\");\n                $smtp_domain ||= maildomain();\n\non closer inspection none of the other require() uses in that script\nare run twice, so they don't have the same issue with hiding the\ninitial error.\n\n\n>> I have not looked deeply at this, but the error you're getting means\n>> \"we tried to load it before and failed, and here you are trying\n>> again\".\n>>\n>> This is almost definitely due to this line in git-send-email:\n>>\n>>         if (eval { require Net::SMTP; 1 }) {\n>>\n>> And more generally, this code is all buggy:\n>>\n>>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>>    1118:        if (eval { require Net::Domain; 1 }) {\n>>    1129:        if (eval { require Net::SMTP; 1 }) {\n>>\n>> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n>> load these modules, and if they have an error we don't report it, then\n>> when we try to load them again perl just emits a generic error saying\n>> you're trying to require() something that already failed somewhere\n>> before, a minimal test case for that is:\n>>\n>>     $ cat /tmp/Fails.pm\n>>     package Fails;\n>>     die \"oh noes\";\n>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n>>     Attempt to reload Fails.pm aborted.\n>>     Compilation failed in require at -e line 1.\n>>\n>> Whereas what we really want to do is some variant of:\n>>\n>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n>> $@; require Fails'\n>>     oh noes at /tmp/Fails.pm line 2.\n>>     Compilation failed in require at -e line 1.\n>>     Attempt to reload Fails.pm aborted.\n>>     Compilation failed in require at -e line 1.\n>>\n>> Or even the more adventerous, this can have some bad side-effects with\n>> some libraries (you lie to perl saying you haven't seen it before),\n>> but I doubt Net::SMTP cares much, particularly when we're just about\n>> to report an error:\n>>\n>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\n>> delete $INC{\"Fails.pm\"} }; require Fails'\n>>     oh noes at /tmp/Fails.pm line 2.\n>>     Compilation failed in require at -e line 1.\n"},{"id":"321706","messageId":"CAKvHMgQB7fR+2O4AUYNn0JF13fxf3m-gJ70yPUEdqRkyfC-q+w@mail.gmail.com","threadId":"46130","inReplyTo":"CACBZZX5dwUq58nghuMqnuGfe9sPm1VBxVwZGZcTCYgeO5OdyTg@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-07T19:39:32Z","receivedAt":"2017-06-07T19:39:42Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:\n>> Thanks for your help!\n>>\n>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason\n>> <avarab@gmail.com> wrote:\n>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>>\n>>>>> This is configured to send via a gmail account\n>>>>> git send-email --to-cover --cc-cover <patch-list>\n>>>>>\n>>>>> I See\n>>>>> Attempt to reload IO/Socket/SSL.pm aborted.\n>>>>> Compilation failed in require at\n>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>> BEGIN failed--compilation aborted at\n>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>>>>> fatal: 'send-email' appears to be a git command, but we were not\n>>>>> able to execute it. Maybe git-send-email is broken?\n>>>>>\n>>>>> Net/SMTP/SSL.pm v1.04\n>>>>>\n>>>>> perl v5.26.0\n>>>>>\n>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>>>>\n>>>> Also fails with perl 5.24.1 & 5.24.0\n>>>>\n>>>> Last working config was git 2.9.3 on perl 5.24.1\n>>>>\n>>>> The relevant code from git-send-email is:\n>>>>\n>>>>             require Net::SMTP;\n>>>>             $smtp_domain ||= maildomain();\n>>>>             $smtp_server_port ||= 25;\n>>>>             $smtp ||= Net::SMTP->new($smtp_server,\n>>>>                          Hello => $smtp_domain,\n>>>>                          Debug => $debug_net_smtp,\n>>>>                          Port => $smtp_server_port);\n>>>>             if ($smtp_encryption eq 'tls' && $smtp) {\n>>>>                 require Net::SMTP::SSL;\n>>>>                 $smtp->command('STARTTLS');\n>>>>\n>>>> I really wish git bundled its non-core perl libs...\n>>>\n>>> What's the output from just:\n>>>\n>>>     perl -MNet::SMTP -we1\n>>\n>> No output, exit code 0, however...\n>>\n>> $ perl -MIO::Socket::SSL -we1\n>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for\n>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:\n>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm\n>> line 193.\n>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>> Compilation failed in require at\n>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>> BEGIN failed--compilation aborted at\n>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>> Compilation failed in require.\n>> BEGIN failed--compilation aborted.\n>>\n>> I don't have {vendor,site}_perl/auto/ tho I have the package for\n>> ssleay installed.\n>>\n>> Since which git release was that required?\n>\n> The actual issue here is that your Net::SSLeay package is broken\n> because it's linked to libssl.so.1.0.0 which has since gone away. You\n> should see that it's missing if you run whatever the Arch equivalent\n> is of these Debian commands:\n>\n>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>     $ /usr/bin/perldoc -l Net::SSLeay\n>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n> 2>&1|grep libssl\n>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n> (0x00007f2523bb5000)\n>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>\n> But that this isn't reported is a bug in git-send-email. This\n> (untested) patch is probably the least invasive and easiest way to\n> deal with this:\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 7fd5874436..3f0fcf9040 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1354,6 +1354,8 @@ EOF\n>                         die __(\"The required SMTP server is not\n> properly defined.\")\n>                 }\n>\n> +               delete $INC{\"Net/SMTP.pm\"} if exists $INC{\"Net/SMTP.pm\"}\n> +                                             and !defined $INC{\"Net/SMTP.pm\"};\n>                 require Net::SMTP;\n>                 my $use_net_smtp_ssl =\n> version->parse($Net::SMTP::VERSION) < version->parse(\"2.34\");\n>                 $smtp_domain ||= maildomain();\n>\n> on closer inspection none of the other require() uses in that script\n> are run twice, so they don't have the same issue with hiding the\n> initial error.\n\nArch didn't have packages for these perl modules until recently,\nforcing git users to install them with cpan. And then the new packages\ndidn't emit a warning about checking for conflicts in the site_perl/\ndirectories. Grrr.\n\nFixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had\nonly cleaned out share/ previously.\n\nAgreed that send-email should be report errors properly. It's a rather\nessential tool.\n\n>>> I have not looked deeply at this, but the error you're getting means\n>>> \"we tried to load it before and failed, and here you are trying\n>>> again\".\n>>>\n>>> This is almost definitely due to this line in git-send-email:\n>>>\n>>>         if (eval { require Net::SMTP; 1 }) {\n>>>\n>>> And more generally, this code is all buggy:\n>>>\n>>>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>>>    1118:        if (eval { require Net::Domain; 1 }) {\n>>>    1129:        if (eval { require Net::SMTP; 1 }) {\n>>>\n>>> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n>>> load these modules, and if they have an error we don't report it, then\n>>> when we try to load them again perl just emits a generic error saying\n>>> you're trying to require() something that already failed somewhere\n>>> before, a minimal test case for that is:\n>>>\n>>>     $ cat /tmp/Fails.pm\n>>>     package Fails;\n>>>     die \"oh noes\";\n>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n>>>     Attempt to reload Fails.pm aborted.\n>>>     Compilation failed in require at -e line 1.\n>>>\n>>> Whereas what we really want to do is some variant of:\n>>>\n>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n>>> $@; require Fails'\n>>>     oh noes at /tmp/Fails.pm line 2.\n>>>     Compilation failed in require at -e line 1.\n>>>     Attempt to reload Fails.pm aborted.\n>>>     Compilation failed in require at -e line 1.\n>>>\n>>> Or even the more adventerous, this can have some bad side-effects with\n>>> some libraries (you lie to perl saying you haven't seen it before),\n>>> but I doubt Net::SMTP cares much, particularly when we're just about\n>>> to report an error:\n>>>\n>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\n>>> delete $INC{\"Fails.pm\"} }; require Fails'\n>>>     oh noes at /tmp/Fails.pm line 2.\n>>>     Compilation failed in require at -e line 1.\n"},{"id":"321709","messageId":"CACBZZX5Zdn5XpjsWchww+LxyqN+Y=BqrGJ6wrXUW3PnRcsw-fQ@mail.gmail.com","threadId":"46130","inReplyTo":"CAKvHMgQB7fR+2O4AUYNn0JF13fxf3m-gJ70yPUEdqRkyfC-q+w@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-07T20:43:39Z","receivedAt":"2017-06-07T20:44:14Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Jun 7, 2017 at 9:39 PM, Liam Breck <liam@networkimprov.net> wrote:\n> On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>> Thanks for your help!\n>>>\n>>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason\n>>> <avarab@gmail.com> wrote:\n>>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>>>\n>>>>>> This is configured to send via a gmail account\n>>>>>> git send-email --to-cover --cc-cover <patch-list>\n>>>>>>\n>>>>>> I See\n>>>>>> Attempt to reload IO/Socket/SSL.pm aborted.\n>>>>>> Compilation failed in require at\n>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>>> BEGIN failed--compilation aborted at\n>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>>>>>> fatal: 'send-email' appears to be a git command, but we were not\n>>>>>> able to execute it. Maybe git-send-email is broken?\n>>>>>>\n>>>>>> Net/SMTP/SSL.pm v1.04\n>>>>>>\n>>>>>> perl v5.26.0\n>>>>>>\n>>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>>>>>\n>>>>> Also fails with perl 5.24.1 & 5.24.0\n>>>>>\n>>>>> Last working config was git 2.9.3 on perl 5.24.1\n>>>>>\n>>>>> The relevant code from git-send-email is:\n>>>>>\n>>>>>             require Net::SMTP;\n>>>>>             $smtp_domain ||= maildomain();\n>>>>>             $smtp_server_port ||= 25;\n>>>>>             $smtp ||= Net::SMTP->new($smtp_server,\n>>>>>                          Hello => $smtp_domain,\n>>>>>                          Debug => $debug_net_smtp,\n>>>>>                          Port => $smtp_server_port);\n>>>>>             if ($smtp_encryption eq 'tls' && $smtp) {\n>>>>>                 require Net::SMTP::SSL;\n>>>>>                 $smtp->command('STARTTLS');\n>>>>>\n>>>>> I really wish git bundled its non-core perl libs...\n>>>>\n>>>> What's the output from just:\n>>>>\n>>>>     perl -MNet::SMTP -we1\n>>>\n>>> No output, exit code 0, however...\n>>>\n>>> $ perl -MIO::Socket::SSL -we1\n>>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for\n>>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:\n>>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm\n>>> line 193.\n>>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>> Compilation failed in require at\n>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>> BEGIN failed--compilation aborted at\n>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>> Compilation failed in require.\n>>> BEGIN failed--compilation aborted.\n>>>\n>>> I don't have {vendor,site}_perl/auto/ tho I have the package for\n>>> ssleay installed.\n>>>\n>>> Since which git release was that required?\n>>\n>> The actual issue here is that your Net::SSLeay package is broken\n>> because it's linked to libssl.so.1.0.0 which has since gone away. You\n>> should see that it's missing if you run whatever the Arch equivalent\n>> is of these Debian commands:\n>>\n>>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>>     $ /usr/bin/perldoc -l Net::SSLeay\n>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>> 2>&1|grep libssl\n>>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>> (0x00007f2523bb5000)\n>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>>\n>> But that this isn't reported is a bug in git-send-email. This\n>> (untested) patch is probably the least invasive and easiest way to\n>> deal with this:\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index 7fd5874436..3f0fcf9040 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1354,6 +1354,8 @@ EOF\n>>                         die __(\"The required SMTP server is not\n>> properly defined.\")\n>>                 }\n>>\n>> +               delete $INC{\"Net/SMTP.pm\"} if exists $INC{\"Net/SMTP.pm\"}\n>> +                                             and !defined $INC{\"Net/SMTP.pm\"};\n>>                 require Net::SMTP;\n>>                 my $use_net_smtp_ssl =\n>> version->parse($Net::SMTP::VERSION) < version->parse(\"2.34\");\n>>                 $smtp_domain ||= maildomain();\n>>\n>> on closer inspection none of the other require() uses in that script\n>> are run twice, so they don't have the same issue with hiding the\n>> initial error.\n>\n> Arch didn't have packages for these perl modules until recently,\n> forcing git users to install them with cpan. And then the new packages\n> didn't emit a warning about checking for conflicts in the site_perl/\n> directories. Grrr.\n>\n> Fixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had\n> only cleaned out share/ previously.\n\nAh, so you installed Net::SSLeay via CPAN, and then upgraded your Arch\nopenssl, breaking the CPAN-built *.so object?\n\n> Agreed that send-email should be report errors properly. It's a rather\n> essential tool.\n\nIndeed, do you get a meaningful error if you apply my patch?\n\n>>>> I have not looked deeply at this, but the error you're getting means\n>>>> \"we tried to load it before and failed, and here you are trying\n>>>> again\".\n>>>>\n>>>> This is almost definitely due to this line in git-send-email:\n>>>>\n>>>>         if (eval { require Net::SMTP; 1 }) {\n>>>>\n>>>> And more generally, this code is all buggy:\n>>>>\n>>>>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>>>>    1118:        if (eval { require Net::Domain; 1 }) {\n>>>>    1129:        if (eval { require Net::SMTP; 1 }) {\n>>>>\n>>>> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n>>>> load these modules, and if they have an error we don't report it, then\n>>>> when we try to load them again perl just emits a generic error saying\n>>>> you're trying to require() something that already failed somewhere\n>>>> before, a minimal test case for that is:\n>>>>\n>>>>     $ cat /tmp/Fails.pm\n>>>>     package Fails;\n>>>>     die \"oh noes\";\n>>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n>>>>     Attempt to reload Fails.pm aborted.\n>>>>     Compilation failed in require at -e line 1.\n>>>>\n>>>> Whereas what we really want to do is some variant of:\n>>>>\n>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n>>>> $@; require Fails'\n>>>>     oh noes at /tmp/Fails.pm line 2.\n>>>>     Compilation failed in require at -e line 1.\n>>>>     Attempt to reload Fails.pm aborted.\n>>>>     Compilation failed in require at -e line 1.\n>>>>\n>>>> Or even the more adventerous, this can have some bad side-effects with\n>>>> some libraries (you lie to perl saying you haven't seen it before),\n>>>> but I doubt Net::SMTP cares much, particularly when we're just about\n>>>> to report an error:\n>>>>\n>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\n>>>> delete $INC{\"Fails.pm\"} }; require Fails'\n>>>>     oh noes at /tmp/Fails.pm line 2.\n>>>>     Compilation failed in require at -e line 1.\n"},{"id":"321711","messageId":"CAKvHMgTS+JozeB6b+qvJGvjRv=5CZZhcVi3sGMww_gWpuWu9uA@mail.gmail.com","threadId":"46130","inReplyTo":"CACBZZX5Zdn5XpjsWchww+LxyqN+Y=BqrGJ6wrXUW3PnRcsw-fQ@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-07T21:06:49Z","receivedAt":"2017-06-07T21:06:59Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"On Wed, Jun 7, 2017 at 1:43 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Wed, Jun 7, 2017 at 9:39 PM, Liam Breck <liam@networkimprov.net> wrote:\n>> On Wed, Jun 7, 2017 at 12:30 PM, Ævar Arnfjörð Bjarmason\n>> <avarab@gmail.com> wrote:\n>>> On Wed, Jun 7, 2017 at 8:04 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>> Thanks for your help!\n>>>>\n>>>> On Wed, Jun 7, 2017 at 10:16 AM, Ævar Arnfjörð Bjarmason\n>>>> <avarab@gmail.com> wrote:\n>>>>> On Wed, Jun 7, 2017 at 7:00 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>>> On Tue, Jun 6, 2017 at 10:47 PM, Liam Breck <liam@networkimprov.net> wrote:\n>>>>>>>\n>>>>>>> This is configured to send via a gmail account\n>>>>>>> git send-email --to-cover --cc-cover <patch-list>\n>>>>>>>\n>>>>>>> I See\n>>>>>>> Attempt to reload IO/Socket/SSL.pm aborted.\n>>>>>>> Compilation failed in require at\n>>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>>>> BEGIN failed--compilation aborted at\n>>>>>>> /usr/share/perl5/vendor_perl/Net/SMTP/SSL.pm line 6.\n>>>>>>> Compilation failed in require at /usr/lib/git-core/git-send-email line 1386.\n>>>>>>> fatal: 'send-email' appears to be a git command, but we were not\n>>>>>>> able to execute it. Maybe git-send-email is broken?\n>>>>>>>\n>>>>>>> Net/SMTP/SSL.pm v1.04\n>>>>>>>\n>>>>>>> perl v5.26.0\n>>>>>>>\n>>>>>>> Seen in git 2.11.1, 2.12.2, 2.13.0, 2.13.1 on Arch Linux\n>>>>>>\n>>>>>> Also fails with perl 5.24.1 & 5.24.0\n>>>>>>\n>>>>>> Last working config was git 2.9.3 on perl 5.24.1\n>>>>>>\n>>>>>> The relevant code from git-send-email is:\n>>>>>>\n>>>>>>             require Net::SMTP;\n>>>>>>             $smtp_domain ||= maildomain();\n>>>>>>             $smtp_server_port ||= 25;\n>>>>>>             $smtp ||= Net::SMTP->new($smtp_server,\n>>>>>>                          Hello => $smtp_domain,\n>>>>>>                          Debug => $debug_net_smtp,\n>>>>>>                          Port => $smtp_server_port);\n>>>>>>             if ($smtp_encryption eq 'tls' && $smtp) {\n>>>>>>                 require Net::SMTP::SSL;\n>>>>>>                 $smtp->command('STARTTLS');\n>>>>>>\n>>>>>> I really wish git bundled its non-core perl libs...\n>>>>>\n>>>>> What's the output from just:\n>>>>>\n>>>>>     perl -MNet::SMTP -we1\n>>>>\n>>>> No output, exit code 0, however...\n>>>>\n>>>> $ perl -MIO::Socket::SSL -we1\n>>>> Can't load '/usr/lib/perl5/site_perl/auto/Net/SSLeay/SSLeay.so' for\n>>>> module Net::SSLeay: libssl.so.1.0.0: cannot open shared object file:\n>>>> No such file or directory at /usr/lib/perl5/core_perl/DynaLoader.pm\n>>>> line 193.\n>>>> at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>>> Compilation failed in require at\n>>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>>> BEGIN failed--compilation aborted at\n>>>> /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 19.\n>>>> Compilation failed in require.\n>>>> BEGIN failed--compilation aborted.\n>>>>\n>>>> I don't have {vendor,site}_perl/auto/ tho I have the package for\n>>>> ssleay installed.\n>>>>\n>>>> Since which git release was that required?\n>>>\n>>> The actual issue here is that your Net::SSLeay package is broken\n>>> because it's linked to libssl.so.1.0.0 which has since gone away. You\n>>> should see that it's missing if you run whatever the Arch equivalent\n>>> is of these Debian commands:\n>>>\n>>>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>>>     $ /usr/bin/perldoc -l Net::SSLeay\n>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>>     libnet-ssleay-perl: /usr/lib/x86_64-linux-gnu/perl5/5.24/Net/SSLeay.pod\n>>>     $ dpkg -L libnet-ssleay-perl|grep \\.so$\n>>>     /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>>>     $ ldd -r /usr/lib/x86_64-linux-gnu/perl5/5.24/auto/Net/SSLeay/SSLeay.so\n>>> 2>&1|grep libssl\n>>>             libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>>> (0x00007f2523bb5000)\n>>>     $ dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>>>     libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1\n>>>\n>>> But that this isn't reported is a bug in git-send-email. This\n>>> (untested) patch is probably the least invasive and easiest way to\n>>> deal with this:\n>>>\n>>> diff --git a/git-send-email.perl b/git-send-email.perl\n>>> index 7fd5874436..3f0fcf9040 100755\n>>> --- a/git-send-email.perl\n>>> +++ b/git-send-email.perl\n>>> @@ -1354,6 +1354,8 @@ EOF\n>>>                         die __(\"The required SMTP server is not\n>>> properly defined.\")\n>>>                 }\n>>>\n>>> +               delete $INC{\"Net/SMTP.pm\"} if exists $INC{\"Net/SMTP.pm\"}\n>>> +                                             and !defined $INC{\"Net/SMTP.pm\"};\n>>>                 require Net::SMTP;\n>>>                 my $use_net_smtp_ssl =\n>>> version->parse($Net::SMTP::VERSION) < version->parse(\"2.34\");\n>>>                 $smtp_domain ||= maildomain();\n>>>\n>>> on closer inspection none of the other require() uses in that script\n>>> are run twice, so they don't have the same issue with hiding the\n>>> initial error.\n>>\n>> Arch didn't have packages for these perl modules until recently,\n>> forcing git users to install them with cpan. And then the new packages\n>> didn't emit a warning about checking for conflicts in the site_perl/\n>> directories. Grrr.\n>>\n>> Fixed this by uninstalling /usr/{lib,share}/perl5/site_perl/* I had\n>> only cleaned out share/ previously.\n>\n> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch\n> openssl, breaking the CPAN-built *.so object?\n\nTrouble started after an Arch system upgrade which didn't uninstall\nsite_perl/*, so yes probably. I actually fixed the problem first by\ninstalling SSLeay via cpan, then noticed where it installed and\nremoved all the cpan stuff.\n\n>> Agreed that send-email should be report errors properly. It's a rather\n>> essential tool.\n>\n> Indeed, do you get a meaningful error if you apply my patch?\n\nI'm not a git hacker, so I'm not set up to test this quickly, and I\nlost a day's work trying to fix Arch :-(\n\n>>>>> I have not looked deeply at this, but the error you're getting means\n>>>>> \"we tried to load it before and failed, and here you are trying\n>>>>> again\".\n>>>>>\n>>>>> This is almost definitely due to this line in git-send-email:\n>>>>>\n>>>>>         if (eval { require Net::SMTP; 1 }) {\n>>>>>\n>>>>> And more generally, this code is all buggy:\n>>>>>\n>>>>>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>>>>>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>>>>>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>>>>>    1118:        if (eval { require Net::Domain; 1 }) {\n>>>>>    1129:        if (eval { require Net::SMTP; 1 }) {\n>>>>>\n>>>>> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n>>>>> load these modules, and if they have an error we don't report it, then\n>>>>> when we try to load them again perl just emits a generic error saying\n>>>>> you're trying to require() something that already failed somewhere\n>>>>> before, a minimal test case for that is:\n>>>>>\n>>>>>     $ cat /tmp/Fails.pm\n>>>>>     package Fails;\n>>>>>     die \"oh noes\";\n>>>>>     $ perl -I/tmp -we 'eval { require Fails }; require Fails'\n>>>>>     Attempt to reload Fails.pm aborted.\n>>>>>     Compilation failed in require at -e line 1.\n>>>>>\n>>>>> Whereas what we really want to do is some variant of:\n>>>>>\n>>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or warn\n>>>>> $@; require Fails'\n>>>>>     oh noes at /tmp/Fails.pm line 2.\n>>>>>     Compilation failed in require at -e line 1.\n>>>>>     Attempt to reload Fails.pm aborted.\n>>>>>     Compilation failed in require at -e line 1.\n>>>>>\n>>>>> Or even the more adventerous, this can have some bad side-effects with\n>>>>> some libraries (you lie to perl saying you haven't seen it before),\n>>>>> but I doubt Net::SMTP cares much, particularly when we're just about\n>>>>> to report an error:\n>>>>>\n>>>>>     $ perl -MData::Dumper -I/tmp -we 'eval { require Fails } or do {\n>>>>> delete $INC{\"Fails.pm\"} }; require Fails'\n>>>>>     oh noes at /tmp/Fails.pm line 2.\n>>>>>     Compilation failed in require at -e line 1.\n"},{"id":"321720","messageId":"CAJZjrdUSVeZ-zHpeyuN4p29Hg8eGk6ip2Tikkrh-wE-KaxWbEw@mail.gmail.com","threadId":"46130","inReplyTo":"CACBZZX5Zdn5XpjsWchww+LxyqN+Y=BqrGJ6wrXUW3PnRcsw-fQ@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Samuel Lijin","fromEmail":"sxlijin@gmail.com","sentAt":"2017-06-08T00:06:59Z","receivedAt":"2017-06-08T00:08:07Z","isPatch":false,"sender":{"key":"sxlijin@gmail.com","avatar":"https://gravatar.com/avatar/01777bf1eae64e2b4dca97dcac182a6abbcf6fd8cb4d5b8fa33edf9f8cc21746?d=mp&s=160"},"body":"On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch\n> openssl, breaking the CPAN-built *.so object?\n>\n>> Agreed that send-email should be report errors properly. It's a rather\n>> essential tool.\n>\n> Indeed, do you get a meaningful error if you apply my patch?\n\nFWIW I'm on Arch as well and am getting what I assume is a related error:\n\nSSLeay.c: loadable library and perl binaries are mismatched (got\nhandshake key 0xdb80080, needed 0xde00080)\n\nThe last patch I sent out was on 5/23, and I just ran a system upgrade\ntoday (only one I've done since then), which presumably is what\n\"broke\" send-email. I used CPAN to install Net::SMTP::SSL,\nMime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed\nas a dependency of one of the three (presumably the first)?\n\nI know Net::SSLeay isn't controlled by Arch's package manager:\n\n$ perldoc -l Net::SSLeay\n/usr/lib/perl5/site_perl/Net/SSLeay.pod\n$ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod\nerror: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod\n\nÆvar's patch unfortunately does not fix or change anything for me.\n\nLiam: when you say \"uninstall\" /usr/{lib,share}/perl5/site_perl/*, do\nyou just mean rm -rf?\n"},{"id":"321721","messageId":"CAKvHMgRcpEt1a-nZMw_Z7iZ8Bc2ChQNbUo3yQgtT8+stQLD11Q@mail.gmail.com","threadId":"46130","inReplyTo":"CAJZjrdUSVeZ-zHpeyuN4p29Hg8eGk6ip2Tikkrh-wE-KaxWbEw@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Liam Breck","fromEmail":"liam@networkimprov.net","sentAt":"2017-06-08T00:26:24Z","receivedAt":"2017-06-08T00:26:31Z","isPatch":false,"sender":{"key":"liam@networkimprov.net","avatar":null},"body":"On Wed, Jun 7, 2017 at 5:06 PM, Samuel Lijin <sxlijin@gmail.com> wrote:\n> On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch\n>> openssl, breaking the CPAN-built *.so object?\n>>\n>>> Agreed that send-email should be report errors properly. It's a rather\n>>> essential tool.\n>>\n>> Indeed, do you get a meaningful error if you apply my patch?\n>\n> FWIW I'm on Arch as well and am getting what I assume is a related error:\n>\n> SSLeay.c: loadable library and perl binaries are mismatched (got\n> handshake key 0xdb80080, needed 0xde00080)\n>\n> The last patch I sent out was on 5/23, and I just ran a system upgrade\n> today (only one I've done since then), which presumably is what\n> \"broke\" send-email. I used CPAN to install Net::SMTP::SSL,\n> Mime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed\n> as a dependency of one of the three (presumably the first)?\n>\n> I know Net::SSLeay isn't controlled by Arch's package manager:\n>\n> $ perldoc -l Net::SSLeay\n> /usr/lib/perl5/site_perl/Net/SSLeay.pod\n> $ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod\n> error: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod\n>\n> Ævar's patch unfortunately does not fix or change anything for me.\n\nRight because it attempts to log a diff issue.\n\n> Liam: when you say \"uninstall\" /usr/{lib,share}/perl5/site_perl/*, do\n> you just mean rm -rf?\n\nYou need these new arch packages:\nperl-mime-tools perl-net-smtp-ssl perl-authen-sasl\n\nTo uninstall the cpan stuff I did this in case I need to put anything back\n\nmkdir -p siteperl_uninstall/{lib,share}\nsudo mv /usr/share/perl5/site_perl/*  siteperl_uninstall/share/\nsudo mv /usr/lib/perl5/site_perl/*  siteperl_uninstall/lib/\n\nYou could comment on this issue here\nhttps://bugs.archlinux.org/task/54334\n\n.\n"},{"id":"321734","messageId":"CACBZZX5SMsXHkVS-a9iarTw_VnH8hBEdN7a56e8ma89nfOLqrA@mail.gmail.com","threadId":"46130","inReplyTo":"CAJZjrdUSVeZ-zHpeyuN4p29Hg8eGk6ip2Tikkrh-wE-KaxWbEw@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-08T06:28:19Z","receivedAt":"2017-06-08T06:28:45Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Jun 8, 2017 at 2:06 AM, Samuel Lijin <sxlijin@gmail.com> wrote:\n> On Wed, Jun 7, 2017 at 4:43 PM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> Ah, so you installed Net::SSLeay via CPAN, and then upgraded your Arch\n>> openssl, breaking the CPAN-built *.so object?\n>>\n>>> Agreed that send-email should be report errors properly. It's a rather\n>>> essential tool.\n>>\n>> Indeed, do you get a meaningful error if you apply my patch?\n>\n> FWIW I'm on Arch as well and am getting what I assume is a related error:\n>\n> SSLeay.c: loadable library and perl binaries are mismatched (got\n> handshake key 0xdb80080, needed 0xde00080)\n>\n> The last patch I sent out was on 5/23, and I just ran a system upgrade\n> today (only one I've done since then), which presumably is what\n> \"broke\" send-email. I used CPAN to install Net::SMTP::SSL,\n> Mime::Base64, and Authen::SASL; I assume that Net::SSLeay is installed\n> as a dependency of one of the three (presumably the first)?\n>\n> I know Net::SSLeay isn't controlled by Arch's package manager:\n>\n> $ perldoc -l Net::SSLeay\n> /usr/lib/perl5/site_perl/Net/SSLeay.pod\n> $ pacman -Qo /usr/lib/perl5/site_perl/Net/SSLeay.pod\n> error: No package owns /usr/lib/perl5/site_perl/Net/SSLeay.pod\n>\n> Ævar's patch unfortunately does not fix or change anything for me.\n\nIt doesn't fix anything, it should make you get a better error message\nwhen the thing does break, i.e. not an \"Attempt to reload\" error,\ndoesn't that happen? What error do you get with/without my patch?\n\n> Liam: when you say \"uninstall\" /usr/{lib,share}/perl5/site_perl/*, do\n> you just mean rm -rf?\n"},{"id":"321839","messageId":"xmqqvao55d8v.fsf@gitster.mtv.corp.google.com","threadId":"46130","inReplyTo":"CACBZZX6AKYA5PmE6Le4cxCTCOOix1ErHyT21C=L83CQBYaN=RQ@mail.gmail.com","subject":"Re: send-email: Net::SMTP::SSL failure","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-09T16:37:04Z","receivedAt":"2017-06-09T16:37:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> I have not looked deeply at this, but the error you're getting means\n> \"we tried to load it before and failed, and here you are trying\n> again\".\n>\n> This is almost definitely due to this line in git-send-email:\n>\n>         if (eval { require Net::SMTP; 1 }) {\n>\n> And more generally, this code is all buggy:\n>\n>     4 matches for \"eval.*require\" in buffer: git-send-email.perl\n>     153:my $have_email_valid = eval { require Email::Valid; 1 };\n>     154:my $have_mail_address = eval { require Mail::Address; 1 };\n>    1118:        if (eval { require Net::Domain; 1 }) {\n>    1129:        if (eval { require Net::SMTP; 1 }) {\n>\n> Well, \"buggy\" in the sense that we're just happy-go-lucky trying to\n> load these modules, and if they have an error we don't report it, then\n> when we try to load them again perl just emits a generic error saying\n> you're trying to require() something that already failed somewhere\n> before...\n\nThanks for the discussion.  My short summary from reading the thread\nfrom the sideline is:\n\n * \"eval { require module; 1 }\" pattern seems to have spread by\n   copying and pasting without thinking, all of which should be\n   corrected not to retry;\n\n * The error OP encountered is not an issue in git-send-email\n   per-se, but was made harder to diagnose due to the above.\n\nI think we still lack the definite \"here is the right way to fix\nthese not to retry\" patch for application, but anything else I\nmissed?\n"}]}