Strange behavior of Debugger, Atom, Julia code?

I was wondering, does anyone experience something strange like what I encountered currently.
Code:

using OpenStreetMapX
using Debugger

@enter OpenStreetMapX.get_map_data("/home/Desktop/s.osm")
println("haha")

Then, REPL

86  function get_map_data(filepath::String,filename::Union{String,Nothing}=nothing; road_levels::Set{Int} = Set(1:length(OpenStreetMapX.ROAD_CLASSES)),use_cache::Bool = true,only_intersections=true)::MapData
 87      #preprocessing map file
>88      datapath = (filename==nothing) ? dirname(filepath) : filepath;
 89     if filename == nothing
 90         filename = basename(filepath)
 91     end
 92     cachefile = joinpath(datapath,filename*".cache")

About to run: (Core.Box)()
julia> n

1|debug> n
In #get_map_data#6(road_levels, use_cache, only_intersections, , filepath, filename) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
 86  function get_map_data(filepath::String,filename::Union{String,Nothing}=nothing; road_levels::Set{Int} = Set(1:length(OpenStreetMapX.ROAD_CLASSES)),use_cache::Bool = true,only_intersections=true)::MapData
 87      #preprocessing map file
 88      datapath = (filename==nothing) ? dirname(filepath) : filepath;
>89     if filename == nothing
 90         filename = basename(filepath)
 91     end
 92     cachefile = joinpath(datapath,filename*".cache")
 93     if use_cache && isfile(cachefile)

About to run: (==)(nothing, nothing)
1|debug> n
In #get_map_data#6(road_levels, use_cache, only_intersections, , filepath, filename) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
 86  function get_map_data(filepath::String,filename::Union{String,Nothing}=nothing; road_levels::Set{Int} = Set(1:length(OpenStreetMapX.ROAD_CLASSES)),use_cache::Bool = true,only_intersections=true)::MapData
 87      #preprocessing map file
 88      datapath = (filename==nothing) ? dirname(filepath) : filepath;
 89     if filename == nothing
>90         filename = basename(filepath)
 91     end
 92     cachefile = joinpath(datapath,filename*".cache")
 93     if use_cache && isfile(cachefile)
 94         f=open(cachefile,"r");

About to run: (basename)("/home/Desktop/s.osm")
1|debug> n
In #get_map_data#6(road_levels, use_cache, only_intersections, , filepath, filename) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
 88      datapath = (filename==nothing) ? dirname(filepath) : filepath;
 89     if filename == nothing
 90         filename = basename(filepath)
 91     end
>92     cachefile = joinpath(datapath,filename*".cache")
 93     if use_cache && isfile(cachefile)
 94         f=open(cachefile,"r");
 95         res=Serialization.deserialize(f);
 96         close(f);

About to run: (*)("s.osm", ".cache")
1|debug> n
In #get_map_data#6(road_levels, use_cache, only_intersections, , filepath, filename) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
 89     if filename == nothing
 90         filename = basename(filepath)
 91     end
 92     cachefile = joinpath(datapath,filename*".cache")
>93     if use_cache && isfile(cachefile)
 94         f=open(cachefile,"r");
 95         res=Serialization.deserialize(f);
 96         close(f);
 97         @info "Read map data from cache $cachefile"

About to run: (isfile)("/home/Desktop/s.osm.cache")
1|debug> n
In #get_map_data#6(road_levels, use_cache, only_intersections, , filepath, filename) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
  95        res=Serialization.deserialize(f);
  96        close(f);
  97        @info "Read map data from cache $cachefile"
  98    else
> 99        mapdata = OpenStreetMapX.parseOSM(joinpath(datapath,filename))
 100        OpenStreetMapX.crop!(mapdata,crop_relations = false)
 101        #preparing data
 102        bounds = mapdata.bounds
 103        nodes = OpenStreetMapX.ENU(mapdata.nodes,OpenStreetMapX.center(bounds))

About to run: (joinpath)("/home/Desktop", "s.osm")

Then my relatively quick work space computer got stuck like forever. One confusing point is: the Debugger tells me that it is about to run the joinpath function, which should be really quick to run. But when I press ctrol + c to interrupt the julia processing, it told me a bunch of info about the parseMap function call, which should be next step, right? Any comments are greatly appreciated.

EDIT: After press ctrol +c to interupt the processing, the following is the output:

ERROR: "InterruptException(), , 0, 0, 0"
Stacktrace:
 [1] #parsefile#21(::Int64, ::OpenStreetMapX.DataHandle, ::typeof(LibExpat.parsefile), ::String, ::LibExpat.XPCallbacks) at /home/devel/.julia/packages/LibExpat/6jLDP/src/streaming.jl:237
 [2] (::getfield(LibExpat, Symbol("#kw##parsefile")))(::NamedTuple{(:data,),Tuple{OpenStreetMapX.DataHandle}}, ::typeof(LibExpat.parsefile), ::String, ::LibExpat.XPCallbacks) at none:0
 [3] #parseOSM#5(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(OpenStreetMapX.parseOSM), ::String) at /home/devel/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:65
 [4] parseOSM(::String) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:61
 [5] #get_map_data#6(::Set{Int64}, ::Bool, ::Bool, ::typeof(get_map_data), ::String, ::Nothing) at /home/devel/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:99
 [6] get_map_data(::String, ::Nothing) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
 [7] get_map_data(::String) at /home/.julia/packages/OpenStreetMapX/vHhHu/src/parseMap.jl:88
haha

Interpreting code can be very slow, and parseOSM seems like it would potentially do lots of operations. Try turning on Compiled mode (uless you want to check what’s happening in that function).

n steps to the next line, whereas se steps to the next expression.

1 Like