Issue occurring randomly with 1.11

When switching to julia 1.11 in a big project with lots of dependencies, I’ve encountered a strange issue that didn’t happen with 1.10.

After some debugging, I’ve managed to isolate the following small reproducible example. The minimal project to run this example declares 4 dependencies: GraphViz, FileIO, Cairo and CairoMakie.

(reproducer) pkg> status
Status `/tmp/reproducer/Project.toml`
  [159f3aea] Cairo v1.1.0
  [13f3f980] CairoMakie v0.12.14
  [5789e2e9] FileIO v1.16.3
  [f526b714] GraphViz v0.2.0

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
...

The minimal code producing the error only actually needs the first three deps; CairoMakie is included here only because it is needed elsewhere in the real use case, but its mere presence affects the whole project, depending on the order in which packages are loaded.

Here is an example which showcases the issue:

julia> using GraphViz
julia> using FileIO
julia> using CairoMakie  # CairoMakie loaded before Cairo
julia> using Cairo

julia> FileIO.save("tmp.png", dot"""
           digraph graphname {
               a -> b -> c;
               b -> d;
           }
       """)
Error: renderer for julia:cairo is unavailable
Errors encountered while save File{DataFormat{:PNG}, String}("tmp.png").
...

And here is another session in the same project, where simply changing the package loading order makes the issue disappear:

julia> using GraphViz
julia> using FileIO
julia> using Cairo
julia> using CairoMakie # CairoMakie loaded after Cairo

julia> FileIO.save("tmp.png", dot"""
           digraph graphname {
               a -> b -> c;
               b -> d;
           }
       """)
0

Also note that the same example works well with Julia 1.10 for both loading orders. Which leads me to the question: where would you think the error comes from (and should be reported if necessary)? Julia itself? One of the involved packages?

Or what type of tests could I perform to try and better understand what happens here? (And hopefully fix it in my real project)

4 Likes

Perhaps an instance of the FileIO.jl issues described here:

https://juliaio.github.io/FileIO.jl/stable/world_age_issue/

1 Like

for me, CairoMakie before Cairo works OK on v1.11.0

(@v1.11) pkg> activate @121233
  Activating new project at `~/.julia/environments/121233`

(@121233) pkg> add GraphViz, FileIO, CairoMakie, Cairo
   Resolving package versions...
   Installed Cairo_jll ───────────── v1.18.2+1
   Installed JpegTurbo_jll ───────── v3.0.4+0
   Installed LZO_jll ─────────────── v2.10.2+1
   Installed libpng_jll ──────────── v1.6.44+0
   Installed SIMD ────────────────── v3.6.0
   Installed AdaptivePredicates ──── v1.2.0
   Installed TranscodingStreams ──── v0.11.3
   Installed TiffImages ──────────── v0.10.2
   Installed OpenSSL_jll ─────────── v3.0.15+1
   Installed FFTW_jll ────────────── v3.3.10+1
   Installed JLLWrappers ─────────── v1.6.1
   Installed CairoMakie ──────────── v0.12.14
   Installed MakieCore ───────────── v0.8.9
   Installed libsixel_jll ────────── v1.10.3+1
   Installed Glib_jll ────────────── v2.80.5+0
   Installed IntervalArithmetic ──── v0.22.17
   Installed GraphViz ────────────── v0.2.0
   Installed QuadGK ──────────────── v2.11.1
   Installed GeoInterface ────────── v1.3.7
   Installed Distributions ───────── v0.25.112
   Installed Makie ───────────────── v0.21.14
   Installed DelaunayTriangulation ─ v1.6.0
  Downloaded artifact: JpegTurbo
  Downloaded artifact: Cairo
  Downloaded artifact: LZO
  Downloaded artifact: libpng
  Downloaded artifact: FFTW
  Downloaded artifact: OpenSSL
  Downloaded artifact: Glib
  Downloaded artifact: libsixel
    Updating `~/.julia/environments/121233/Project.toml`
  [159f3aea] + Cairo v1.1.0
  [13f3f980] + CairoMakie v0.12.14
  [5789e2e9] + FileIO v1.16.3
  [f526b714] + GraphViz v0.2.0
    Updating `~/.julia/environments/121233/Manifest.toml`
  [621f4979] + AbstractFFTs v1.5.0
  [1520ce14] + AbstractTrees v0.4.5
  [79e6a3ab] + Adapt v4.0.4
  [35492f91] + AdaptivePredicates v1.2.0
  [66dad0bd] + AliasTables v1.1.3
  [27a7e980] + Animations v0.4.1
  [67c07d97] + Automa v1.0.4
  [13072b0f] + AxisAlgorithms v1.1.0
  [39de3d68] + AxisArrays v0.4.7
  [fa961155] + CEnum v0.5.0
  [159f3aea] + Cairo v1.1.0
  [13f3f980] + CairoMakie v0.12.14
  [d360d2e6] + ChainRulesCore v1.25.0
  [a2cac450] + ColorBrewer v0.4.0
  [35d6a980] + ColorSchemes v3.26.0
  [3da002f7] + ColorTypes v0.11.5
  [c3611d14] + ColorVectorSpace v0.10.0
  [5ae59095] + Colors v0.12.11
  [34da2185] + Compat v4.16.0
  [187b0558] + ConstructionBase v1.5.8
  [d38c429a] + Contour v0.6.3
  [9a962f9c] + DataAPI v1.16.0
  [864edb3b] + DataStructures v0.18.20
  [e2d170a0] + DataValueInterfaces v1.0.0
  [927a84f5] + DelaunayTriangulation v1.6.0
  [31c24e10] + Distributions v0.25.112
  [ffbed154] + DocStringExtensions v0.9.3
  [4e289a0a] + EnumX v1.0.4
  [429591f6] + ExactPredicates v2.2.8
  [411431e0] + Extents v0.1.4
  [7a1cc6ca] + FFTW v1.8.0
  [5789e2e9] + FileIO v1.16.3
  [8fc22ac5] + FilePaths v0.8.3
  [48062228] + FilePathsBase v0.9.22
  [1a297f60] + FillArrays v1.13.0
  [53c48c17] + FixedPointNumbers v0.8.5
  [1fa38f19] + Format v1.3.7
  [b38be410] + FreeType v4.1.1
  [663a7486] + FreeTypeAbstraction v0.10.3
  [68eda718] + GeoFormatTypes v0.4.2
  [cf35fbd7] + GeoInterface v1.3.7
  [5c1252a2] + GeometryBasics v0.4.11
  [f526b714] + GraphViz v0.2.0
  [a2bd30eb] + Graphics v1.1.2
  [3955a311] + GridLayoutBase v0.11.0
  [42e2da0e] + Grisu v1.0.2
  [34004b35] + HypergeometricFunctions v0.3.24
  [2803e5a7] + ImageAxes v0.6.11
  [c817782e] + ImageBase v0.1.7
  [a09fc81d] + ImageCore v0.10.2
  [82e4d734] + ImageIO v0.6.8
  [bc367c6b] + ImageMetadata v0.9.9
  [9b13fd28] + IndirectArrays v1.0.0
  [d25df0c9] + Inflate v0.1.5
  [a98d9a8b] + Interpolations v0.15.1
  [d1acc4aa] + IntervalArithmetic v0.22.17
  [8197267c] + IntervalSets v0.7.10
  [92d709cd] + IrrationalConstants v0.2.2
  [f1662d9f] + Isoband v0.1.1
  [c8e1da08] + IterTools v1.10.0
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.6.1
  [682c06a0] + JSON v0.21.4
  [b835a17e] + JpegTurbo v0.1.5
  [5ab0869b] + KernelDensity v0.6.9
  [b964fa9f] + LaTeXStrings v1.3.1
  [8cdb02fc] + LazyModules v0.3.1
  [2ab3a3ac] + LogExpFunctions v0.3.28
  [1914dd2f] + MacroTools v0.5.13
  [ee78f7c6] + Makie v0.21.14
  [20f20a25] + MakieCore v0.8.9
  [dbb5928d] + MappedArrays v0.4.2
  [0a4f8689] + MathTeXEngine v0.6.1
  [e1d29d7a] + Missings v1.2.0
  [e94cdb99] + MosaicViews v0.3.4
  [77ba4419] + NaNMath v1.0.2
  [f09324ee] + Netpbm v1.1.1
  [510215fc] + Observables v0.5.5
  [6fe1bfb0] + OffsetArrays v1.14.1
  [52e1d378] + OpenEXR v0.3.2
  [bac558e1] + OrderedCollections v1.6.3
  [90014a1f] + PDMats v0.11.31
  [f57f5aa1] + PNGFiles v0.4.3
  [19eb6ba3] + Packing v0.5.0
  [5432bcbf] + PaddedViews v0.5.12
  [69de0a69] + Parsers v2.8.1
  [eebad327] + PkgVersion v0.3.3
  [995b91a9] + PlotUtils v1.4.1
  [647866c9] + PolygonOps v0.1.2
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [92933f4c] + ProgressMeter v1.10.2
  [43287f4e] + PtrArrays v1.2.1
  [4b34888f] + QOI v1.0.0
  [1fd47b50] + QuadGK v2.11.1
  [b3c3ace0] + RangeArrays v0.3.2
  [c84ed2f1] + Ratios v0.4.5
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.1
  [ae029012] + Requires v1.3.0
  [79098fc4] + Rmath v0.8.0
  [5eaf0fd0] + RoundingEmulator v0.2.1
  [fdea26ae] + SIMD v3.6.0
  [6c6a2e73] + Scratch v1.2.1
  [65257c39] + ShaderAbstractions v0.4.1
  [992d4aef] + Showoff v1.0.3
  [73760f76] + SignedDistanceFields v0.4.0
  [699a6c99] + SimpleTraits v0.9.4
  [45858cf5] + Sixel v0.1.3
  [a2af1166] + SortingAlgorithms v1.2.1
  [276daf66] + SpecialFunctions v2.4.0
  [cae243ae] + StackViews v0.1.1
  [90137ffa] + StaticArrays v1.9.7
  [1e83bf80] + StaticArraysCore v1.4.3
  [10745b16] + Statistics v1.11.1
  [82ae8749] + StatsAPI v1.7.0
  [2913bbd2] + StatsBase v0.34.3
  [4c63d2b9] + StatsFuns v1.3.2
  [09ab397b] + StructArrays v0.6.18
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.12.0
  [62fd8b95] + TensorCore v0.1.1
  [731e570b] + TiffImages v0.10.2
  [3bb67fe8] + TranscodingStreams v0.11.3
  [981d1d27] + TriplotBase v0.1.0
  [1cfade01] + UnicodeFun v0.4.1
  [1986cc42] + Unitful v1.21.0
  [efce3f68] + WoodburyMatrices v1.0.0
  [6e34b625] + Bzip2_jll v1.0.8+1
  [4e9b3aee] + CRlibm_jll v1.0.1+0
  [83423d85] + Cairo_jll v1.18.2+1
  [5ae413db] + EarCut_jll v2.2.4+0
  [2e619515] + Expat_jll v2.6.2+0
  [b22a6f82] + FFMPEG_jll v6.1.2+0
  [f5851436] + FFTW_jll v3.3.10+1
  [a3f928ae] + Fontconfig_jll v2.13.96+0
  [d7e528f0] + FreeType2_jll v2.13.2+0
  [559328eb] + FriBidi_jll v1.0.14+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.80.5+0
  [3b182d85] + Graphite2_jll v1.3.14+0
  [3c863552] + Graphviz_jll v2.50.0+1
  [2e76f6c2] + HarfBuzz_jll v8.3.1+0
  [905a6f67] + Imath_jll v3.1.11+0
  [1d5cc7b8] + IntelOpenMP_jll v2024.2.1+0
  [aacddb02] + JpegTurbo_jll v3.0.4+0
  [c1c5ebd0] + LAME_jll v3.100.2+0
  [1d63c593] + LLVMOpenMP_jll v18.1.7+0
  [dd4b983a] + LZO_jll v2.10.2+1
⌅ [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.11+0
  [7add5ba3] + Libgpg_error_jll v1.49.0+0
  [94ce4f54] + Libiconv_jll v1.17.0+0
  [4b2f31a3] + Libmount_jll v2.40.1+0
  [38a345b3] + Libuuid_jll v2.40.1+0
  [856f044c] + MKL_jll v2024.2.0+0
  [e7412a2a] + Ogg_jll v1.3.5+1
  [18a262bb] + OpenEXR_jll v3.2.4+0
  [458c3c95] + OpenSSL_jll v3.0.15+1
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [91d4177d] + Opus_jll v1.3.3+0
  [36c8627f] + Pango_jll v1.54.1+0
  [30392449] + Pixman_jll v0.43.4+0
  [f50d1b31] + Rmath_jll v0.5.1+0
  [02c8fc9c] + XML2_jll v2.13.3+0
  [aed1982a] + XSLT_jll v1.1.41+0
  [4f6342f7] + Xorg_libX11_jll v1.8.6+0
  [0c0b7dd1] + Xorg_libXau_jll v1.0.11+0
  [a3789734] + Xorg_libXdmcp_jll v1.1.4+0
  [1082639a] + Xorg_libXext_jll v1.3.6+0
  [ea2f1a96] + Xorg_libXrender_jll v0.9.11+0
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.1+0
  [c7cfdc94] + Xorg_libxcb_jll v1.17.0+0
  [c5fb5394] + Xorg_xtrans_jll v1.5.0+0
  [9a68df92] + isoband_jll v0.2.3+0
  [a4ae2306] + libaom_jll v3.9.0+0
  [0ac62f75] + libass_jll v0.15.2+0
  [f638f0a6] + libfdk_aac_jll v2.0.3+0
  [b53b4c65] + libpng_jll v1.6.44+0
  [075b6546] + libsixel_jll v1.10.3+1
  [f27f6e37] + libvorbis_jll v1.3.7+2
  [1317d2d5] + oneTBB_jll v2021.12.0+0
  [1270edf5] + x264_jll v10164.0.0+0
⌅ [dfaa095f] + x265_jll v3.6.0+0
  [0dad84c5] + ArgTools v1.1.2
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [8bf52ea8] + CRC32c v1.11.0
  [ade2ca70] + Dates v1.11.0
  [8ba89e20] + Distributed v1.11.0
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching v1.11.0
  [b77e0a4c] + InteractiveUtils v1.11.0
  [4af54fe1] + LazyArtifacts v1.11.0
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2 v1.11.0
  [8f399da3] + Libdl v1.11.0
  [37e2e46d] + LinearAlgebra v1.11.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [a63ad114] + Mmap v1.11.0
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.11.0
  [de0858da] + Printf v1.11.0
  [3fa0cd96] + REPL v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization v1.11.0
  [1a1011a3] + SharedArrays v1.11.0
  [6462fe0b] + Sockets v1.11.0
  [2f01184e] + SparseArrays v1.11.0
  [f489334b] + StyledStrings v1.11.0
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test v1.11.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [e66e0078] + CompilerSupportLibraries_jll v1.1.1+0
  [deac9b47] + LibCURL_jll v8.6.0+0
  [e37daf67] + LibGit2_jll v1.7.2+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.6+0
  [14a3606d] + MozillaCACerts_jll v2023.12.12
  [4536629a] + OpenBLAS_jll v0.3.27+1
  [05823500] + OpenLibm_jll v0.8.1+2
  [efcefdf7] + PCRE2_jll v10.42.0+1
  [bea87d4a] + SuiteSparse_jll v7.7.0+0
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.11.0+0
  [8e850ede] + nghttp2_jll v1.59.0+0
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  207 dependencies successfully precompiled in 186 seconds. 50 already precompiled.

julia> using GraphViz

julia> using FileIO

julia> using CairoMakie  # CairoMakie loaded before Cairo

julia> using Cairo

julia> FileIO.save("tmp.png", dot"""
           digraph graphname {
               a -> b -> c;
               b -> d;
           }
       """)
0

(@121233) pkg> st
Status `~/.julia/environments/121233/Project.toml`
  [159f3aea] Cairo v1.1.0
  [13f3f980] CairoMakie v0.12.14
  [5789e2e9] FileIO v1.16.3
  [f526b714] GraphViz v0.2.0

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager
2 Likes

Thanks! I looked into it but I somehow doubt this is a world age issue related to delayed loading. For one, calling the same function a second time after hitting top level does not change anything. Also in this instance eagerly loading more packages is what leads to the error, which is kind of the opposite to what I would expect with lazy loading.

Thanks a lot! Is that reproducible on your system? I mean, if you try the whole process several times does it always work?

On my system I tried a few dozen times, and it looks like the error almost always happens, but it does work every once in a while. Stranger and stranger…

Summary
shell$ cat reproducer.jl 
Pkg.activate(; temp=true)
Pkg.add(["GraphViz", "FileIO", "CairoMakie", "Cairo"])

using GraphViz
using FileIO
using CairoMakie
using Cairo

FileIO.save("tmp.png", dot"""
    digraph graphname {
        a -> b -> c;
        b -> d;
    }
""")

shell$ for i in $(seq 20); do
         julia reproducer.jl >/dev/null 2>&1;
         echo $?;
       done
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1

3 Likes

Ah, maybe I just got lucky. I tried again and got:

❯ julia --project=@121233
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.0 (2024-10-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GraphViz

julia> using FileIO

julia> using CairoMakie  # CairoMakie loaded before Cairo

julia> using Cairo

julia> FileIO.save("tmp.png", dot"""
           digraph graphname {
               a -> b -> c;
               b -> d;
           }
       """)
Error: renderer for julia:cairo is unavailable
Errors encountered while save File{DataFormat{:PNG}, String}("tmp.png").
All errors:
===========================================
MethodError: no method matching save(::File{DataFormat{:PNG}, String}, ::GraphViz.Graph)
The function `save` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  save(::File{DataFormat{:PNG}}, ::S; kwargs...) where {T, S<:Union{AbstractArray{T, 3}, AbstractMatrix}}
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:69
  save(::File{DataFormat{:QOI}}, ::Any...; kwargs...)
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:152
  save(::File{DataFormat{:EXR}}, ::Any...; kwargs...)
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:141
  ...

===========================================
ArgumentError: Package ImageMagick [6218d12a-5da1-5696-b52f-db25d2ecc6d1] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

===========================================
ArgumentError: Package OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

===========================================
MethodError: no method matching show(::IOContext{IOStream}, ::MIME{Symbol("image/png")}, ::Nothing)
The function `show` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  show(::IO, ::MIME{Symbol("image/png")}, ::GraphViz.Graph)
   @ GraphViz ~/.julia/packages/GraphViz/IsUMl/src/cairo.jl:94
  show(::IO, ::MIME{Symbol("image/png")}, ::CairoSurface)
   @ Cairo ~/.julia/packages/Cairo/Sq97f/src/Cairo.jl:459
  show(::IO, ::MIME{Symbol("text/plain")}, ::Any)
   @ Base multimedia.jl:47
  ...

===========================================

Fatal error:
ERROR: MethodError: no method matching save(::File{DataFormat{:PNG}, String}, ::GraphViz.Graph)
The function `save` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  save(::File{DataFormat{:PNG}}, ::S; kwargs...) where {T, S<:Union{AbstractArray{T, 3}, AbstractMatrix}}
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:69
  save(::File{DataFormat{:QOI}}, ::Any...; kwargs...)
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:152
  save(::File{DataFormat{:EXR}}, ::Any...; kwargs...)
   @ ImageIO ~/.julia/packages/ImageIO/eR22t/src/ImageIO.jl:141
  ...

Stacktrace:
 [1] #invokelatest#2
   @ ./essentials.jl:1054 [inlined]
 [2] invokelatest
   @ ./essentials.jl:1051 [inlined]
 [3] action(call::Symbol, libraries::Vector{Union{…}}, file::Formatted, args::GraphViz.Graph; options::@Kwargs{})
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:219
 [4] action
   @ ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:196 [inlined]
 [5] action
   @ ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:185 [inlined]
 [6] save(file::String, args::GraphViz.Graph; options::@Kwargs{})
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:129
 [7] save(file::String, args::GraphViz.Graph)
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:125
 [8] top-level scope
   @ REPL[5]:1
Stacktrace:
 [1] handle_error(e::MethodError, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/error_handling.jl:61
 [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/error_handling.jl:56
 [3] action(call::Symbol, libraries::Vector{Union{…}}, file::Formatted, args::GraphViz.Graph; options::@Kwargs{})
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:228
 [4] action
   @ ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:196 [inlined]
 [5] action
   @ ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:185 [inlined]
 [6] save(file::String, args::GraphViz.Graph; options::@Kwargs{})
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:129
 [7] save(file::String, args::GraphViz.Graph)
   @ FileIO ~/.julia/packages/FileIO/xOKyx/src/loadsave.jl:125
 [8] top-level scope
   @ REPL[5]:1
Some type information was truncated. Use `show(err)` to see complete types.
3 Likes

Thanks for reproducing this. There is something very weird going on indeed. Now that I’ve realized the issue doesn’t always manifest itself, I think my initial observations were also biased by “lucky” trials.

It now looks to me like most variants of the initial reproducer sometimes fail (but with varying frequencies). For example:

shell$ cat reproducer.jl 
import Pkg
Pkg.activate(; temp=true)
Pkg.add(["GraphViz", "FileIO", "Cairo"])

using GraphViz
using FileIO
using Cairo

FileIO.save("tmp.png", dot"""
    digraph graphname {
        a -> b -> c;
        b -> d;
    }
""")
shell$ for i in $(seq 20); do
         julia --startup-file=no reproducer.jl >/dev/null 2>&1;
         echo $?;
       done
0
1
0
0
1
1
1
0
1
0
1
0
0
0
0
1
1
0
0
0

X-ref

@palli I might not have been clear enough: this most certainly has something (if not everything) to do with 1.11. Running the same example with Julia 1.10 (all involved packages having the same version) consistently and reliably produces the expected behavior.

I reset the topic title accordingly.

2 Likes