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

Crash on _xmlfree on Windows #1

Open
tknopp opened this issue Dec 6, 2013 · 6 comments
Open

Crash on _xmlfree on Windows #1

tknopp opened this issue Dec 6, 2013 · 6 comments

Comments

@tknopp
Copy link

tknopp commented Dec 6, 2013

Hi,

This is really a great package!

Still, I have to report one bug I have on windows. The complete Julia shell crashes when I call e.g. the content function. I have traced it down to the tri_xmlfree(p) function.
Do you have any idea or should this got to the Julia bug tracker as it seems to be not related to LightXML.

I use a windows dll of libxml2 to get this work.

P.S.: using MiniXML in Readme.md should be propably using LightXML

@lindahua
Copy link
Contributor

lindahua commented Dec 7, 2013

would you please post the code that led to the crash?

@tknopp
Copy link
Author

tknopp commented Dec 7, 2013

I do not have the code at hand (and the windows machine...) but I can generate a minimal example next week. The code works fine on linux and I am pretty sure that it is the "tri_xmlfree" function as the code works, when I change this function to do nothing.

@tknopp
Copy link
Author

tknopp commented Dec 9, 2013

Here on windows it crashes on:

using LightXML
xdoc = parse_string("MyContent")

when I remove _xmlfree(p) from _xcopystr(p::Xstr) in clib.jl everything works. Using xmlFree instead of libc free does also crash Julia.

@digital-carver
Copy link

I'm guessing the following errors fall under the same category:

julia> xdoc = parse_file("D:/tempstuff/filename.xml")
ERROR: error compiling parse_file:

julia> xs = parse_string("<head><mouth>tongue</mouth></head>")
ERROR: error compiling parse_string:

julia>
G:\> julia .\myxmlparse.jl
ERROR: error compiling parse_file:
 in include at boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at client.jl:285
 in _start at client.jl:354
while loading G:\progs\myxmlparse\myxmlparse.jl, in expression starting on line 4

but I don't yet have the knowledge to peek under the hood and verify it's the same _xmlfree that's causing the issue.

@samoconnor
Copy link

There is a comment next to _xcopystr() that says libc free is used instead of xmlFree: https://github.com/JuliaLang/LightXML.jl/blob/master/src/LightXML.jl#L37

However, the libxml2 manual is quite clear that xmlFree should be used: "It's up to the caller to free the memory with xmlFree()." : http://www.xmlsoft.org/html/libxml-tree.html#xmlNodeGetContent ...

This certainly smells NQR.

@tkelman
Copy link
Contributor

tkelman commented Jan 2, 2016

Hard to say whether @digital-carver's errors are at all related here, but I suspect the "tests" referred to in the comment in b33d030 were not run on windows. We should probably try using the libxml2 xmlFree instead.

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

5 participants