I have some code that works fine in Atom/Juno debugger but when I run it directly in Julia it goes in some sort of cycle and spins forever. Any ideas on how to debug such a thing? I have tried to attach to the julia process with gdb and look at the stack but that does’t help me too much. See one of the traces below, maybe somebody has some idea what’s going on.
I also have looked a the thread stack using Process Explorer and it seems to be doing some sort of type checking.
The code was translated automatically from a type safe language and then hand changed a bit to make it work, so it basically has type definitions for everything. Also, large structures are send around to most of the functions. As far as I can tell it seems to be some sort of type conversion going on but I don’t quite know where it comes from using the debugger tools available. As I said, it works fine in Juno so I can’t debug using that.
You can find two of the gdb traces here (I could not paste them here as it complained about post size):
When I can’t reproduce things in the debugger I usually fall back on logging. If you know the area that appears to be hanging add lots of logging there and reproduce.
julia> methods(Main.OMCompiler.run)
# 1 method for generic function "run":
[1] run() in Main.OMCompiler at C:\home\adrpo33\dev\julia\OMCompiler.jl\src\Main\all.jl:62
julia> precompile(Main.OMCompiler.run, ())
Any idea how to debug this one?
It just sits like that for hours and just gathers memory, I killed it at 5GB last time.
I do:
include(“src/Main/all.jl”)
and that precompiles for about 15 minutes and then I call that.
You can see the code here:
Truth is that we have a lot of recursive module imports, maybe that’s the issue.