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

Valgrind uninitialised value(s) #9

Closed
Jean-Romain opened this issue Jan 19, 2018 · 0 comments
Closed

Valgrind uninitialised value(s) #9

Jean-Romain opened this issue Jan 19, 2018 · 0 comments
Assignees

Comments

@Jean-Romain
Copy link
Collaborator

Testing with valgrind, streaming produces errors

R -d "valgrind --track-origins=yes --tool=memcheck --leak-check=full" --vanilla < rlastest.r

rlastest.r being the two incriminated tests of the package

library(rlas)
library(testthat)

test_that("streaming works", {
  lazfile <- system.file("extdata", "example.laz", package="rlas")
  ofile = paste0(tempfile(), ".las")

  las1 = readlasdata(lazfile, filter = "-keep_first")
  rlas:::streamlasdata(lazfile, ofile, "-keep_first")
  las2 = readlasdata(ofile)

  expect_equal(las1, las2)
})

test_that("streaming works with extra bytes", {
  lazfile <- system.file("extdata", "extra_byte.laz", package="rlas")
  ofile = paste0(tempfile(), ".las")

  las1 = readlasdata(lazfile, filter = "-keep_first")
  rlas:::streamlasdata(lazfile, ofile, "-keep_first")
  las2 = readlasdata(ofile)

  expect_equal(las1, las2)
})
==6793== Conditional jump or move depends on uninitialised value(s)
==6793==    at 0xD5A655B: std::vector<double, std::allocator<double> >::reserve(unsigned long) (vector.tcc:68)
==6793==    by 0xD5A0C14: RLASstreamer::allocation() (rlasstreamer.cpp:198)
==6793==    by 0xD5AC5EF: lasdatareader(Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, Rcpp::Vector<13, Rcpp::PreserveStorage>) (readLAS.cpp:81)
==6793==    by 0xD5C0BCF: _rlas_lasdatareader (RcppExports.cpp:63)
==6793==    by 0x4F0C661: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F0CC9B: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4A0AC: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4CB4D: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F49E8B: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4BEAE: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F49C55: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4DCB5: ??? (in /usr/lib/R/lib/libR.so)
==6793==  Uninitialised value was created by a stack allocation
==6793==    at 0xD5AC309: lasdatareader(Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, Rcpp::Vector<13, Rcpp::PreserveStorage>) (readLAS.cpp:63)
==6793== 
==6793== Conditional jump or move depends on uninitialised value(s)
==6793==    at 0xD5A6575: std::vector<double, std::allocator<double> >::reserve(unsigned long) (vector.tcc:70)
==6793==    by 0xD5A0C14: RLASstreamer::allocation() (rlasstreamer.cpp:198)
==6793==    by 0xD5AC5EF: lasdatareader(Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, Rcpp::Vector<13, Rcpp::PreserveStorage>) (readLAS.cpp:81)
==6793==    by 0xD5C0BCF: _rlas_lasdatareader (RcppExports.cpp:63)
==6793==    by 0x4F0C661: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F0CC9B: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4A0AC: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4CB4D: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F49E8B: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4BEAE: ??? (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F49C55: Rf_eval (in /usr/lib/R/lib/libR.so)
==6793==    by 0x4F4DCB5: ??? (in /usr/lib/R/lib/libR.so)
==6793==  Uninitialised value was created by a stack allocation
==6793==    at 0xD5AC309: lasdatareader(Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, Rcpp::Vector<13, Rcpp::PreserveStorage>) (readLAS.cpp:63)
==6793== 
@Jean-Romain Jean-Romain self-assigned this Jan 19, 2018
Jean-Romain added a commit that referenced this issue Dec 31, 2018
Former-commit-id: 5542773
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

1 participant