Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Gallium hangs on OSX #178

Open
cstjean opened this issue Nov 17, 2016 · 3 comments
Open

Gallium hangs on OSX #178

cstjean opened this issue Nov 17, 2016 · 3 comments

Comments

@cstjean
Copy link

cstjean commented Nov 17, 2016

I've never been able to do anything with Gallium. In a fresh session, with Gallium 0.0.4

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

julia> using Gallium    # version 0.0.4

julia> Gallium.breakpoint_on_error()
Gallium.Hooking.Hook(Ptr{Void} @0x0000000104f4c6e0,UInt8[0x55,0x48,0x89,0xe5,0x41,0x56,0x53,0x49,0x89,0xfe,0xe8,0x81,0xd8,0x01,0x00],Gallium.breakpoint_on_error_hit)

julia> asin(-2)

just hangs, while the CPU spins. Ctrl-C doesn't work, and I have to kill the process. I'm assuming that this is different from #164.

Also, not sure if I should open another issue, but Gallium's master fails to precompile (on 0.5)

julia> using Gallium
ERROR: InitError: UndefVarError: isBSS not defined
 in (::Gallium.##21#22{MachO.Sections,String})(::MachO.SectionRef{MachO.MachOHandle{Base.AbstractIOBuffer{Array{UInt8,1}}},MachO.section_64
...
@ihnorton
Copy link
Contributor

When I run the example, it hangs -- CPU pegged, can't Ctrl^C -- but eventually errors out (maybe 5 minutes; left it open and wasn't paying close attention to time).

However, I have been able to use all other Gallium functionality I've tried on this system.

julia> asin(-2)
ERROR: KeyError: key Ptr{Void} @0x0000000100794250 not found
 in pop!(::Dict{Ptr{Void},Gallium.Hooking.Hook}, ::Ptr{Void}) at ./dict.jl:717
 in unhook(::Ptr{Void}) at /Users/inorton/.julia/v0.5/Gallium/src/Hooking/Hooking.jl:476
 in breakpoint_on_error_hit(::Gallium.Hooking.Hook, ::Gallium.X86_64.ExtendedRegs) at /Users/inorton/.julia/v0.5/Gallium/src/Gallium.jl:938
 in _callback(::Ptr{Void}) at /Users/inorton/.julia/v0.5/Gallium/src/Hooking/Hooking.jl:289
 in callback(::Ptr{Void}) at /Users/inorton/.julia/v0.5/Gallium/src/Hooking/Hooking.jl:326
 in asin(::Int64) at ./math.jl:204

(OS: macOS (x86_64-apple-darwin15.6.0), CPU: Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz, LLVM: libLLVM-3.7.1 (ORCJIT, broadwell))

@Keno
Copy link
Member

Keno commented Nov 17, 2016

Try on master. I may have fixed this issue, but not tagged yet.

@ihnorton
Copy link
Contributor

Looks good after the MachO fix. I'm not sure what the No file found means, but bt is fine and I can walk up/down the stack and print variables:

julia> asin(-2)
ERROR: DomainError:

<No file found. Did DWARF parsing fail?>
1|debug > bt
[1] asin(x) at math.jl:202
  | #self# = <optimized out>
  | x = <optimized out>
[2] asin(x) at math.jl:204
  | #self# = <optimized out>
  | x::Int64 = 0
[3] eval(m, e) at boot.jl:234
  | #self# = <optimized out>
  | m = <not available here>
  | e = <not available here>
[4] eval(m, e) at boot.jl:234
  | #self# = <optimized out>
  | m = <optimized out>
  | e = <optimized out>
[5] eval_user_input(ast, backend) at REPL.jl:54
  | #self# = <optimized out>
  | ast::Expr = :(asin(-2))
  | backend::Base.REPL.REPLBackend = Base.REPL.REPLBackend(Channel{Any}(sz_max:1,sz_curr:0),Channel{Any}(sz_max:1,sz_curr:0),true,Task (runnable) @0x00000001129b9690)
  | iserr::UInt64 = 0x0000000000000000
  | lasterr::Tuple{Tuple{},Void} = ((),nothing)
  | err = <not available here>
  | value::Core.Box = Core.Box(#undef)
[6] #3() at event.jl:68
  | #self#::Base.REPL.##3#4{Base.REPL.REPLBackend} = Base.REPL.#3
  | tls = <not available here>
  | ast::Expr = :(asin(-2))
  | show_value = <not available here>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants