Skip to content

Polyglot unable to evaluate python dictionary objects #3630

@AigarsS

Description

@AigarsS

I tried using truffleruby 24.0.1 with python, but it fails evaluating python's dictionary, it works fine for arrays.

:~$ ruby -v
truffleruby 24.0.1, like ruby 3.2.2, GraalVM CE JVM [x86_64-linux]
:~$ ruby --polyglot
[ruby] WARNING: truffleruby starts IRB when stdin is a TTY instead of reading from stdin, use '-' to read from stdin
irb(main):001:0> Polyglot.eval('python', '{"key1": "value1"}')
[ruby] WARNING StackOverflowError
[ruby] WARNING StackOverflowError                         
<internal:core> core/truffle/polyglot.rb:351:in `each': stack level too deep (SystemStackError)
        from com.oracle.truffle.api.strings.TStringOps.runCalcStringAttributesLatin1(TStringOps.java:1295)
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
        from <internal:core> core/truffle/polyglot.rb:355:in `each'
	from <internal:core> core/truffle/polyglot.rb:355:in `each'
	from <internal:core> core/truffle/polyglot.rb:355:in `each'
	from <internal:core> core/truffle/polyglot.rb:355:in `each'
	from <internal:core> core/truffle/polyglot.rb:355:in `each'
	from <internal:core> core/truffle/polyglot.rb:355:in `each'
	... 885 levels...
irb(main):002:0> Polyglot.eval('python', '["key1", "value1"]')
=> #<Polyglot::ForeignArray[Python] list:0x4ff ["key1", "value1"]>

Metadata

Metadata

Assignees

Labels

polyglotUses multiple Truffle languages or host interop

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions