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

Gadfly embedded NULs and invalid plotting #1535

Closed
datadreamscorp opened this issue Apr 28, 2021 · 8 comments
Closed

Gadfly embedded NULs and invalid plotting #1535

datadreamscorp opened this issue Apr 28, 2021 · 8 comments

Comments

@datadreamscorp
Copy link

Opened one of my scripts today to find this error whenever I tried to plot using a DataFrame in Pluto.jl. Tried plotting to vectors in another session and axis ticks are not showing properly (image below), which I guess is part of the problem.

Failed to show value:

ArgumentError: embedded NULs are not allowed in C strings: "-\0.\0"

[email protected]:216[inlined]
pango_to_svg(::String)@pango.jl:330
draw(::Compose.SVG, ::Compose.TextPrimitive{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Compose.Rotation{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, ::Int64)@svg.jl:975
draw(::Compose.SVG, ::Compose.Form{Compose.TextPrimitive{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Compose.Rotation{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}})@svg.jl:732
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:477
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
drawpart(::Compose.SVG, ::Compose.AdhocContainerPromise, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:390
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
drawpart(::Compose.SVG, ::Compose.Table, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:390
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
[email protected]:356[inlined]
show(::IOContext{IOBuffer}, ::MIME{Symbol("text/html")}, ::Compose.Context)@Compose.jl:182
show_richest(::IOContext{IOBuffer}, ::Any)@PlutoRunner.jl:640
var"#sprint_withreturned#28"(::IOContext{Base.DevNull}, ::Int64, ::typeof(Main.PlutoRunner.sprint_withreturned), ::Function, ::Compose.Context)@PlutoRunner.jl:579
format_output_default(::Any, ::Any)@PlutoRunner.jl:503
#format_output#[email protected]:520[inlined]
formatted_result_of(::Base.UUID, ::Bool, ::Nothing)@PlutoRunner.jl:435
top-level scope@none:1

Screenshot_20210428_113615

@datadreamscorp datadreamscorp changed the title Gadfly embedded NULs and invalid plotting in Pluto.jl Gadfly embedded NULs and invalid plotting Apr 28, 2021
@datadreamscorp
Copy link
Author

Happening in REPL as well.

@pdeffebach
Copy link

pdeffebach commented Apr 29, 2021

I can reproduce on Mac with 1.6.0. Not the error, but the unicode errors in the axes.

@rikhuijzer
Copy link
Contributor

It also occurs for me on NixOS with a fresh Julia after updating my dependencies. I'll see whether I can find the upstream culprit.

@Mattriks
Copy link
Member

There's a discourse thread too

@rikhuijzer
Copy link
Contributor

When looking at the dependencies, I would expect it to be Colors.jl since it got updated two days ago. Unfortunately, pinning that to 0.12.6 as used here doesn't seem to be helping.

@rikhuijzer
Copy link
Contributor

I've got the first Gadfly error on 2021-04-28 around 15:00 GMT. When looking through the General registry for changes, there recently have been updates to:

I've pinned them all to older versions with a Gadfly dev project, but plots keep failing. I guess that to fix this, it is necessary to approach the problem from another direction, namely debugging the code.

@rikhuijzer
Copy link
Contributor

rikhuijzer commented Apr 29, 2021

I'm pretty sure that Showoff.jl is the culprit. On Julia 1.6.1 in my normal environment:

julia> using Showoff

julia> showoff([100.0], :auto)
1-element Vector{String}:
 "\x0000"

and on Julia 1.5, Julia 1.6.0 and Julia 1.6.1 via Docker with Showoff v.1.0.2.

julia> showoff([100.0], :auto)
1-element Array{String,1}:
 "100"

@rikhuijzer
Copy link
Contributor

@datadreamscorp The issue should be solved by https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/10. Can you close this issue or do you still have problems?

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