Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require 'grpc' doesn't work on latest dev version on macOS #2718

Closed
frvade opened this issue Sep 2, 2022 · 2 comments
Closed

require 'grpc' doesn't work on latest dev version on macOS #2718

frvade opened this issue Sep 2, 2022 · 2 comments

Comments

@frvade
Copy link

frvade commented Sep 2, 2022

Hi all, thanks for your great efforts on speeding up ruby!

We're trying to switch to truffleruby on our project with GRPC and now expecting problems installing it on macos

First, it seems that this issue affects all macs, not only M1. But the latest dev version actually let the grpc gem be installed.

Second, after installation requiring the grpc gem on mac OS causes an (java.lang.NullPointerException).

How to reproduce

irb(main):001:0> require 'grpc'

Stacktrace

<no message> (java.lang.NullPointerException)
	from com.oracle.truffle.llvm.runtime.LLVMLanguage$LLVMThreadLocalValue.getGlobalContainer(LLVMLanguage.java:321)
	from com.oracle.truffle.llvm.runtime.LLVMThreadLocalPointer.resolveWithThreadContext(LLVMThreadLocalPointer.java:76)
	from com.oracle.truffle.llvm.runtime.LLVMThreadLocalPointer.resolve(LLVMThreadLocalPointer.java:70)
	from com.oracle.truffle.llvm.runtime.nodes.others.LLVMAccessThreadLocalSymbolNode.accessSingleContext(LLVMAccessThreadLocalSymbolNode.java:61)
	from com.oracle.truffle.llvm.runtime.nodes.others.LLVMAccessThreadLocalSymbolNodeGen.executeAndSpecialize(LLVMAccessThreadLocalSymbolNodeGen.java:72)
	from com.oracle.truffle.llvm.runtime.nodes.others.LLVMAccessThreadLocalSymbolNodeGen.executeGeneric(LLVMAccessThreadLocalSymbolNodeGen.java:52)
	from com.oracle.truffle.llvm.runtime.nodes.others.LLVMAccessThreadLocalSymbolNodeGen.executeGeneric(LLVMAccessThreadLocalSymbolNodeGen.java:21)
	from com.oracle.truffle.llvm.runtime.nodes.cast.LLVMToAddressNodeGen.executeGeneric_generic5(LLVMToAddressNodeGen.java:167)
	from com.oracle.truffle.llvm.runtime.nodes.cast.LLVMToAddressNodeGen.executeGeneric(LLVMToAddressNodeGen.java:87)
	from com.oracle.truffle.llvm.runtime.nodes.memory.store.LLVMPointerStoreNodeGen$LLVMPointerOffsetStoreNodeGen.executeWithTarget(LLVMPointerStoreNodeGen.java:679)
	from com.oracle.truffle.llvm.runtime.nodes.vars.AggregateLiteralInPlaceNode.writeObjects(AggregateLiteralInPlaceNode.java:144)
	from com.oracle.truffle.llvm.runtime.nodes.vars.AggregateLiteralInPlaceNode.initialize(AggregateLiteralInPlaceNode.java:99)
	from com.oracle.truffle.llvm.runtime.nodes.vars.AggregateLiteralInPlaceNodeGen.executeAndSpecialize(AggregateLiteralInPlaceNodeGen.java:70)
	from com.oracle.truffle.llvm.runtime.nodes.vars.AggregateLiteralInPlaceNodeGen.execute(AggregateLiteralInPlaceNodeGen.java:48)
	from com.oracle.truffle.llvm.runtime.nodes.vars.AggregateLiteralInPlaceNode.execute(AggregateLiteralInPlaceNode.java:87)
	from com.oracle.truffle.llvm.initialization.StaticInitsNode.doInit(StaticInitsNode.java:61)
	from com.oracle.truffle.llvm.initialization.StaticInitsNodeGen.execute(StaticInitsNodeGen.java:22)
	from com.oracle.truffle.llvm.initialization.InitializeGlobalNode.execute(InitializeGlobalNode.java:95)
	from com.oracle.truffle.llvm.initialization.LoadModulesNode.loadModule(LoadModulesNode.java:375)
	from com.oracle.truffle.llvm.initialization.LoadModulesNode.execute(LoadModulesNode.java:195)
/Users/user/.rbenv/versions/truffleruby-dev/lib/gems/gems/grpc-1.48.0/src/ruby/lib/grpc/grpc_c.bundle:in `<LoadModulesNode/grpc_c.bundle/6>'
	from <internal:core> core/kernel.rb:226:in `gem_original_require'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/gems/gems/grpc-1.48.0/src/ruby/lib/grpc/grpc.rb:22:in `<top (required)>'
	from <internal:core> core/kernel.rb:293:in `require_relative'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/gems/gems/grpc-1.48.0/src/ruby/lib/grpc.rb:19:in `<top (required)>'
	from <internal:core> core/kernel.rb:234:in `gem_original_require'
	from (irb):1:in `<top (required)>'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb/workspace.rb:116:in `evaluate'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb/context.rb:450:in `evaluate'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:567:in `block (2 levels) in eval_input'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:751:in `signal_status'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:548:in `block in eval_input'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb/ruby-lex.rb:251:in `block (2 levels) in each_top_level_statement'
	from <internal:core> core/kernel.rb:407:in `loop'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
	from <internal:core> core/throw_catch.rb:36:in `catch'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb/ruby-lex.rb:232:in `each_top_level_statement'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:547:in `eval_input'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:481:in `block in run'
	from <internal:core> core/throw_catch.rb:36:in `catch'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:480:in `run'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/mri/irb.rb:409:in `start'
	from /Users/user/.rbenv/versions/truffleruby-dev/lib/gems/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
	from <internal:core> core/kernel.rb:376:in `load'
	from <internal:core> core/kernel.rb:376:in `load'
	from /Users/user/.rbenv/versions/truffleruby-dev/bin/irb:42:in `<main>'

@eregon mentioned that there is an internal issue for this (GR-40811).

@frvade frvade changed the title GRPC gem doesn't work on latest dev version GRPC gem doesn't work on latest dev version on mac os Sep 2, 2022
@eregon eregon added the cexts label Sep 2, 2022
@eregon eregon changed the title GRPC gem doesn't work on latest dev version on mac os require 'grpc' doesn't work on latest dev version on macOS Sep 2, 2022
@eregon
Copy link
Member

eregon commented Sep 2, 2022

Thank you for the report, we'll look into it.

FWIW here is the error on JDK19 with more details:

Cannot load from object array because "this.globalContainers[id]" is null (java.lang.NullPointerException)
        from com.oracle.truffle.llvm.runtime.LLVMLanguage$LLVMThreadLocalValue.getGlobalContainer(LLVMLanguage.java:321)
...

@eregon
Copy link
Member

eregon commented Oct 13, 2022

This is fixed now.

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

No branches or pull requests

4 participants