Skip to content

Corrupted strings in tests on 1.12 #84

Closed

Description

@KristofferC

https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/cdf2f46_vs_d63aded/InlineStrings.primary.log

InlineString operations: Test Failed at /home/pkgeval/.julia/packages/InlineStrings/79NvI/test/runtests.jl:350
  Expression: unsafe_string(Base.unsafe_convert(Ptr{UInt8}, Base.cconvert(Ptr{UInt8}, x))) == y
   Evaluated: "@\xb5\xdf\x02" == ""

Stacktrace:
 [1] macro expansion
   @ /opt/julia/share/julia/stdlib/v1.12/Test/src/Test.jl:679 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/InlineStrings/79NvI/test/runtests.jl:350 [inlined]
 [3] macro expansion
   @ /opt/julia/share/julia/stdlib/v1.12/Test/src/Test.jl:1771 [inlined]
 [4] top-level scope
   @ ~/.julia/packages/InlineStrings/79NvI/test/runtests.jl:269
InlineString operations: Test Failed at /home/pkgeval/.julia/packages/InlineStrings/79NvI/test/runtests.jl:351
  Expression: unsafe_string(Base.unsafe_convert(Ptr{Int8}, Base.cconvert(Ptr{Int8}, x))) == y
   Evaluated: "\x7f" == ""

Stacktrace:
 [1] macro expansion
   @ /opt/julia/share/julia/stdlib/v1.12/Test/src/Test.jl:679 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/InlineStrings/79NvI/test/runtests.jl:351 [inlined]
 [3] macro expansion
   @ /opt/julia/share/julia/stdlib/v1.12/Test/src/Test.jl:1771 [inlined]
 [4] top-level scope
   @ ~/.julia/packages/InlineStrings/79NvI/test/runtests.jl:269
InlineString operations: Test Failed at /home/pkgeval/.julia/packages/InlineStrings/79NvI/test/runtests.jl:350
  Expression: unsafe_string(Base.unsafe_convert(Ptr{UInt8}, Base.cconvert(Ptr{UInt8}, x))) == y
   Evaluated: "@\xb5\xdf\x02" == "🍕"

Might need the same treatment as JuliaDatabases/SQLite.jl#308?

Activity

  1. quinnj commented on Oct 4, 2026

    @quinnj
    Member

    The unrooted pointer conversions in the reported tests were fixed by #91. Current main keeps the converted reference alive through the pointer read (test source), matching Julia's documented unsafe_convert lifetime requirement. The later embedded-NUL test uses the same preservation rule.

    I checked current main 1bbaafebcf849416ab147df4647838ccd4efce29 with 279 forced-GC pointer checks on each of Julia 1.10.11 and 1.13.1. Both full suites pass too: 246,327 checks on 1.10.11 and 246,365 on 1.13.1, including 3,576 C-compatibility checks on each version. These tests keep the conversion owner alive; I did not attempt to dereference an unrooted pointer. Closing this report as resolved by the existing test fixes. No package runtime change was needed.

    AI disclosure: This work was prepared with assistance from OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions