Open YaohuiZeng opened 7 years ago
The SharedBigMatrix
class inherits from BigMatrix
- including the ncol
function the error references. Is the object you created that is causing the error a pointer?
@kaneplusplus I am not sure I understand, but basically I just use as.big.matrix
to create the big.matrix
object. Also, my package didn't touch any c++
source code in bigmemory
, nor did it implement any new subclasses. It just accesses big.matrix
object using MatrixAccessor
in bigmemory
.
Nevermind, I found the problem. It looks like clang UBSan was not compiled with RTTI (similar issue here). The sanitizer was not built to handle inheritance and when you call xMat->ncol()
on line 87 of gaussian_hsr.cpp
the compiler can't find ncol
because it can't find methods of the parent class.
Thanks a lot for debugging @kaneplusplus ! Then what is the best way to fix this? Should I just get ncol
inside R
and then pass it to c++
code?
Also, if the errors are caused by xMat->ncol()
, presumably checking bigmemory
with clang UBSan
would also give that kind of error.
It would be best if they fixed their sanitizer ;-)
The previous link prescribes using the -fno-sanitize=vptr
option but I think this will cause a warning in your build since you are fiddling with compiler flags. We should probably send an email to whoever is in charge of the builder. Do you know if it's Uwe?
I know Uwe and Kurt help maintain R packages, but it's Kurt who brought up the memory leak issue. I just sent out an email to both and have you copied on the list. Hope they will take care of it. Thanks, @kaneplusplus .
@YaohuiZeng Did you ever get this issue resolved? If so what was the fix?
@jaredhuling not yet. Uwe pointed out that the issue seems caused by bugs in LLVM. I haven't got a chance to reach out the author of LLVM. Let me try that within these days.
Hi bigmemory authors,
I am resubmitting to CRAN my R package biglasso, which depends on bigmemory, and noticed that the Memtest with
clang-UBSAN
reveals some strange runtime errors related toBigMatrix
object, though I didn't encounter any errors withR CMD check --as-cran
, nor withwin-builder
.I attached some output as below. Detailed output can be found here.
Could you clarify me how to fix this? In addition, I have my package depend on
bigmemory (>= 4.0.0)
, should I change the dependency to the latest version, say >=4.5.0 ?