JuliaGraphics / Cairo.jl

Bindings to the Cairo graphics library.
Other
86 stars 56 forks source link

Cairo/Windows ReadOnlyMemoryError() #363

Open cormullion opened 7 months ago

cormullion commented 7 months ago

When running my tests on CI (both Julia 1.9 - windows-latest - x64 and Julia 1 - windows-latest - x64) I'm seeing a ReadOnlyMemoryError():

 Got exception outside of a @test
  LoadError: ReadOnlyMemoryError()
  Stacktrace:
    [1] get_layout_size
      @ C:\Users\runneradmin\.julia\packages\Cairo\smWIA\src\Cairo.jl:1184 [inlined]
    [2] text(ctx::Cairo.CairoContext, x::Float64, y::Float64, str::String; halign::String, valign::String, angle::Int64, markup::Bool)
      @ Cairo C:\Users\runneradmin\.julia\packages\Cairo\smWIA\src\Cairo.jl:1265
    [3] text
      @ C:\Users\runneradmin\.julia\packages\Cairo\smWIA\src\Cairo.jl:1255 [inlined]

from log here

I don't know what this error means or how significant it is... Tests run OK on MacOS and Linux. Cairo v1.0.5.

mwlidar commented 3 months ago

Had the same problem. What helped was to revert (and pin) Glib_jll to version 2.76.5. The downside is that this is in conflict with the latest versions of Gtk4 and CairoMakie...

There are also other packages which run perfectly fine on non-Windows platforms but suffer from these ReadOnlyMemoryErrors on Windows, like for example GRIB.jl. I really hope that a Windows-expert will popup soon to solve this!

jwahlstrand commented 2 months ago

For me locally this is fixed with Pango_jll 1.54.0.

mwlidar commented 2 months ago

For me the crashes (1.10.4 / Windows11) are also gone with the latest versions of Cairo/Pango etc. But now I have text cut off by a few pixels at the top 😒 Will open a separate issue on that...