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

A few StackOverflows in a row cause EXC_BAD_ACCESS crash #28723

Closed
NHDaly opened this issue Aug 17, 2018 · 2 comments
Closed

A few StackOverflows in a row cause EXC_BAD_ACCESS crash #28723

NHDaly opened this issue Aug 17, 2018 · 2 comments

Comments

@NHDaly
Copy link
Member

NHDaly commented Aug 17, 2018

I was putzing around with some code (a custom implementation of an sql interpreter), when I introduced a bug in my code that leads to a crash in Julia 1.0. In Juno, it crashes on the first StackOverflowError, but on the repl, it only crashes on the third one.

(10:24:55) $ lldb julia1
(lldb) target create "julia1"
Current executable set to 'julia1' (x86_64).
(lldb) r
Process 55976 launched: '/usr/local/bin/julia1' (x86_64)
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0-rc1.0 (2018-08-07 16:29 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin14.5.0

julia> include("sql.jl")
@SQL

julia> # CREATE TABLE
       create_table("hi", ("id",Int))
hi
 id
---



julia> t = create_table("people", ("id",Int), ("name", String))
people
 id     | name
---     |-----



julia> insert_into_values(t, (1,"sarah"))

julia> insert_into_values(t, (2,"nathan"))

julia> insert_into_values(t, (3,"max"))

julia> select_from(t, "name")  # Even this one crashes when calling through Juno for whatever reason
ERROR: StackOverflowError:
Stacktrace:
 [1] Type at ./boot.jl:394 [inlined]
 [2] Type at ./boot.jl:403 [inlined]
 [3] Type at ./boot.jl:411 [inlined]
 [4] similar at ./abstractarray.jl:618 [inlined]
 [5] similar at ./abstractarray.jl:617 [inlined]
 [6] vect(::Symbol) at ./array.jl:130
 [7] select_from(::Table, ::Symbol) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45
 [8] select_from(::Table, ::Array{Symbol,1}) at /Users/daly/Documents/School/Khan/SQL/sql.jl:47
 ... (the last 2 lines are repeated 19401 more times)
 [38811] select_from(::Table, ::Symbol) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45
 [38812] select_from at /Users/daly/Documents/School/Khan/SQL/sql.jl:47 [inlined]
 [38813] select_from(::Table, ::String) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45

julia> select_from(t, "*")
ERROR: StackOverflowError:
Stacktrace:
 [1] Type at ./boot.jl:394 [inlined]
 [2] Type at ./boot.jl:403 [inlined]
 [3] Type at ./boot.jl:411 [inlined]
 [4] similar at ./abstractarray.jl:618 [inlined]
 [5] similar at ./abstractarray.jl:617 [inlined]
 [6] vect(::Symbol) at ./array.jl:130
 [7] select_from(::Table, ::Symbol) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45
 [8] select_from(::Table, ::Array{Symbol,1}) at /Users/daly/Documents/School/Khan/SQL/sql.jl:47
 ... (the last 2 lines are repeated 19401 more times)
 [38811] select_from(::Table, ::Symbol) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45
 [38812] select_from at /Users/daly/Documents/School/Khan/SQL/sql.jl:47 [inlined]
 [38813] select_from(::Table, ::String) at /Users/daly/Documents/School/Khan/SQL/sql.jl:45

julia> select_from(t, :*)   # this one crashes in the REPL
Process 55976 stopped
* thread JuliaLang/julia#3, stop reason = EXC_BAD_ACCESS (code=2, address=0x7ffeef3ffff8)
    frame #0: 0x0000000100209650 libjulia.1.0.dylib`libunwind::LocalAddressSpace::get64(this=0x00000001005c36d8, addr=140732912369656) at AddressSpace.hpp:92
Target 0: (julia1) stopped.
(lldb) bt
* thread JuliaLang/julia#3, stop reason = EXC_BAD_ACCESS (code=2, address=0x7ffeef3ffff8)
  * frame #0: 0x0000000100209650 libjulia.1.0.dylib`libunwind::LocalAddressSpace::get64(this=0x00000001005c36d8, addr=140732912369656) at AddressSpace.hpp:92
    frame JuliaLang/julia#1: 0x000000010020dd33 libjulia.1.0.dylib`libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingRBPFrame(compactEncoding=16842753, functionStart=4295950064, addressSpace=0x00000001005c36d8, registers=0x000070000906d758) at CompactUnwinder.hpp:618
    frame JuliaLang/julia#2: 0x000000010020d978 libjulia.1.0.dylib`libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncoding(compactEncoding=16842753, functionStart=4295950064, addressSpace=0x00000001005c36d8, registers=0x000070000906d758) at CompactUnwinder.hpp:545
    frame JuliaLang/julia#3: 0x000000010020d8f9 libjulia.1.0.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithCompactEncoding(this=0x000070000906d700, (null)=0x000070000906d4d0) at UnwindCursor.hpp:339
    frame JuliaLang/julia#4: 0x000000010020ab7c libjulia.1.0.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithCompactEncoding(this=0x000070000906d700) at UnwindCursor.hpp:337
    frame JuliaLang/julia#5: 0x0000000100209f6a libjulia.1.0.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step(this=0x000070000906d700) at UnwindCursor.hpp:876
    frame JuliaLang/julia#6: 0x000000010020922e libjulia.1.0.dylib`::unw_step(cursor=0x000070000906d700) at libuwind.cxx:288
    frame JuliaLang/julia#7: 0x00000001000f0e68 libjulia.1.0.dylib`jl_unw_stepn [inlined] jl_unw_step(cursor=0x000070000906d700, sp=0x00007ffeef400000, fp=0x0000000000000000) at stackwalk.c:376 [opt]
    frame JuliaLang/julia#8: 0x00000001000f0e12 libjulia.1.0.dylib`jl_unw_stepn(cursor=0x000070000906d700, ip=0x000000010bf00000, sp=0x0000000000000000, maxsize=80000, add_interp_frames=1) at stackwalk.c:51 [opt]
    frame JuliaLang/julia#9: 0x00000001000f1035 libjulia.1.0.dylib`rec_backtrace_ctx(data=0x000000010bf00000, maxsize=80000, context=<unavailable>) at stackwalk.c:86 [opt]
    frame JuliaLang/julia#10: 0x00000001000ff4e2 libjulia.1.0.dylib`jl_throw_in_thread(tid=<unavailable>, thread=775, exception=0x0000000107bd23c0) at signals-mach.c:148 [opt]
    frame JuliaLang/julia#11: 0x00000001000ff318 libjulia.1.0.dylib`catch_exception_raise(exception_port=<unavailable>, thread=775, task=<unavailable>, exception=1, code=<unavailable>, code_count=<unavailable>) at signals-mach.c:245 [opt]
    frame JuliaLang/julia#12: 0x00007fff7acc78b1 libsystem_kernel.dylib`_Xexception_raise + 159
    frame JuliaLang/julia#13: 0x00007fff7acc7b50 libsystem_kernel.dylib`exc_server + 80
    frame JuliaLang/julia#14: 0x00007fff7acd7f94 libsystem_kernel.dylib`mach_msg_server + 417
    frame JuliaLang/julia#15: 0x00000001000ff05d libjulia.1.0.dylib`mach_segv_listener(arg=<unavailable>) at signals-mach.c:75 [opt]
    frame JuliaLang/julia#16: 0x00007fff7aea9661 libsystem_pthread.dylib`_pthread_body + 340
    frame JuliaLang/julia#17: 0x00007fff7aea950d libsystem_pthread.dylib`_pthread_start + 377
    frame JuliaLang/julia#18: 0x00007fff7aea8bf9 libsystem_pthread.dylib`thread_start + 13
(lldb)

(And this time, I've made sure that i don't have anything in my juliarc... 😊🙈)

Let me know if i can help more! :)

@KristofferC
Copy link
Member

KristofferC commented Aug 17, 2018

Dup of JuliaLang/LinearAlgebra.jl#517, #25715 perhaps (stackoverflow crashes mac)?

@NHDaly
Copy link
Member Author

NHDaly commented Aug 17, 2018

Ah yes, it appears so. And also #17109.

Thanks.

@NHDaly NHDaly closed this as completed Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants