Closed NRBPerdijk closed 5 years ago
Hello Nathan,
thank you for the report. I could reproduce ClassCastException
involving double vector to int vector conversion using this snippet:
pdf_render_page("doc/NEWS.pdf")
the stack trace is
Caused by: java.lang.ClassCastException: com.oracle.truffle.r.runtime.data.RDoubleVector cannot be cast to com.oracle.truffle.r.runtime.data.model.RAbstractIntVector
at com.oracle.truffle.r.runtime.data.RVector.setAttr(RVector.java:209)
at com.oracle.truffle.r.ffi.impl.common.JavaUpCallsRFFIImpl.Rf_setAttrib(JavaUpCallsRFFIImpl.java:347)
at com.oracle.truffle.r.ffi.impl.upcalls.Rf_setAttribCall$Rf_setAttribCallFactory$1.execute(Rf_setAttribCall.java:61)
at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:81)
at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:59)
...
We're working on a fix.
Should be fixed now. The fixes will probably make it to the next RC, or you can compile GraalVM from the sources to have them right now.
Hello!
I am using GraalVM rc10 with fastR to make our R-functions executable from our Scala codebase. I have made some nice progress, but I’m now stuck on what appears to be an internal issue with how graal/fastr handles R vectors. I am trying to render a pdf using the R package
pdftools
, but when passing the functionpdf_render_page
a raw vector (as it demands) I get the stack trace printed below, saying it dies in the underlyingpoppler_render_page
call. Apparently, somewhere internally, the raw vector gets converted to anRDoubleVector
, which cannot be cast to anRAbstractIntVector
(makes sense). The same raw vector works fine when passed topdf_info
(which is from the samepdftools
package).The original data is an Array of Integers handed over from Scala code, using GraalVM, so there is nothing in the data that precludes making it an IntVector. I also explicitly convert it to raw using
as.raw()
.Not sure if this is relevant, but I am on MacOS and have poppler 0.72.0 installed using brew (required for the pdftools package)
Thanks in advance!
Stacktrace