Comments (8)
I completely overlooked that Mongoid is only officially compatible with ruby 3.2
from version 8.1
.
I'll give that a try
https://www.mongodb.com/docs/mongoid/current/reference/compatibility/#ruby-compatibility
from truffleruby.
mongoid-8.1
with truffleruby-jvm-24.0.1
results in the same behavior
from truffleruby.
I was able to produce an example of a (maybe?) related issue:
class Foo
include(Mongoid::Document)
field(:bar, type: Array)
end
foo = Foo.create!
foo.set(bar: [DateTime.now]) # works
foo.set(bar: foo.bar + [DateTime.now]) # works
foo.set(bar: (foo.bar << DateTime.now)) # throws
The last line results in
Cannot invoke "org.truffleruby.cext.ValueWrapperManager$ValueWrapperWeakReferenc
e.get()" because "this.wrappers[offset]" is null (java.lang.NullPointerException
)
from org.truffleruby.cext.ValueWrapperManager$HandleBlock.getWrapper(Val
ueWrapperManager.java:234)
from org.truffleruby.cext.ValueWrapperManager.getWrapperFromHandleMap(Va
lueWrapperManager.java:109)
from org.truffleruby.cext.UnwrapNode$UnwrapNativeNode.unwrapTaggedObject
(UnwrapNode.java:89)
from org.truffleruby.cext.UnwrapNodeGen$UnwrapNativeNodeGen$Inlined.exec
uteAndSpecialize(UnwrapNodeGen.java:421)
from org.truffleruby.cext.UnwrapNodeGen$UnwrapNativeNodeGen$Inlined.exec
ute(UnwrapNodeGen.java:387)
from org.truffleruby.cext.UnwrapNode.longToWrapper(UnwrapNode.java:270)
from org.truffleruby.cext.UnwrapNodeGen$Inlined.executeAndSpecialize(Unw
rapNodeGen.java:183)
from org.truffleruby.cext.UnwrapNodeGen$Inlined.execute(UnwrapNodeGen.ja
va:158)
from org.truffleruby.core.array.library.NativeArrayStorage.read(NativeAr
rayStorage.java:98)
from org.truffleruby.core.array.library.NativeArrayStorageGen$ArrayStore
LibraryExports$Cached.read(NativeArrayStorageGen.java:249)
from org.truffleruby.core.array.ArrayEachIteratorNode.iterateMany(ArrayE
achIteratorNode.java:66)
from org.truffleruby.core.array.ArrayEachIteratorNodeGen$Inlined.execute
AndSpecialize(ArrayEachIteratorNodeGen.java:497)
from org.truffleruby.core.array.ArrayEachIteratorNodeGen$Inlined.execute
(ArrayEachIteratorNodeGen.java:447)
from org.truffleruby.core.array.ArrayNodes$MapNode.map(ArrayNodes.java:1
455)
from org.truffleruby.core.array.ArrayNodesFactory$MapNodeFactory$MapNode
Gen.executeAndSpecialize(ArrayNodesFactory.java:10161)
from org.truffleruby.core.array.ArrayNodesFactory$MapNodeFactory$MapNode
Gen.execute(ArrayNodesFactory.java:10150)
from org.truffleruby.builtins.EnumeratorSizeNode.execute(EnumeratorSizeN
ode.java:56)
from org.truffleruby.language.RubyCoreMethodRootNode.execute(RubyCoreMet
hodRootNode.java:58)
/usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/extensions/array.rb:152:in `map
'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/extensions/array.r
b:152:in `mongoize'
from /usr/local/lib/mri/forwardable.rb:240:in `mongoize'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/attributes.rb:285:
in `typed_value_for'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/attributes.rb:175:
in `block in write_attribute'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/threaded/lifecycle
.rb:30:in `_assigning'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/attributes.rb:172:
in `write_attribute'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/fields.rb:691:in `
bar='
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/attributes/process
ing.rb:122:in `process_attribute'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable/settab
le.rb:82:in `block (2 levels) in set'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable.rb:208
:in `block in process_atomic_operations'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable.rb:206
:in `each'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable.rb:206
:in `process_atomic_operations'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable/settab
le.rb:49:in `block in set'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable.rb:186
:in `prepare_atomic_operation'
from /usr/local/bundle/gems/mongoid-8.1.5/lib/mongoid/persistable/settab
le.rb:48:in `set'
from (irb):10:in `<top (required)>'
from /usr/local/lib/mri/irb/workspace.rb:119:in `evaluate'
from /usr/local/lib/mri/irb/context.rb:502:in `evaluate'
from /usr/local/lib/mri/irb.rb:588:in `block (2 levels) in eval_input'
from /usr/local/lib/mri/irb.rb:777:in `signal_status'
from /usr/local/lib/mri/irb.rb:567:in `block in eval_input'
from /usr/local/lib/mri/irb/ruby-lex.rb:267:in `block (2 levels) in each
_top_level_statement'
from <internal:core> core/kernel.rb:409:in `loop'
from /usr/local/lib/mri/irb/ruby-lex.rb:249:in `block in each_top_level_
statement'
from <internal:core> core/throw_catch.rb:36:in `catch'
from /usr/local/lib/mri/irb/ruby-lex.rb:248:in `each_top_level_statement
'
from /usr/local/lib/mri/irb.rb:566:in `eval_input'
from /usr/local/lib/mri/irb.rb:500:in `block in run'
from <internal:core> core/throw_catch.rb:36:in `catch'
from /usr/local/lib/mri/irb.rb:499:in `run'
from /usr/local/lib/mri/irb.rb:421:in `start'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/commands/console/
console_command.rb:70:in `start'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/commands/console/
console_command.rb:19:in `start'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/commands/console/
console_command.rb:102:in `perform'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `in
voke_command'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/command/base.rb:6
9:in `perform'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/command.rb:48:in
`invoke'
from /usr/local/bundle/gems/railties-6.1.7.7/lib/rails/commands.rb:18:in
`<top (required)>'
from <internal:core> core/kernel.rb:229:in `gem_original_require'
from <internal:/usr/local/lib/mri/rubygems/core_ext/kernel_require.rb>:3
7:in `require'
from /workspace/bin/rails:4:in `<main>'
from truffleruby.
Thank you for the report, could you try with truffleruby+graalvm-dev
(e.g. available in ruby-build or here)?
There have been some C extension fixes on master but not yet in a release related to dead handles errors like the ones above.
from truffleruby.
Using the latest dev version yields the same result
from truffleruby.
Related Issues (20)
- `jt test fast` fails with JVM CE environment HOT 4
- Excessive splitting with `Method#to_proc` HOT 4
- Failure in SimpleCov test suite HOT 8
- Emit a performance warning when redefining methods in CoreMethodAssumptions HOT 1
- Serious performance regression for method pow(a, m) HOT 7
- Prepending a module to Integer disables many Inlined*Node
- method_source compatibility problems introduced with TruffleRuby 24.0.0 HOT 3
- Error installing pg 1.1.4 HOT 1
- concurrent-ruby Fixed Thread Pool memory leak HOT 2
- Array#pack does not support :buffer kwarg HOT 1
- Monkey patching not working HOT 2
- TruffleRuby set `host_cpu` to `aarch64` on `arm64-darwin` causing `REUSE_AS_BINARY_ON_TRUFFLERUBY` to not work as expected HOT 3
- rails 7, rails new - no such filre or directory HOT 1
- gem error: OpenSSL is not available in Oracle Linux 9 HOT 4
- How to call a method from java whose name is send? HOT 2
- Benchmark ORM on Truffleruby vs CRuby HOT 1
- using "find pattern" matching in a dynamically-defined method results in NPE HOT 3
- Segfault in 24.1.0-dev GFTC builds with pg driver HOT 6
- `StringIO` does not set the ASCII-8BIT encoding in `wb` mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truffleruby.