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

numo-narray: `rb_exc_raise': wrong argument type (TypeError) #2001

Closed
deepj opened this issue May 7, 2020 · 7 comments
Closed

numo-narray: `rb_exc_raise': wrong argument type (TypeError) #2001

deepj opened this issue May 7, 2020 · 7 comments
Assignees
Labels
Milestone

Comments

@deepj
Copy link

deepj commented May 7, 2020

truffleruby 20.2.0-dev-b9669c4c, like ruby 2.6.5, GraalVM CE Native [x86_64-darwin]

To reproduce:

gem install numo-narray
ruby -rnumo/narray -e 'Numo::DFloat.new(3,5).seq'

Error:

~/.rubies/truffleruby-dev/lib/truffle/truffle/cext.rb:1023:in `rb_exc_raise': wrong argument type (TypeError)
	from ruby.c:2008:in `rb_exc_raise'
	from ruby.c:2827:in `rb_check_typeddata'
	from ~/.gem/truffleruby/2.6.5/gems/numo-narray-0.9.1.8/ext/numo/narray/numo/narray.h:265:in `na_get_narray_t'
	from ~/.gem/truffleruby/2.6.5/gems/numo-narray-0.9.1.8/ext/numo/narray/narray.c:264:in `na_array_to_internal_shape'
	from ~/.gem/truffleruby/2.6.5/gems/numo-narray-0.9.1.8/ext/numo/narray/narray.c:393:in `na_initialize'
	from ~/.rubies/truffleruby-dev/lib/truffle/truffle/cext_ruby.rb:39:in `initialize'
	from -e:1:in `new'
	from -e:1:in `<main>'
@eregon eregon added the cexts label May 7, 2020
@deepj deepj closed this as completed Jun 8, 2020
@eregon eregon reopened this Jun 19, 2020
@larskanis
Copy link
Contributor

Narray makes use of inheritance of T_DATA objects. This didn't work but seems to be fixed in f460ce7 .

I noticed the same issue in ruby-pg. So far I didn't try narray.gem or ruby-pg on Truffleruby master, but the change looks good. Will the commit in question go into a Truffleruby release soon?

@eregon
Copy link
Member

eregon commented Aug 7, 2020

@larskanis That commit will be part of 20.2.

The release schedule is on https://www.graalvm.org/docs/release-notes/version-roadmap/

Aug 18, 2020: 20.2

@eregon eregon added this to the 20.2.0 milestone Aug 7, 2020
@eregon
Copy link
Member

eregon commented Aug 7, 2020

The numo-narray examples works now:

$ truffleruby -rnumo/narray -e 'p Numo::DFloat.new(3,5).seq'
Numo::DFloat#shape=[3,5]
[[0, 1, 2, 3, 4], 
 [5, 6, 7, 8, 9], 
 [10, 11, 12, 13, 14]]

@eregon eregon closed this as completed Aug 7, 2020
@larskanis
Copy link
Contributor

@eregon Thank you for the link to the release schedule! And good to know that it will be no blocker for ged/ruby-pg#349

@eregon
Copy link
Member

eregon commented Aug 10, 2020

@larskanis It would be useful if you can test (temporarily, or could be added as allowed failure) on that PR if truffleruby-head works, to make sure there is no other issue.

Adding as an allowed failure would also allow me to track there is no regression with truffleruby-head + latest pg conveniently.

@larskanis
Copy link
Contributor

@eregon TruffleRuby-head looks good: https://travis-ci.org/github/ged/ruby-pg/builds/716604081
Thank you for the hint!

@larskanis
Copy link
Contributor

@eregon Ruby-pg now has tests on truffleruby and truffleruby-head: https://travis-ci.org/github/ged/ruby-pg/builds/722468366. Just in case you want to add something to
https://github.com/eregon/truffleruby-gem-tracker

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

No branches or pull requests

4 participants