Skip to content

Conversation

@straight-shoota
Copy link
Member

No description provided.

@ysbaddaden
Copy link
Contributor

ysbaddaden commented Nov 21, 2025

Still the same issue as in #14651 and #16023: something's broken between LLVM 18+ and iconv on macOS. It's not related to nixpkgs since it reproduces with homebrew and LLVM 20.

We shall try to understand why macOS is hanging with libiconv, and should configure a timeout on the CI jobs (no need to hang for 6h).

@straight-shoota straight-shoota marked this pull request as draft November 21, 2025 14:56
@straight-shoota
Copy link
Member Author

I tested the nixpkg version in between and figured out the breakage is at 24.05. It's not the exact same failures as in later versions: Three specs are still passing with 24.05 and only break later. No idea what's happening here.

Full spec output
$ # nixpgs 24.05 llvm 16
$ bin/crystal spec spec/std/io/io_spec.cr:593 spec/std/string_spec.cr:2903 spec/std/io/io_spec.cr:593
....F...........F..........................E.......F.

Failures:

  1) IO encoding decode gets big EUC-JP string
     Failure/Error: {% unless flag?(:without_iconv) %}

       Expected: "好我是人"
            got: "好我是人人"

     # spec/std/io/io_spec.cr:593

  2) IO encoding decode says invalid byte sequence
     Failure/Error: {% unless flag?(:without_iconv) %}

       Expected ArgumentError with message containing: "Invalid multibyte sequence"
            got ArgumentError with message: "Incomplete multibyte sequence"
       Backtrace:
         # src/crystal/iconv.cr:78:9 in 'handle_invalid'
         # src/io/encoding.cr:114:15 in 'read'
         # src/io/encoding.cr:139:7 in 'read_byte'
         # src/io.cr:396:7 in 'read_utf8_byte'
         # src/io.cr:365:7 in 'peek_or_read_utf8'
         # src/io.cr:312:13 in 'read_char_with_bytesize'
         # src/io.cr:305:12 in 'read_char'
         # spec/std/io/io_spec.cr:593:3 in '->'
         # src/spec/example.cr:50:13 in 'internal_run'
         # src/spec/example.cr:38:16 in 'run'
         # src/spec/context.cr:20:23 in 'internal_run'
         # src/spec/context.cr:364:14 in 'run'
         # src/spec/context.cr:20:23 in 'internal_run'
         # src/spec/context.cr:364:14 in 'run'
         # src/spec/context.cr:20:23 in 'internal_run'
         # src/spec/context.cr:364:14 in 'run'
         # src/spec/context.cr:20:23 in 'internal_run'
         # src/spec/context.cr:173:7 in 'run'
         # src/spec/dsl.cr:219:7 in 'execute_examples'
         # src/spec/dsl.cr:194:13 in '->'
         # src/crystal/at_exit_handlers.cr:18:17 in 'run'
         # src/crystal/main.cr:64:14 in 'exit'
         # src/crystal/main.cr:50:5 in 'main'
         # src/crystal/system/unix/main.cr:9:3 in 'main'

     # spec/std/io/io_spec.cr:593

  3) String encode decodes with shift state
     Failure/Error: {% unless flag?(:without_iconv) %}

       Expected: "Ê̄"
            got: "Ê"

     # spec/std/string_spec.cr:2903

  4) String encode flushes the shift state (#11992)

       Invalid multibyte sequence (ArgumentError)
         from src/crystal/iconv.cr:80:9 in 'handle_invalid'
         from src/string.cr:1827:11 in 'encode'
         from src/string.cr:1809:5 in 'encode'
         from spec/std/string_spec.cr:2903:3 in '->'
         from src/spec/example.cr:50:13 in 'internal_run'
         from src/spec/example.cr:38:16 in 'run'
         from src/spec/context.cr:20:23 in 'internal_run'
         from src/spec/context.cr:364:14 in 'run'
         from src/spec/context.cr:20:23 in 'internal_run'
         from src/spec/context.cr:364:14 in 'run'
         from src/spec/context.cr:20:23 in 'internal_run'
         from src/spec/context.cr:173:7 in 'run'
         from src/spec/dsl.cr:219:7 in 'execute_examples'
         from src/spec/dsl.cr:194:13 in '->'
         from src/crystal/at_exit_handlers.cr:18:17 in 'run'
         from src/crystal/main.cr:64:14 in 'exit'
         from src/crystal/main.cr:50:5 in 'main'
         from src/crystal/system/unix/main.cr:9:3 in 'main'


Finished in 62.31 milliseconds
53 examples, 3 failures, 1 errors, 0 pending

Failed examples:

crystal spec spec/std/io/io_spec.cr:593 # IO encoding decode gets big EUC-JP string
crystal spec spec/std/io/io_spec.cr:593 # IO encoding decode says invalid byte sequence
crystal spec spec/std/string_spec.cr:2903 # String encode decodes with shift state
crystal spec spec/std/string_spec.cr:2903 # String encode flushes the shift state (#11992)

As a workaround, we could use the package libiconvReal, but that requires the flag -Duse_libiconv or an additional detection mechanism.

@straight-shoota
Copy link
Member Author

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants