Skip to content

Intermitted seg fault returning arma::sp_mat to R #108

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

Closed
elbamos opened this issue Sep 1, 2016 · 8 comments
Closed

Intermitted seg fault returning arma::sp_mat to R #108

elbamos opened this issue Sep 1, 2016 · 8 comments

Comments

@elbamos
Copy link

elbamos commented Sep 1, 2016

I've been regularly getting seg faults in code that returns a largeish sp_mat from C++ to R (as a sparse matrix). I can consistently reproduce it with the code, it happens about 75% of the time. But I haven't been able to isolate a minimally reproducible example.

Where it occurs, is when R calls a C++ function that calls a nested function that creates and returns an sp_mat that is then immediately returned to R. I've traced the segfault to the return line.

Calling t() twice works-around it.

If:

// [[Rcpp::export]]
arma::sp_mat referenceWij(const arma::ivec& i,
                                  const arma::ivec& j,
                                  arma::vec& d,
                                  Rcpp::Nullable<Rcpp::NumericVector> threads,
                                  double perplexity) {
#ifdef _OPENMP
    checkCRAN(threads);
#endif
  ReferenceEdges ref = ReferenceEdges(perplexity, i, j, d);
  ref.run();
  sp_mat wij = ref.getWIJ();
  return wij; // segfaults on this line ~ 75% of the time.
}

But:

// [[Rcpp::export]]
arma::sp_mat referenceWij(const arma::ivec& i,
                                  const arma::ivec& j,
                                  arma::vec& d,
                                  Rcpp::Nullable<Rcpp::NumericVector> threads,
                                  double perplexity) {
#ifdef _OPENMP
    checkCRAN(threads);
#endif
  ReferenceEdges ref = ReferenceEdges(perplexity, i, j, d);
  ref.run();
  sp_mat wij = ref.getWIJ();
  wij = wij.t(); 
  wij = wij.t();
  return wij;  // Does not seg fault ever
}
@eddelbuettel
Copy link
Member

Thanks. But what is ReferenceEdges? Without it this is not buildable and reproducible...

If the double t() helps it may be that extra copies help, and something is not quite right otherwise. Maybe you can debug the wrap() converter? The relevant code is probably here.

@elbamos
Copy link
Author

elbamos commented Sep 1, 2016

Here is the context of the code: https://github.com/elbamos/largeVis/blob/cranpush/src/edgeweights.cpp

And the error is triggerable using the first test here: https://github.com/elbamos/largeVis/blob/cranpush/tests/testthat/testspecific.R

I can take a look at the wrapper and give it a try over the weekend, but I fear this issue is going to be at the outer reaches of my limited C++ skills.

On Sep 1, 2016, at 6:18 AM, Dirk Eddelbuettel [email protected] wrote:

Thanks. But what is ReferenceEdges? Without it this is not buildable and reproducible...

If the double t() helps it may be that extra copies help, and something is not quite right otherwise. Maybe you can debug the wrap() converter? The relevant code is probably here.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@eddelbuettel
Copy link
Member

I don't have your package. Could you possibly mock something with the fewest possible dependencies and tricks which still exhibits the issue, ideally also outside of testthat? This is quite possibly a subtle bug in how we create, or dispose of, sp_mat objects. I don't use those much, but we should harden this.

@kevinushey
Copy link
Contributor

kevinushey commented Sep 1, 2016

Here's what a version of R built with sanitizers says:

        expect_silent(vis <- largeVis(badmat, K = 50, threads = 2, sgd_batches = 1000))
==98148==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x0001250ea800 at pc 0x000125fc18ff bp 0x7fff55c1c5b0 sp 0x7fff55c1c5a8
READ of size 8 at 0x0001250ea800 thread T0
    #0 0x125fc18fe in ReferenceEdges::ReferenceEdges(double, arma::Col<long long> const&, arma::Col<long long> const&, arma::Col<double> const&) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f88fe)
    #1 0x125fb96b1 in referenceWij(arma::Col<long long> const&, arma::Col<long long> const&, arma::Col<double>&, Rcpp::Nullable<Rcpp::Vector<14, Rcpp::PreserveStorage> >, double) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f06b1)
    #2 0x125dd4162 in largeVis_referenceWij (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0xb162)
    #3 0x10bb9d572 in do_dotcall (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x25c572)
    #4 0x10bca3971 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362971)
    #5 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
    #6 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #7 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #8 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
    #9 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
    #10 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #11 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
    #12 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #13 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #14 0x10be1dd39 in dispatchMethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dcd39)
    #15 0x10be1d0c0 in Rf_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dc0c0)
    #16 0x10be1e8ef in do_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dd8ef)
    #17 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #18 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #19 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
    #20 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
    #21 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #22 0x10bda26d5 in Rf_ReplIteration (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4616d5)
    #23 0x10bda70b0 in R_ReplConsole (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4660b0)
    #24 0x10bda6ea7 in run_Rmainloop (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x465ea7)
    #25 0x109fdeea4 in main (/Users/kevin/r/r-devel-sanitizers/lib/R/bin/exec/R+0x100000ea4)
LLVMSymbolizer: error reading file: No object file for requested architecture
    #26 0x7fff99faa5ac  (/usr/lib/system/libdyld.dylib+0x35ac)
    #27 0x3  (<unknown module>)

0x0001250ea800 is located 0 bytes to the right of 409600-byte region [0x000125086800,0x0001250ea800)
allocated by thread T0 here:
    #0 0x10a033740 in wrap_malloc (/usr/local/llvm/lib/clang/3.9.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x4c740)
    #1 0x125de24ff in double* arma::memory::acquire<double>(unsigned long long) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x194ff)
    #2 0x125dea10e in arma::Mat<long long>::init_cold() (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x2110e)
    #3 0x125df3188 in arma::Col<long long>::Col(unsigned long long) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x2a188)
    #4 0x125df2f0a in Rcpp::traits::IndexingExporter<arma::Col<long long>, long long>::get() (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29f0a)
    #5 0x125df2e17 in arma::Col<long long> Rcpp::internal::as<arma::Col<long long> >(SEXPREC*, Rcpp::traits::r_type_generic_tag) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29e17)
    #6 0x125df2d4d in arma::Col<long long> Rcpp::as<arma::Col<long long> >(SEXPREC*) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29d4d)
    #7 0x125df2cc1 in Rcpp::ArmaVec_InputParameter<long long, arma::Col<long long>, arma::Col<long long> const&, Rcpp::traits::integral_constant<bool, true> >::ArmaVec_InputParameter(SEXPREC*) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29cc1)
    #8 0x125dd408b in largeVis_referenceWij (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0xb08b)
    #9 0x10bb9d572 in do_dotcall (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x25c572)
    #10 0x10bca3971 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362971)
    #11 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
    #12 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #13 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #14 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
    #15 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
    #16 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #17 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
    #18 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #19 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #20 0x10be1dd39 in dispatchMethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dcd39)
    #21 0x10be1d0c0 in Rf_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dc0c0)
    #22 0x10be1e8ef in do_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dd8ef)
    #23 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #24 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
    #25 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
    #26 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
    #27 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
    #28 0x10bda26d5 in Rf_ReplIteration (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4616d5)
    #29 0x10bda70b0 in R_ReplConsole (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4660b0)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f88fe) in ReferenceEdges::ReferenceEdges(double, arma::Col<long long> const&, arma::Col<long long> const&, arma::Col<double> const&)
Shadow bytes around the buggy address:
  0x100024a1d4b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100024a1d4c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100024a1d4d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100024a1d4e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100024a1d4f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100024a1d500:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x100024a1d510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x100024a1d520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x100024a1d530: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x100024a1d540: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x100024a1d550: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==98148==ABORTING

So it's likely your ReferenceEdges constructor is buggy.

@elbamos
Copy link
Author

elbamos commented Sep 1, 2016

It's possible, although that constructor is pretty straightforward. But the seg fault I'm seeing is happening when the function returns, not when the object is created. And it's resolved by the transposition.

On Sep 1, 2016, at 11:54 AM, Kevin Ushey [email protected] wrote:

Here's what a version of R built with sanitizers says:

    expect_silent(vis <- largeVis(badmat, K = 50, threads = 2, sgd_batches = 1000))==98148==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x0001250ea800 at pc 0x000125fc18ff bp 0x7fff55c1c5b0 sp 0x7fff55c1c5a8

READ of size 8 at 0x0001250ea800 thread T0
#0 0x125fc18fe in ReferenceEdges::ReferenceEdges(double, arma::Col const&, arma::Col const&, arma::Col const&) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f88fe)
#1 0x125fb96b1 in referenceWij(arma::Col const&, arma::Col const&, arma::Col&, Rcpp::Nullable<Rcpp::Vector<14, Rcpp::PreserveStorage> >, double) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f06b1)
#2 0x125dd4162 in largeVis_referenceWij (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0xb162)
#3 0x10bb9d572 in do_dotcall (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x25c572)
#4 0x10bca3971 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362971)
#5 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
#6 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#7 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#8 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
#9 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
#10 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#11 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
#12 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#13 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#14 0x10be1dd39 in dispatchMethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dcd39)
#15 0x10be1d0c0 in Rf_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dc0c0)
#16 0x10be1e8ef in do_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dd8ef)
#17 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#18 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#19 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
#20 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
#21 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#22 0x10bda26d5 in Rf_ReplIteration (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4616d5)
#23 0x10bda70b0 in R_ReplConsole (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4660b0)
#24 0x10bda6ea7 in run_Rmainloop (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x465ea7)
#25 0x109fdeea4 in main (/Users/kevin/r/r-devel-sanitizers/lib/R/bin/exec/R+0x100000ea4)
LLVMSymbolizer: error reading file: No object file for requested architecture
#26 0x7fff99faa5ac (/usr/lib/system/libdyld.dylib+0x35ac)
#27 0x3 ()

0x0001250ea800 is located 0 bytes to the right of 409600-byte region [0x000125086800,0x0001250ea800)
allocated by thread T0 here:
#0 0x10a033740 in wrap_malloc (/usr/local/llvm/lib/clang/3.9.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x4c740)
#1 0x125de24ff in double* arma::memory::acquire(unsigned long long) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x194ff)
#2 0x125dea10e in arma::Mat::init_cold() (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x2110e)
#3 0x125df3188 in arma::Col::Col(unsigned long long) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x2a188)
#4 0x125df2f0a in Rcpp::traits::IndexingExporter<arma::Col, long long>::get() (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29f0a)
#5 0x125df2e17 in arma::Col Rcpp::internal::as<arma::Col >(SEXPREC_, Rcpp::traits::r_type_generic_tag) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29e17)
#6 0x125df2d4d in arma::Col Rcpp::as<arma::Col >(SEXPREC_) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29d4d)
#7 0x125df2cc1 in Rcpp::ArmaVec_InputParameter<long long, arma::Col, arma::Col const&, Rcpp::traits::integral_constant<bool, true> >::ArmaVec_InputParameter(SEXPREC*) (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x29cc1)
#8 0x125dd408b in largeVis_referenceWij (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0xb08b)
#9 0x10bb9d572 in do_dotcall (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x25c572)
#10 0x10bca3971 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362971)
#11 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
#12 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#13 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#14 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
#15 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
#16 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#17 0x10bd0527a in do_begin (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c427a)
#18 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#19 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#20 0x10be1dd39 in dispatchMethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dcd39)
#21 0x10be1d0c0 in Rf_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dc0c0)
#22 0x10be1e8ef in do_usemethod (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4dd8ef)
#23 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#24 0x10bcf917f in Rf_applyClosure (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3b817f)
#25 0x10bca3ace in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362ace)
#26 0x10bd06494 in do_set (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x3c5494)
#27 0x10bca3419 in Rf_eval (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x362419)
#28 0x10bda26d5 in Rf_ReplIteration (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4616d5)
#29 0x10bda70b0 in R_ReplConsole (/Users/kevin/r/r-devel-sanitizers/lib/R/lib/libR.dylib+0x4660b0)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/Users/kevin/r/r-devel-sanitizers/library/largeVis/libs/largeVis.so+0x1f88fe) in ReferenceEdges::ReferenceEdges(double, arma::Col const&, arma::Col const&, arma::Col const&)
Shadow bytes around the buggy address:
0x100024a1d4b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100024a1d4c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100024a1d4d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100024a1d4e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100024a1d4f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100024a1d500:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100024a1d510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100024a1d520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100024a1d530: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100024a1d540: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100024a1d550: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==98148==ABORTING
So it's likely your ReferenceEdges constructor is buggy.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@kevinushey
Copy link
Contributor

Unfortunately until you can produce a minimal, reproducible example (ie, using only RcppArmadillo) we have to assume the problem is in your package.

@elbamos
Copy link
Author

elbamos commented Sep 1, 2016

Guys - I filed the report to try to be helpful to you. For my part, I feel I've worked-around it.

If you do decide to look into it, my git contains a test script and test data to reproduce the error. If you'd like, I can also isolate the individual cpp and data file.

Thanks much.

On Sep 1, 2016, at 1:45 PM, Kevin Ushey [email protected] wrote:

Unfortunately until you can produce a minimal, reproducible example (ie, using only RcppArmadillo) we have to assume the problem is in your package.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@eddelbuettel
Copy link
Member

I am sorry but we all have real jobs, other projects, and many other things demanding our attention -- so we cannot provide a debugging service for you. Thanks for your understanding.

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

No branches or pull requests

3 participants