Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readline debug REPL hangs on input in lldb on OSX 10.9 #5899

Closed
jiahao opened this issue Feb 22, 2014 · 7 comments
Closed

Readline debug REPL hangs on input in lldb on OSX 10.9 #5899

jiahao opened this issue Feb 22, 2014 · 7 comments
Labels
REPL Julia's REPL (Read Eval Print Loop) system:mac Affects only macOS

Comments

@jiahao
Copy link
Member

jiahao commented Feb 22, 2014

$ make debug
...
$ lldb usr/bin/julia-debug-readline 
Current executable set to 'usr/bin/julia-debug-readline' (x86_64).
(lldb) r
Process 48371 launched: '/Users/jiahao/local/src/julia/usr/bin/julia-debug-readline' (x86_64)
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+1674 (2014-02-22 06:53 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 0b2d867* (0 days old master)
|__/                   |  x86_64-apple-darwin13.0.2

julia> x #Press enter, wait awhile, press ^C
Process 48371 stopped
* thread #1: tid = 0x50cf80, 0x00007fff8cbf564a libsystem_kernel.dylib`kevent + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
    frame #0: 0x00007fff8cbf564a libsystem_kernel.dylib`kevent + 10
libsystem_kernel.dylib`kevent + 10:
-> 0x7fff8cbf564a:  jae    0x7fff8cbf5654            ; kevent + 20
   0x7fff8cbf564c:  movq   %rax, %rdi
   0x7fff8cbf564f:  jmpq   0x7fff8cbf1175            ; cerror_nocancel
   0x7fff8cbf5654:  ret    
(lldb) bt
* thread #1: tid = 0x50cf80, 0x00007fff8cbf564a libsystem_kernel.dylib`kevent + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
    frame #0: 0x00007fff8cbf564a libsystem_kernel.dylib`kevent + 10
    frame #1: 0x000000010015c15b libjulia-debug.dylib`uv__io_poll(loop=0x0000000100cfcda0, timeout=<unavailable>) + 667 at kqueue.c:130
    frame #2: 0x000000010014ebdd libjulia-debug.dylib`uv_run(loop=0x0000000100cfcda0, mode=UV_RUN_ONCE) + 317 at core.c:317
    frame #3: 0x0000000100124d31 libjulia-debug.dylib`jl_run_once(loop=0x0000000100cfcda0) + 65 at jl_uv.c:255
    frame #4: 0x0000000103d930f5 sys.dylib`julia_process_events13659 - 18446744069350018826
    frame #5: 0x000000010170c41e
    frame #6: 0x000000010170c250
    frame #7: 0x000000010170c193
    frame #8: 0x0000000100061b2c libjulia-debug.dylib`jl_apply(f=0x000000010239eb00, args=0x00007fff5fbff490, nargs=1) + 76 at julia.h:960
    frame #9: 0x0000000100063a98 libjulia-debug.dylib`jl_apply_generic(F=0x00000001043b8120, args=0x00007fff5fbff490, nargs=1) + 520 at gf.c:1372
    frame #10: 0x000000010170bded
    frame #11: 0x000000010006d87c libjulia-debug.dylib`jl_apply(f=0x0000000104c79da0, args=0x0000000000000000, nargs=0) + 76 at julia.h:960
    frame #12: 0x000000010006fbbe libjulia-debug.dylib`jl_trampoline(F=0x0000000104c79da0, args=0x0000000000000000, nargs=0) + 558 at builtins.c:769
    frame #13: 0x0000000100115cdc libjulia-debug.dylib`jl_apply(f=0x0000000104c79da0, args=0x0000000000000000, nargs=0) + 76 at julia.h:960
    frame #14: 0x0000000100116081 libjulia-debug.dylib`start_task(t=0x0000000104aaac40) + 209 at task.c:421
    frame #15: 0x0000000100114239 libjulia-debug.dylib`switch_stack(t=0x0000000104aaac40, where=0x0000000104aaac90) + 137 at task.c:202
    frame #16: 0x0000000100116065 libjulia-debug.dylib`start_task(t=0x0000000104aaa1c0) + 181 at task.c:418
    frame #17: 0x0000000100114239 libjulia-debug.dylib`switch_stack(t=0x0000000104aaa1c0, where=0x0000000104aaa210) + 137 at task.c:202
    frame #18: 0x000000010011418b libjulia-debug.dylib`jl_switch_stack(t=0x0000000104aaa1c0, where=0x0000000104aaa210) + 43 at task.c:212
    frame #19: 0x0000000100113d27 libjulia-debug.dylib`julia_trampoline(argc=0, argv=0x00007fff5fbff7d0, pmain=0x0000000100001610) + 183 at init.c:859
    frame #20: 0x0000000100001c66 julia-debug-readline`main(argc=0, argv=0x00007fff5fbff7d0) + 166 at repl.c:296
    frame #21: 0x0000000100000cb4 julia-debug-readline`start + 52
(lldb)

This does not happen with the basic repl in lldb, or the readline repl in gdb.

@vtjnash
Copy link
Member

vtjnash commented Feb 22, 2014

I'm not sure this is a bug in julia. lldb/readline appear to be at fault here.

@nolta
Copy link
Member

nolta commented Mar 24, 2014

Possibly related, @loladiro's REPL.jl code also crashes under lldb, because the terminal width is somehow getting set to zero.

@Keno
Copy link
Member

Keno commented Mar 24, 2014

That's interesting. I've never seen that and I'm using lldb quite a bit.

@nolta
Copy link
Member

nolta commented Mar 24, 2014

Here's what i'm seeing:

$ lldb ./usr/bin/julia-basic 
Current executable set to './usr/bin/julia-basic' (x86_64).
(lldb) r ~/.julia/v0.3/REPL/scripts/repl.jl
Process 46159 launched: './usr/bin/julia-basic' (x86_64)
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2156 (2014-03-24 16:53 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit c81664a* (0 days old master)
|__/                   |  x86_64-apple-darwin13.1.0

julia> ERROR: integer division error
 in div at promotion.jl:172
 in refreshMultiLine at /Users/nolta/.julia/v0.3/Readline/src/Readline.jl:195
 in activate at /Users/nolta/.julia/v0.3/Readline/src/Readline.jl:1034
 in activate at /Users/nolta/.julia/v0.3/Readline/src/Readline.jl:1039
 in prompt! at /Users/nolta/.julia/v0.3/Readline/src/Readline.jl:1120
 in run_interface at /Users/nolta/.julia/v0.3/Readline/src/Readline.jl:1102
 in run_repl at /Users/nolta/.julia/v0.3/REPL/src/REPL.jl:573
 in anonymous at no file:33
 in include_from_node1 at loading.jl:120
while loading /Users/nolta/.julia/v0.3/REPL/scripts/repl.jl, in expression starting on line 8

Process 46159 exited with status = 1 (0x00000001) 
(lldb) v
lldb-310.2.36

@vtjnash
Copy link
Member

vtjnash commented Mar 25, 2014

@loladiro haven't you been using iTerm2?

After hacking on #4589 over the weekend, I wonder if this is just a misconfiguration of a terminal setting, such as ICRNL/INLCR

@Keno
Copy link
Member

Keno commented Mar 25, 2014

Actually now that I see that error, I have seen it (I guess usually when I debug things with lldb julia crashes before making it to the prompt).

@JeffBezanson
Copy link
Member

No longer relevant since we don't use readline. But see #6419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop) system:mac Affects only macOS
Projects
None yet
Development

No branches or pull requests

5 participants