oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.03k stars 185 forks source link

Symbol lookup error: rb_str_strlen #3697

Closed Th3-M4jor closed 3 weeks ago

Th3-M4jor commented 3 weeks ago

Had this error come up in CI while was writing my own Erlang ETF parser for Ruby.

I tested locally against truffleruby 24.2.0-dev-0e05bfe4, like ruby 3.2.4, Oracle GraalVM JVM [x86_64-linux] and had the same error.

It appears to be defined here https://github.com/oracle/truffleruby/blob/b359f4c54c4085ea13390443b62da36d387fba13/lib/cext/include/ruby/internal/intern/string.h#L1189

but does not have a matching implementation in TruffleRuby's string.c

eregon commented 3 weeks ago

Thank you for the report.

A workaround is to use NUM2LONG(rb_funcall(str, rb_intern("size"), 0)).

This should be an easy fix if anyone wants to contribute it.