bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] readline + shell redirection + fish hangs


From: Alex Gaynor
Subject: Re: [Bug-readline] readline + shell redirection + fish hangs
Date: Fri, 21 Apr 2017 12:32:05 -0400

Ooops, one other diagnostic detail I neglected to include is that the "grep" used under fish is a fish function:

~ ❯❯❯ type grep
grep is a function with definition
function grep
    command grep --color=auto $argv
end

This is necessary to reproduce the hang:
~ ❯❯❯ ./a.out | /usr/bin/grep 'a'
~ ❯❯❯ ./a.out | grep 'a'
<hang>

Thanks.
Alex

On Fri, Apr 21, 2017 at 12:29 PM, Alex Gaynor <address@hidden> wrote:
Hi Readline Maintainers!

This email describes a bug that occurs when readline is used in combination with the fish shell.

Initial diagnostic info:

readline 7.0.3, install with homebrew
macOS 10.12.4
Darwin agaynor-44227 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
fish, version 2.5.0

Ok, now to reproduce the bug:

~ ❯❯❯ cat t.c
#include <readline/readline.h>

int main() {
    rl_initialize();
    return 0;
}
~ ❯❯❯ # Use the readline from homebrew, rather than the system one
~ ❯❯❯ clang -L /usr/local/opt/readline/lib/ -lreadline t.c
~ ❯❯❯ ./a.out | grep hi
<hangs here>


This works fine with the libEdit provided by macOS:

~ ❯❯❯ clang -lreadline t.c
~ ❯❯❯ ./a.out | grep hi
~ ❯❯❯

It similarly works fine under bash.

Grabbing the process with lldb, shows it is hung in the following place:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fffa48b55ee libsystem_kernel.dylib`__ioctl + 10
    frame #1: 0x00007fffa48b1569 libsystem_kernel.dylib`ioctl + 159
    frame #2: 0x000000010eb7a362 libreadline.7.dylib`get_tty_settings + 54
    frame #3: 0x000000010eb7a584 libreadline.7.dylib`rltty_set_default_bindings + 57
    frame #4: 0x000000010eb74a79 libreadline.7.dylib`rl_initialize + 200
    frame #5: 0x000000010eb6ff84 a.out`main + 20
    frame #6: 0x00007fffa4787235 libdyld.dylib`start + 1
    frame #7: 0x00007fffa4787235 libdyld.dylib`start + 1



I have not gotten further than this. It was a tossup between filing as a fish bug and a readline bug, the fact that libEdit works was what caused me to file this as a readline bug.

Thanks, let me know if there's anything additional I can do to help debug.

Thanks,
Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]