{"thread":{"id":"60360","subject":"Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","startedAt":"2023-10-13T14:14:44Z","lastAt":"2023-10-30T09:29:06Z","messageCount":14,"participants":["Uwe Kleine-König","Kristoffer Haugsbakk","Michael Strawbridge","Jeff King","Junio C Hamano","Todd Zullinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483198","messageId":"20231013141437.ywrhw65xdapmev7d@pengutronix.de","threadId":"60360","inReplyTo":null,"subject":"Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2023-10-13T14:14:37Z","receivedAt":"2023-10-13T14:14:44Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n\t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n\tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n\terror: unable to extract a valid address from:\n\nThis happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\n\nBisection points at\n\n\ta8022c5f7b67 (\"send-email: expose header information to git-send-email's sendemail-validate hook\")\n\nI didn't try to understand that change and fix the problem.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | https://www.pengutronix.de/ |\n"},{"id":"483200","messageId":"c026e59d-c2ad-4ff0-8a83-e0b7925aec67@app.fastmail.com","threadId":"60360","inReplyTo":"20231013141437.ywrhw65xdapmev7d@pengutronix.de","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Kristoffer Haugsbakk","fromEmail":"code@khaugsbakk.name","sentAt":"2023-10-13T15:07:28Z","receivedAt":"2023-10-13T15:08:10Z","isPatch":false,"sender":{"key":"code@khaugsbakk.name","avatar":"https://avatars.githubusercontent.com/u/2229597?v=4"},"body":"On Fri, Oct 13, 2023, at 16:14, Uwe Kleine-König wrote:\n> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n> \tUse of uninitialized value $address in sprintf at \n\nThis looks the same problem as https://lore.kernel.org/git/ZQ1eGzqfyoeeTBUq@debian.me/\n\n-- \nKristoffer Haugsbakk\n\n"},{"id":"483555","messageId":"20231020100442.an47wwsti2d4zeyx@pengutronix.de","threadId":"60360","inReplyTo":"20231013141437.ywrhw65xdapmev7d@pengutronix.de","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2023-10-20T10:04:42Z","receivedAt":"2023-10-20T10:04:46Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"hello,\n\nOn Fri, Oct 13, 2023 at 04:14:37PM +0200, Uwe Kleine-König wrote:\n> Hello,\n> \n> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n> \tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n> \terror: unable to extract a valid address from:\n> \n> This happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\n> \n> Bisection points at\n> \n> \ta8022c5f7b67 (\"send-email: expose header information to git-send-email's sendemail-validate hook\")\n> \n> I didn't try to understand that change and fix the problem.\n\nAnother (similar?) problem with non-ascii-chars:\n\n\t$ git send-email --to 'Will Deacon <will@kernel.org>' --to 'Krzysztof Wilczyński <kw@linux.com>' --to 'Lorenzo Pieralisi <lpieralisi@kernel.org>' --cc 'Rob Herring <robh@kernel.org>' --to 'Bjorn Helgaas <bhelgaas@google.com>' --cc 'linux-pci@vger.kernel.org' --cc kernel@pengutronix.de -1 --base=@~\n\tUse of uninitialized value $address in sprintf at /home/uwe/gsrc/git/git-send-email line 1162.\n\terror: unable to extract a valid address from:\n\nBisection points to the same commit, when dropping ń in Krzysztof's\nname, it works fine.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | https://www.pengutronix.de/ |\n"},{"id":"483600","messageId":"68d7e5c3-6b4a-4d0d-9885-f3d4e2199f26@amd.com","threadId":"60360","inReplyTo":"20231020100442.an47wwsti2d4zeyx@pengutronix.de","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Michael Strawbridge","fromEmail":"michael.strawbridge@amd.com","sentAt":"2023-10-20T21:06:36Z","receivedAt":"2023-10-20T21:06:47Z","isPatch":false,"sender":{"key":"michael.strawbridge@amd.com","avatar":null},"body":"On 10/20/23 06:04, Uwe Kleine-König wrote:\n> hello,\n> \n> On Fri, Oct 13, 2023 at 04:14:37PM +0200, Uwe Kleine-König wrote:\n>> Hello,\n>>\n>> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n>> \tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n>> \terror: unable to extract a valid address from:\n>>\n>> This happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\n>>\n>> Bisection points at\n>>\n>> \ta8022c5f7b67 (\"send-email: expose header information to git-send-email's sendemail-validate hook\")\n>>\n>> I didn't try to understand that change and fix the problem.\n> \n> Another (similar?) problem with non-ascii-chars:\n> \n> \t$ git send-email --to 'Will Deacon <will@kernel.org>' --to 'Krzysztof Wilczyński <kw@linux.com>' --to 'Lorenzo Pieralisi <lpieralisi@kernel.org>' --cc 'Rob Herring <robh@kernel.org>' --to 'Bjorn Helgaas <bhelgaas@google.com>' --cc 'linux-pci@vger.kernel.org' --cc kernel@pengutronix.de -1 --base=@~\n> \tUse of uninitialized value $address in sprintf at /home/uwe/gsrc/git/git-send-email line 1162.\n> \terror: unable to extract a valid address from:\n> \n> Bisection points to the same commit, when dropping ń in Krzysztof's\n> name, it works fine.\n> \nThis is interesting.  Thanks for reporting it.  If you are able, could you please try the patches found in the below threads:\n- https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#mae64003cbb72f015bf5c0c04216524fcb6bb8d09\n- https://public-inbox.org/git/f5c6a72b-f888-4d43-8be8-3ce2c878c669@gmail.com/T/#mca12dc95ccfd3ce2b94e7752ebaae9891201084f\n\nThanks,\nMichael\n\n> Best regards\n> Uwe\n> \n"},{"id":"483769","messageId":"20231024130037.sbevzk2x7oclj7d7@pengutronix.de","threadId":"60360","inReplyTo":"68d7e5c3-6b4a-4d0d-9885-f3d4e2199f26@amd.com","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2023-10-24T13:00:37Z","receivedAt":"2023-10-24T13:00:48Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nOn Fri, Oct 20, 2023 at 05:06:36PM -0400, Michael Strawbridge wrote:\n> On 10/20/23 06:04, Uwe Kleine-König wrote:\n> > hello,\n> > \n> > On Fri, Oct 13, 2023 at 04:14:37PM +0200, Uwe Kleine-König wrote:\n> >> Hello,\n> >>\n> >> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n> >> \tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n> >> \terror: unable to extract a valid address from:\n> >>\n> >> This happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\n> >>\n> >> Bisection points at\n> >>\n> >> \ta8022c5f7b67 (\"send-email: expose header information to git-send-email's sendemail-validate hook\")\n> >>\n> >> I didn't try to understand that change and fix the problem.\n> > \n> > Another (similar?) problem with non-ascii-chars:\n> > \n> > \t$ git send-email --to 'Will Deacon <will@kernel.org>' --to 'Krzysztof Wilczyński <kw@linux.com>' --to 'Lorenzo Pieralisi <lpieralisi@kernel.org>' --cc 'Rob Herring <robh@kernel.org>' --to 'Bjorn Helgaas <bhelgaas@google.com>' --cc 'linux-pci@vger.kernel.org' --cc kernel@pengutronix.de -1 --base=@~\n> > \tUse of uninitialized value $address in sprintf at /home/uwe/gsrc/git/git-send-email line 1162.\n> > \terror: unable to extract a valid address from:\n> > \n> > Bisection points to the same commit, when dropping ń in Krzysztof's\n> > name, it works fine.\n> > \n> This is interesting.  Thanks for reporting it.  If you are able, could you please try the patches found in the below threads:\n> - https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#mae64003cbb72f015bf5c0c04216524fcb6bb8d09\n\nOn main (2e8e77cbac8a) this one is already applied, with that the error\nmessage reduces to:\n\n\t$ git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>' -1\n\terror: unable to extract a valid address from: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n\n> - https://public-inbox.org/git/f5c6a72b-f888-4d43-8be8-3ce2c878c669@gmail.com/T/#mca12dc95ccfd3ce2b94e7752ebaae9891201084f\n\nThis one doesn't help either. With it applied on top of main I get the\nsams result as on vanilla main.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | https://www.pengutronix.de/ |\n"},{"id":"483805","messageId":"89712aea-04fc-4775-afd4-afd3ca24ad01@amd.com","threadId":"60360","inReplyTo":"20231024130037.sbevzk2x7oclj7d7@pengutronix.de","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Michael Strawbridge","fromEmail":"michael.strawbridge@amd.com","sentAt":"2023-10-24T19:00:38Z","receivedAt":"2023-10-24T19:00:47Z","isPatch":false,"sender":{"key":"michael.strawbridge@amd.com","avatar":null},"body":"\n\nOn 10/24/23 09:00, Uwe Kleine-König wrote:\n> Hello,\n> \n> On Fri, Oct 20, 2023 at 05:06:36PM -0400, Michael Strawbridge wrote:\n>> On 10/20/23 06:04, Uwe Kleine-König wrote:\n>>> hello,\n>>>\n>>> On Fri, Oct 13, 2023 at 04:14:37PM +0200, Uwe Kleine-König wrote:\n>>>> Hello,\n>>>>\n>>>> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n>>>> \tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n>>>> \terror: unable to extract a valid address from:\n>>>>\n>>>> This happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\nHm.  I tried reproing with master (59167d7d09fd, \"The seventeenth batch\") but I don't seem to see an error:\n```\n$ git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>' -1 --smtp-server=\"$(pwd)/fake.sendmail\"\n\n/tmp/FEGzLrm_4U/0001-test-test.patch\n1\n(mbox) Adding cc: Your Name <you@example.com> from line 'From: Your Name <you@example.com>'\n(body) Adding cc: Your Name <you@example.com> from line 'Signed-off-by: Your Name <you@example.com>'\n\nFrom: Your Name <you@example.com>\nTo: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nCc: Your Name <you@example.com>\nSubject: [PATCH] test test\nDate: Tue, 24 Oct 2023 18:33:51 +0000\nMessage-ID: <20231024183350.10-2-you@example.com>\nX-Mailer: git-send-email 2.40.0.rc1.1708.gbffa95ed23.dirty\nMIME-Version: 1.0\nContent-Transfer-Encoding: 8bit\n\n    The Cc list above has been expanded by additional\n    addresses found in the patch commit message. By default\n    send-email prompts before sending whenever this occurs.\n    This behavior is controlled by the sendemail.confirm\n    configuration setting.\n\n    For additional information, run 'git send-email --help'.\n    To retain the current behavior, but squelch this message,\n    run 'git config --global sendemail.confirm auto'.\n\nSend this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n-i\nOK. Log says:\nSendmail: /git/fake.sendmail -i u.kleine-koenig@pengutronix.de you@example.com\nFrom: Your Name <you@example.com>\nTo: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nCc: Your Name <you@example.com>\nSubject: [PATCH] test test\nDate: Tue, 24 Oct 2023 18:33:51 +0000\nMessage-ID: <20231024183350.10-2-you@example.com>\nX-Mailer: git-send-email 2.40.0.rc1.1708.gbffa95ed23.dirty\nMIME-Version: 1.0\nContent-Transfer-Encoding: 8bit\n\nResult: OK\n```\n\nI think my terminal may be mangling the UTF-8 encoding but git send-email doesn't seem to complain.\n\nOnly when I go to an older git (version 2.42.0 for example) do I then get:\n\n```\nUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\nerror: unable to extract a valid address from: \n```\n\nThis would be expected because https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#mae64003cbb72f015bf5c0c04216524fcb6bb8d09\nis meant to fix it.\n\nJust in case it was the \"from\" address, I tried using 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'\nas the from address.  This still worked without issue for (59167d7d09fd, \"The seventeenth batch\").\n\n\n>>>>\n>>>> Bisection points at\n>>>>\n>>>> \ta8022c5f7b67 (\"send-email: expose header information to git-send-email's sendemail-validate hook\")\n>>>>\n>>>> I didn't try to understand that change and fix the problem.\n>>>\n>>> Another (similar?) problem with non-ascii-chars:\n>>>\n>>> \t$ git send-email --to 'Will Deacon <will@kernel.org>' --to 'Krzysztof Wilczyński <kw@linux.com>' --to 'Lorenzo Pieralisi <lpieralisi@kernel.org>' --cc 'Rob Herring <robh@kernel.org>' --to 'Bjorn Helgaas <bhelgaas@google.com>' --cc 'linux-pci@vger.kernel.org' --cc kernel@pengutronix.de -1 --base=@~\n>>> \tUse of uninitialized value $address in sprintf at /home/uwe/gsrc/git/git-send-email line 1162.\n>>> \terror: unable to extract a valid address from:\n>>>\n>>> Bisection points to the same commit, when dropping ń in Krzysztof's\n>>> name, it works fine.\n\nI tried this as well with seventeen and it succeeds:\n```\n/tmp/GfTxbwKSx_/0001-test-test.patch\n1\n(mbox) Adding cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> from line 'From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>'\n(body) Adding cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> from line 'Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'\n\nFrom: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nTo: Will Deacon <will@kernel.org>,\n\t=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kw@linux.com>,\n\tLorenzo Pieralisi <lpieralisi@kernel.org>,\n\tBjorn Helgaas <bhelgaas@google.com>\nCc: Rob Herring <robh@kernel.org>,\n\tlinux-pci@vger.kernel.org,\n\tkernel@pengutronix.de,\n\t=?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nSubject: [PATCH] test test\nDate: Tue, 24 Oct 2023 18:57:16 +0000\nMessage-ID: <20231024185715.10-2-u.kleine-koenig@pengutronix.de>\nX-Mailer: git-send-email 2.40.0.rc1.1708.gbffa95ed23.dirty\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n    The Cc list above has been expanded by additional\n    addresses found in the patch commit message. By default\n    send-email prompts before sending whenever this occurs.\n    This behavior is controlled by the sendemail.confirm\n    configuration setting.\n\n    For additional information, run 'git send-email --help'.\n    To retain the current behavior, but squelch this message,\n    run 'git config --global sendemail.confirm auto'.\n\nSend this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n-i\nOK. Log says:\nSendmail: /git/fake.sendmail -i will@kernel.org kw@linux.com lpieralisi@kernel.org bhelgaas@google.com robh@kernel.org linux-pci@vger.kernel.org kernel@pengutronix.de u.kleine-koenig@pengutronix.de\nFrom: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nTo: Will Deacon <will@kernel.org>,\n\t=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kw@linux.com>,\n\tLorenzo Pieralisi <lpieralisi@kernel.org>,\n\tBjorn Helgaas <bhelgaas@google.com>\nCc: Rob Herring <robh@kernel.org>,\n\tlinux-pci@vger.kernel.org,\n\tkernel@pengutronix.de,\n\t=?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nSubject: [PATCH] test test\nDate: Tue, 24 Oct 2023 18:57:16 +0000\nMessage-ID: <20231024185715.10-2-u.kleine-koenig@pengutronix.de>\nX-Mailer: git-send-email 2.40.0.rc1.1708.gbffa95ed23.dirty\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nResult: OK\n```\n\nPerhaps there is another variable involved?\n\n>>>\n>> This is interesting.  Thanks for reporting it.  If you are able, could you please try the patches found in the below threads:\n>> - https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#mae64003cbb72f015bf5c0c04216524fcb6bb8d09\n> \n> On main (2e8e77cbac8a) this one is already applied, with that the error\n> message reduces to:\n> \n> \t$ git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>' -1\n> \terror: unable to extract a valid address from: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n> \n>> - https://public-inbox.org/git/f5c6a72b-f888-4d43-8be8-3ce2c878c669@gmail.com/T/#mca12dc95ccfd3ce2b94e7752ebaae9891201084f\n> \n> This one doesn't help either. With it applied on top of main I get the\n> sams result as on vanilla main.\n> \n> Best regards\n> Uwe\n> \n"},{"id":"483818","messageId":"20231024204318.gi6b4ygqbilm2yke@pengutronix.de","threadId":"60360","inReplyTo":"89712aea-04fc-4775-afd4-afd3ca24ad01@amd.com","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2023-10-24T20:43:18Z","receivedAt":"2023-10-24T20:43:25Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Michael,\n\nOn Tue, Oct 24, 2023 at 03:00:38PM -0400, Michael Strawbridge wrote:\n> On 10/24/23 09:00, Uwe Kleine-König wrote:\n> > On Fri, Oct 20, 2023 at 05:06:36PM -0400, Michael Strawbridge wrote:\n> >> On 10/20/23 06:04, Uwe Kleine-König wrote:\n> >>> On Fri, Oct 13, 2023 at 04:14:37PM +0200, Uwe Kleine-König wrote:\n> >>>> \t$ git send-email --to 'A B <a@b.org>, C D <c@d.org>' lala.patch\n> >>>> \tUse of uninitialized value $address in sprintf at /usr/lib/git-core/git-send-email line 1172.\n> >>>> \terror: unable to extract a valid address from:\n> >>>>\n> >>>> This happens for me with git 2.42.0 and also on master (59167d7d09fd, \"The seventeenth batch\").\n> Hm.  I tried reproing with master (59167d7d09fd, \"The seventeenth batch\") but I don't seem to see an error:\n> ```\n> $ git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>' -1 --smtp-server=\"$(pwd)/fake.sendmail\"\n> [...]\n\nI debugged a bit and if I do\n\n\tmv .git/hooks/sendemail-validate .git/hooks/sendemail-validate.bak\n\ngit send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'\nstarts to work for me, too.\n\nI'd guess the content of my sendemail-validate script doesn't matter\nmuch, but for the record, it's:\n\n\t#!/bin/sh\n\t# installed by patatt install-hook\n\tpatatt sign --hook \"${1}\"\n\nDoes the problem reproduce on your end with a sendemail-validate script?\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | https://www.pengutronix.de/ |\n"},{"id":"483833","messageId":"20231025072104.GA2145145@coredump.intra.peff.net","threadId":"60360","inReplyTo":"20231024204318.gi6b4ygqbilm2yke@pengutronix.de","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-10-25T07:21:04Z","receivedAt":"2023-10-25T07:21:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 24, 2023 at 10:43:18PM +0200, Uwe Kleine-König wrote:\n\n> I debugged a bit and if I do\n> \n> \tmv .git/hooks/sendemail-validate .git/hooks/sendemail-validate.bak\n> \n> git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'\n> starts to work for me, too.\n> \n> I'd guess the content of my sendemail-validate script doesn't matter\n> much, but for the record, it's:\n> \n> \t#!/bin/sh\n> \t# installed by patatt install-hook\n> \tpatatt sign --hook \"${1}\"\n> \n> Does the problem reproduce on your end with a sendemail-validate script?\n\nI can reproduce with:\n\n  git init\n  echo foo >file && git add file && git commit -m foo\n  echo 'exit 0' >.git/hooks/sendemail-validate\n  chmod +x .git/hooks/sendemail-validate\n  git send-email --dry-run --to='pëff <peff@peff.net>' -1\n\nNote that the bug will only trigger if Email::Valid is installed. I\nthink this is the same issue being discussed elsewhere. The call to\nprocess_address_list() sanitizes it to use rfc2047 encoding, which is\nnecessary for it to be syntactically valid.\n\nSo the patch to move the validation later in the process here:\n\n  https://lore.kernel.org/git/ee56c4df-e030-45f9-86a9-94fb3540db60@amd.com/\n\nfixes it.\n\n-Peff\n"},{"id":"483835","messageId":"20231025074023.dowdv67urpjtzzka@pengutronix.de","threadId":"60360","inReplyTo":"20231025072104.GA2145145@coredump.intra.peff.net","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2023-10-25T07:40:23Z","receivedAt":"2023-10-25T07:41:09Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nOn Wed, Oct 25, 2023 at 03:21:04AM -0400, Jeff King wrote:\n> On Tue, Oct 24, 2023 at 10:43:18PM +0200, Uwe Kleine-König wrote:\n> \n> > I debugged a bit and if I do\n> > \n> > \tmv .git/hooks/sendemail-validate .git/hooks/sendemail-validate.bak\n> > \n> > git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'\n> > starts to work for me, too.\n> > \n> > I'd guess the content of my sendemail-validate script doesn't matter\n> > much, but for the record, it's:\n> > \n> > \t#!/bin/sh\n> > \t# installed by patatt install-hook\n> > \tpatatt sign --hook \"${1}\"\n> > \n> > Does the problem reproduce on your end with a sendemail-validate script?\n> \n> I can reproduce with:\n> \n>   git init\n>   echo foo >file && git add file && git commit -m foo\n>   echo 'exit 0' >.git/hooks/sendemail-validate\n>   chmod +x .git/hooks/sendemail-validate\n>   git send-email --dry-run --to='pëff <peff@peff.net>' -1\n> \n> Note that the bug will only trigger if Email::Valid is installed.\n\nI can confirm I have this package installed (via Debian's\nlibemail-valid-perl).\n\n> I think this is the same issue being discussed elsewhere. The call to\n> process_address_list() sanitizes it to use rfc2047 encoding, which is\n> necessary for it to be syntactically valid.\n> \n> So the patch to move the validation later in the process here:\n> \n>   https://lore.kernel.org/git/ee56c4df-e030-45f9-86a9-94fb3540db60@amd.com/\n> \n> fixes it.\n\nTested and indeed that fixes my usecase. With that patch also the\noriginal regression is fixed and I can do\n\n\tgit send-email -1 --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>, pëff <peff@peff.net>'\n\nagain. \\o/\n\nThanks\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | https://www.pengutronix.de/ |\n"},{"id":"483917","messageId":"xmqqsf5xr1xk.fsf@gitster.g","threadId":"60360","inReplyTo":"20231025072104.GA2145145@coredump.intra.peff.net","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-26T12:41:27Z","receivedAt":"2023-10-26T12:41:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Note that the bug will only trigger if Email::Valid is installed.\n\nI recall we chased a different bug that depends on the use/non-use\nof this package a few years ago.  Is the difference significant\nenough that we may want to install on one but not in another CI\nenvironment, like we have a separate CI jobs with exotic settings, I\nwonder.\n"},{"id":"483919","messageId":"a71f2f1f-b5f0-4628-a4f3-6fd1319062a3@amd.com","threadId":"60360","inReplyTo":"xmqqsf5xr1xk.fsf@gitster.g","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Michael Strawbridge","fromEmail":"michael.strawbridge@amd.com","sentAt":"2023-10-26T13:07:57Z","receivedAt":"2023-10-26T13:08:07Z","isPatch":false,"sender":{"key":"michael.strawbridge@amd.com","avatar":null},"body":"\n\nOn 10/26/23 08:41, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> \n>> Note that the bug will only trigger if Email::Valid is installed.\n> \n> I recall we chased a different bug that depends on the use/non-use\n> of this package a few years ago.  Is the difference significant\n> enough that we may want to install on one but not in another CI\n> environment, like we have a separate CI jobs with exotic settings, I\n> wonder.\n\nThat would make sense to me.  We have had 3 regressions threads\nrecently for git send email where Email::Valid was important.\n\n- [REGRESSION] uninitialized value $address in git send-email when given multiple recipients separated by commas - (this thread)\n- [REGRESSION] uninitialized value $address in git send-email - https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#m9e0211a8ad387adbbadf31dcfcd7982d4046633d\n- Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\" - https://public-inbox.org/git/68d7e5c3-6b4a-4d0d-9885-f3d4e2199f26@amd.com/T/#m1411c155e11ad9c5d913d22d1d11180ed56eabc7\n"},{"id":"483923","messageId":"ZTp7xvXDw1GF-NUB@pobox.com","threadId":"60360","inReplyTo":"a71f2f1f-b5f0-4628-a4f3-6fd1319062a3@amd.com","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2023-10-26T14:46:30Z","receivedAt":"2023-10-26T14:49:00Z","isPatch":false,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Michael Strawbridge wrote:\n> On 10/26/23 08:41, Junio C Hamano wrote:\n>> Jeff King <peff@peff.net> writes:\n>> \n>>> Note that the bug will only trigger if Email::Valid is installed.\n>> \n>> I recall we chased a different bug that depends on the use/non-use\n>> of this package a few years ago.  Is the difference significant\n>> enough that we may want to install on one but not in another CI\n>> environment, like we have a separate CI jobs with exotic settings, I\n>> wonder.\n> \n> That would make sense to me.  We have had 3 regressions threads\n> recently for git send email where Email::Valid was important.\n> \n> - [REGRESSION] uninitialized value $address in git send-email when given multiple recipients separated by commas - (this thread)\n> - [REGRESSION] uninitialized value $address in git send-email - https://public-inbox.org/git/20230918212004.GC2163162@coredump.intra.peff.net/T/#m9e0211a8ad387adbbadf31dcfcd7982d4046633d\n> - Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\" - https://public-inbox.org/git/68d7e5c3-6b4a-4d0d-9885-f3d4e2199f26@amd.com/T/#m1411c155e11ad9c5d913d22d1d11180ed56eabc7\n\nAlternately, perhaps having Email::Valid as an optional\ndependency is worth reconsidering. If it's truly important\nto validation, make it a requirement.  If it's not, then\ndrop it to simplify the code and avoid these sort of issues.\n\nAs a (former) distribution packager, having these optional\ndependencies which change the behavior is always a tough\nposition to be in.\n\nIf I make the git package require it to ensure consistent\nbehavior then some folks will -quite rightly- complain that\nit should not be a requirement.  If I keep it an optional\ndependency, then debugging becomes more difficult for the\nreasons we've seen in these recent (and not-so-recent)\nthreads.\n\nI'd lean toward dropping the dependency entirely and leave\nthe more basic validation of git-send-email in place.  That\nmay not catch every type of address error, but I would argue\nthat what we do without Email::Valid is perfectly reasonable\nfor checking basic email address syntax sanity.\n\nFurther validation will happen along the path of mail\ntransfer agents and failures should be reported to the\nsender in the same way as any other invalid email address.\n\nOn a related note, one issue¹ we had reported in Fedora\nafter making Email::Valid a requirement was that it rejected\nmessages where the local part was too long, per the relevant\nRFC's.  But these were generated addresses from GitLab.  The\naddresses worked in practice.  While Email::Valid was\ntechnically correct in rejecting such addresses, it didn't\nimprove the experience of git send-email users.\n\n¹ https://bugzilla.redhat.com/2046203\n\n-- \nTodd\n"},{"id":"483995","messageId":"xmqqedhgoysw.fsf@gitster.g","threadId":"60360","inReplyTo":"ZTp7xvXDw1GF-NUB@pobox.com","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-27T15:44:15Z","receivedAt":"2023-10-27T15:44:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Todd Zullinger <tmz@pobox.com> writes:\n\n> Alternately, perhaps having Email::Valid as an optional\n> dependency is worth reconsidering. If it's truly important\n> to validation, make it a requirement.  If it's not, then\n> drop it to simplify the code and avoid these sort of issues.\n\nReducing the possible \"valid\" configurations we support is a very\ntempting proposition.\n\n> If I make the git package require it to ensure consistent\n> behavior then some folks will -quite rightly- complain that\n> it should not be a requirement.  If I keep it an optional\n> dependency, then debugging becomes more difficult for the\n> reasons we've seen in these recent (and not-so-recent)\n> threads.\n\nVery true.\n\n> I'd lean toward dropping the dependency entirely and leave\n> the more basic validation of git-send-email in place.  That\n> may not catch every type of address error, but I would argue\n> that what we do without Email::Valid is perfectly reasonable\n> for checking basic email address syntax sanity.\n\nYes, it is very tempting, and given that we have to keep our\nfallback codepath working for those without Email::Valid ANYWAY,\nas long as the dependency is merely optional, I very much agree\nwith your argument here.\n\n> On a related note, one issue¹ we had reported in Fedora\n> after making Email::Valid a requirement was that it rejected\n> messages where the local part was too long, per the relevant\n> RFC's.  But these were generated addresses from GitLab.  The\n> addresses worked in practice.  While Email::Valid was\n> technically correct in rejecting such addresses, it didn't\n> improve the experience of git send-email users.\n\nI am of two minds here.  I can sympathize with both positions.\n\n - Trying to be strict to what we send out to the world by using\n   Email::Valid that tries to be more RFC kosher matches \"be strict\n   in what you send out, be lenient in what you receive\" mantra\n\n - Rejecting what works in practice and in real world tend to help\n   users.\n\nIf we require Email::Valid, then sriking the balance between the\nabove two will entirely become the responsibility of them; any\nend-user who complains \"the validation is overly strict\" will get\n\"talk to authors of Email::Valid\".\n\nIf we ditch Email::Valid, it will become _our_ responsibility, which\nmeans a bit of extra maintenance burden to this project.  But perhaps\nit is worth it?  I dunno.\n\nHaving Email::Valid as an optional dependency does not place us in a\nposition better than either of these two, so from that point of view,\ntoo, I like your \"we should either make it required or unused, not\nan optional dependency\" very much.\n\nThanks.\n"},{"id":"484084","messageId":"20231030092903.GD84866@coredump.intra.peff.net","threadId":"60360","inReplyTo":"ZTp7xvXDw1GF-NUB@pobox.com","subject":"Re: Regression: git send-email fails with \"Use of uninitialized value $address\" + \"unable to extract a valid address\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-10-30T09:29:03Z","receivedAt":"2023-10-30T09:29:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 26, 2023 at 10:46:30AM -0400, Todd Zullinger wrote:\n\n> I'd lean toward dropping the dependency entirely and leave\n> the more basic validation of git-send-email in place.  That\n> may not catch every type of address error, but I would argue\n> that what we do without Email::Valid is perfectly reasonable\n> for checking basic email address syntax sanity.\n\nI am somewhat tempted to say the same, but in this case didn't it help\nus find a real bug? True, the bug was that we were feeding garbage to\nEmail::Valid because we were calling it to early, and I _think_ the\nultimate emails we sent would have been OK. But I think we were possibly\nfeeding that garbage to the user-visible validation hook.\n\nThat might just mean we need to beef up our homegrown validation a bit\n(though as you indicate here, I am generally of the opinion that the\nbest validation is trying to actually send things).\n\n-Peff\n"}]}