git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Enzo Matsumiya <ematsumiya@suse.de>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pager: fix crash when pager program doesn't exist
Date: Sat, 20 Nov 2021 00:06:21 -0300	[thread overview]
Message-ID: <20211120030621.2xbcz5usaqkh2ald@cyberdelia> (raw)
In-Reply-To: <20211120023246.7ynehp5v3iypfr6w@cyberdelia>

On 11/19, Enzo Matsumiya wrote:
>>When pager setup succeeds, the second run is a noop, because isatty(1)
>>is no longer true. But for the case you're interested in, the first one
>>fails, so we do try again. And I can reproduce your problem with:
>
>No, it's not a noop such as that it's clear that things are different on
>the second call.

Here I meant that setup_pager() is effectivelly called from 2 different places:

First backtrace:
setup_pager()
commit_pager_choice()
run_builtin()
handle_builtin()
run_argv()
cmd_main()

Second backtrace:
setup_pager()
cmd_log_init_finish()
cmd_log_init()
cmd_show()
run_builtin()
handle_builtin()
run_argv()
cmd_main()

Also, isatty(1) is not false in neither of the calls. Otherwise I
wouldn't hit this bug (pager would be NULL and setup_pager() a noop as
you said).


Cheers,

Enzo

  reply	other threads:[~2021-11-20  3:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 23:47 [PATCH] pager: fix crash when pager program doesn't exist Enzo Matsumiya
2021-11-20  1:53 ` Jeff King
2021-11-20  2:32   ` Enzo Matsumiya
2021-11-20  3:06     ` Enzo Matsumiya [this message]
2021-11-20  3:38       ` Jeff King
2021-11-20  3:42     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211120030621.2xbcz5usaqkh2ald@cyberdelia \
    --to=ematsumiya@suse.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).