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

ReadVTK.jl is breaking #49

Closed
eliascarv opened this issue Nov 21, 2023 · 6 comments
Closed

ReadVTK.jl is breaking #49

eliascarv opened this issue Nov 21, 2023 · 6 comments

Comments

@eliascarv
Copy link
Contributor

I believe this may have occurred after the LightXML.jl update, but I can't say for sure.
MWE:

julia> import ReadVTK

julia> file = ReadVTK.get_example_file("celldata_appended_binary_compressed.vtu")
"./celldata_appended_binary_compressed.vtu"

julia> vtk = ReadVTK.VTKFile(file)
Entity: line 25: parser error : Extra content at the end of the document
</VTKFile>
          ^
ERROR: LightXML.XMLParseError{String}("Failure in parsing an XML file.")
Stacktrace:
 [1] _check_result
   @ ~/.julia/packages/LightXML/g6rbQ/src/document.jl:88 [inlined]
 [2] parse_string(s::String)
   @ LightXML ~/.julia/packages/LightXML/g6rbQ/src/document.jl:99
 [3] ReadVTK.VTKFile(filename::String)
   @ ReadVTK ~/.julia/packages/ReadVTK/XpdR0/src/ReadVTK.jl:106
 [4] top-level scope
   @ REPL[2]:1
@juliohm
Copy link

juliohm commented Nov 22, 2023

I can reproduce the error with a fresh installation of the package.

@sloede
Copy link
Member

sloede commented Nov 23, 2023

LightXML.jl has not been updated in over three years, but the underlying XML2_jll package (providing the libxml2 binaries) was just updated to v2.12 just yesterday. Could you please try to force your installation to use XML2_jll v2.11.5 to verify that this has been caused by the update of libxml2?

Also, does this error only occur for the referenced file or for other example files as well?

@eliascarv
Copy link
Contributor Author

The same error occurs with files generated by WriteVTK.jl.

MWE in a fresh environment:

(jl_h7aCcK) pkg> st
Status `/tmp/jl_h7aCcK/Project.toml`
  [dc215faf] ReadVTK v0.2.0
  [64499a7a] WriteVTK v1.18.1

julia> using ReadVTK, WriteVTK

julia> savedir = mktempdir()
"/tmp/jl_zxRx3U"

julia> filepath = joinpath(savedir, "test.vti")
"/tmp/jl_zxRx3U/test.vti"

julia> vtk_grid(filepath, 0:10, 0:10) do vtk
           vtk["data", VTKCellData()] = rand(100)
       end
1-element Vector{String}:
 "/tmp/jl_zxRx3U/test.vti"

julia> vtk = VTKFile(filepath)
Entity: line 13: parser error : Extra content at the end of the document
</VTKFile>
          ^
ERROR: LightXML.XMLParseError{String}("Failure in parsing an XML file.")
Stacktrace:
 [1] _check_result
   @ ~/.julia/packages/LightXML/g6rbQ/src/document.jl:88 [inlined]
 [2] parse_string(s::String)
   @ LightXML ~/.julia/packages/LightXML/g6rbQ/src/document.jl:99
 [3] VTKFile(filename::String)
   @ ReadVTK ~/.julia/packages/ReadVTK/XpdR0/src/ReadVTK.jl:106
 [4] top-level scope
   @ REPL[8]:1

@ranocha
Copy link
Member

ranocha commented Nov 24, 2023

  • What's your pkg> status -m XML2_jll?
  • For me, your MWE posted directly above doesn't throw an error. Which OS are you using?

@juliohm
Copy link

juliohm commented Nov 24, 2023

I can reproduce the error:

julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 8 on 8 virtual cores
Environment:
  JULIA_NUM_THREADS = 8

julia> st -m XML2_jll
Status `/tmp/jl_ASS4qI/Manifest.toml`
  [02c8fc9c] XML2_jll v2.12.0+0

@eliascarv
Copy link
Contributor Author

With the new version 0.9.1 of LightXML.jl, ReadVTK.jl is working again!

julia> import ReadVTK

julia> savedir = mktempdir()
"/tmp/jl_P1Y27C"

julia> file = ReadVTK.get_example_file("celldata_appended_binary_compressed.vtu", output_directory=savedir)
"/tmp/jl_P1Y27C/celldata_appended_binary_compressed.vtu"

julia> vtk = ReadVTK.VTKFile(file)
VTKFile("/tmp/jl_P1Y27C/celldata_appended_binary_compressed.vtu", <XMLDocument>, "UnstructuredGrid", "1.0.0", "LittleEndian", "vtkZLibDataCompressor", <appended_data>, 4434, 3085)

(jl_YImX40) pkg> status -m LightXML
Status `/tmp/jl_YImX40/Manifest.toml`
  [9c8b4983] LightXML v0.9.1

(jl_YImX40) pkg> status
Status `/tmp/jl_YImX40/Project.toml`
  [dc215faf] ReadVTK v0.2.0

Closing the issue.

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

4 participants