On Mon, May 20, 2019 at 06:02:11AM -0400, Jeff King wrote: > I haven't tried to reproduce yet. Is the repository (and patch) that you > used to demonstrate this publicly available? Or alternatively, is it > possible to show a backtrace from the coredump? Never mind. It reproduces quite easily, because AFAICT "am -i --resolved" has been totally broken since it was converted to C (in 2015!). I guess it does not have many users. :) > If my blind guess is right, then something like this probably fixes it: This is indeed the problem. Here are some patches. The actual fix is what I showed already. The other three are just making it possible to cover this with the test suite (until now, we had no coverage of "am --interactive" at all). [1/4]: am: simplify prompt response handling [2/4]: am: read interactive input from stdin [3/4]: am: drop tty requirement for --interactive [4/4]: am: fix --interactive HEAD tree resolution builtin/am.c | 30 +++++++++++++++--------- t/t4257-am-interactive.sh | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 11 deletions(-) create mode 100755 t/t4257-am-interactive.sh -Peff