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

Streaming interface crashes Julia #38

Closed
IlyaOrson opened this issue Dec 26, 2017 · 3 comments
Closed

Streaming interface crashes Julia #38

IlyaOrson opened this issue Dec 26, 2017 · 3 comments

Comments

@IlyaOrson
Copy link

IlyaOrson commented Dec 26, 2017

I get a weird error that asks me to file a bug report and crashes julia. It appears while using the streaming interface, where I use expandtree and throw an error inside the loop of the elements of the node generated.

It's tricky but here are some experiments that sometimes throw the error.

  • If I use the reader = open() ... close(reader) syntax then it won't crash but throw a warning instead (see below).
  • If I use the open() do reader... end syntax and toggle between error and throwerror the error appears and dissappears. Here is my MWE:
using EzXML

function load_error_graphml(filename)
    # reader = open(EzXML.StreamReader, filename)
    open(EzXML.StreamReader, filename) do reader #
        serial = 0
        nodes = Dict{String,Int}()
        edges = Pair{Int,Int}[]
        for typ in reader
            if typ == EzXML.READER_ELEMENT
                elname = EzXML.nodename(reader)
                if elname == "node"
                    serial += 1
                    nodes[reader["id"]] = serial
                elseif elname == "edge"
                    info = EzXML.expandtree(reader)
                    for element in EzXML.eachelement(info)
                        # throw(KeyError)
                        error("Hi!") #
                    end
                end
            end
        end
    end #
    # close(reader)
end

I get this message before the crash:

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xecbbd02 -- #3 at C:\Users\ilya.sandoval.julia\v0.6\EzXML\src\node.jl:320
while loading C:\Users\ilya.sandoval.atom\packages\julia-client\script\boot.jl, in expression starting on line 303
#3 at C:\Users\ilya.sandoval.julia\v0.6\EzXML\src\node.jl:320
traverse_tree at C:\Users\ilya.sandoval.julia\v0.6\EzXML\src\node.jl:486
finalize_node at C:\Users\ilya.sandoval.julia\v0.6\EzXML\src\node.jl:316
unknown function (ip: 000000000ECBBCA6)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1424 [inlined]
run_finalizer at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:111
jl_gc_run_finalizers_in_list at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:200
run_finalizers at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:234
jl_gc_collect at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:2112
jl_gc_pool_alloc at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:919 [inlined]
jl_gc_alloc_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:249 [inlined]
jl_gc_alloc at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:2129
new_array at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:96 [inlined]
new_array at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:149 [inlined]
jl_alloc_array_1d at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:372
flatten at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\summaries.jl:7
description at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\summaries.jl:82
withmeta at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\completions.jl:50
collect_to! at .\array.jl:474
unknown function (ip: 000000000ECD096B)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
collect_to! at .\array.jl:484
unknown function (ip: 000000000ECCCD0B)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
collect at .\array.jl:442
withmeta at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\completions.jl:58
unknown function (ip: 000000000ECCC6CA)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
namecompletions
at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\completions.jl:63
unknown function (ip: 000000000ECC893D)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1424 [inlined]
jl_f__apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\builtins.c:426
#5 at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\utils.jl:18
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_invoke at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:41
#completions#42 at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\completions.jl:190
unknown function (ip: 000000000ECC2D19)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
#completions at .<missing>:0
completions at C:\Users\ilya.sandoval.julia\v0.6\CodeTools\src\completions.jl:195
unknown function (ip: 000000000ECC7866)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
#103 at C:\Users\ilya.sandoval.julia\v0.6\Atom\src\completions.jl:23
unknown function (ip: 000000000ECC7786)
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
jl_apply_2va at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\rtutils.c:286
handlemsg at C:\Users\ilya.sandoval.julia\v0.6\Atom\src\comm.jl:163
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1424 [inlined]
jl_f__apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\builtins.c:426
#11 at .\event.jl:73
jl_call_fptr_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1933
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1424 [inlined]
start_task at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:267
Allocations: 7319388 (Pool: 7317609; Big: 1779); GC: 16

The warning (the best clue?):

error in running finalizer:
TypeError(func=:#3, context="typeassert", expected=EzXML.Node, got=<?#00000000169B0C10::<?#00000000169B0C20::0000000000000000>>)

My version:

julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
@IlyaOrson
Copy link
Author

I am using this .graphml file:

<?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"><key attr.name="length" attr.type="string" for="edge" id="d11"/>
<key attr.name="maxspeed" attr.type="string" for="edge" id="d10"/>
<key attr.name="highway" attr.type="string" for="edge" id="d9"/>
<key attr.name="name" attr.type="string" for="edge" id="d8"/>
<key attr.name="lanes" attr.type="string" for="edge" id="d7"/>
<key attr.name="oneway" attr.type="string" for="edge" id="d6"/>
<key attr.name="osmid" attr.type="string" for="edge" id="d5"/>
<key attr.name="osmid" attr.type="string" for="node" id="d4"/>
<key attr.name="x" attr.type="string" for="node" id="d3"/>
<key attr.name="y" attr.type="string" for="node" id="d2"/>
<key attr.name="crs" attr.type="string" for="graph" id="d1"/>
<key attr.name="name" attr.type="string" for="graph" id="d0"/>
<graph edgedefault="directed"><data key="d0">unnamed</data>
<data key="d1">{'init': 'epsg:4326'}</data>
<node id="268378315">
  <data key="d2">19.4112989</data>
  <data key="d3">-99.1661278</data>
  <data key="d4">268378315</data>
</node>
<node id="767144194">
  <data key="d2">19.4106784</data>
  <data key="d3">-99.1659731</data>
  <data key="d4">767144194</data>
</node>
<node id="767144208">
  <data key="d2">19.4096445</data>
  <data key="d3">-99.1656919</data>
  <data key="d4">767144208</data>
</node>
<node id="5117499534">
  <data key="d2">19.4113146</data>
  <data key="d3">-99.1660387</data>
  <data key="d4">5117499534</data>
</node>
<edge id="0" source="767144194" target="268378315">
  <data key="d5">24690027</data>
  <data key="d6">True</data>
  <data key="d7">2</data>
  <data key="d8">Manzanillo</data>
  <data key="d9">residential</data>
  <data key="d10">40</data>
  <data key="d11">70.87837651238934</data>
</edge>
<edge id="0" source="767144208" target="767144194">
  <data key="d5">24690027</data>
  <data key="d6">True</data>
  <data key="d7">2</data>
  <data key="d8">Manzanillo</data>
  <data key="d9">residential</data>
  <data key="d10">40</data>
  <data key="d11">118.68687083701978</data>
</edge>
<edge id="0" source="5117499534" target="268378315">
  <data key="d5">24690037</data>
  <data key="d6">True</data>
  <data key="d7">1</data>
  <data key="d8">Tapachula</data>
  <data key="d9">residential</data>
  <data key="d11">9.505876802183968</data>
</edge>
</graph></graphml>

@IlyaOrson IlyaOrson changed the title Crashes Julia Streaming interfacec crashes Julia Dec 26, 2017
@IlyaOrson IlyaOrson changed the title Streaming interfacec crashes Julia Streaming interface crashes Julia Dec 26, 2017
@bicycle1885
Copy link
Member

Thank you for reporting. I think this will be fixed in #39. Can you try the branch?

@IlyaOrson
Copy link
Author

That seems to fix it, thanks!

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