helske / bssm

Bayesian Inference of State Space Models
42 stars 14 forks source link

UBSAN error #13

Closed helske closed 6 years ago

helske commented 7 years ago
OMP: Warning #96: Cannot form a team with 24 threads, using 2 instead.
OMP: Hint: Consider unsetting KMP_ALL_THREADS and OMP_THREAD_LIMIT (if either is set).
In file included from growth_model_functions.cpp:1:
In file included from /data/gannet/ripley/R/test-clang/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /data/gannet/ripley/R/test-clang/RcppArmadillo/include/RcppArmadilloForward.h:26:
In file included from /data/gannet/ripley/R/test-clang/Rcpp/include/RcppCommon.h:70:
/data/gannet/ripley/R/test-clang/Rcpp/include/Rcpp/utils/tinyformat.h:1046:32: warning: no newline at end of file [-Wnewline-eof]
#endif // TINYFORMAT_H_INCLUDED
                               ^
1 warning generated.
function_pointers.h:99:12: runtime error: call to function a1_fn(arma::Col<double> const&, arma::Col<double> const&) through pointer to incorrect function type 'arma::Col<double> (*)(const arma::Col<double> &, const arma::Col<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:7: note: a1_fn(arma::Col<double> const&, arma::Col<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:99:12 in 
function_pointers.h:114:12: runtime error: call to function P1_fn(arma::Col<double> const&, arma::Col<double> const&) through pointer to incorrect function type 'arma::Mat<double> (*)(const arma::Col<double> &, const arma::Col<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:16: note: P1_fn(arma::Col<double> const&, arma::Col<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:114:12 in 
function_pointers.h:65:12: runtime error: call to function Z_gn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) through pointer to incorrect function type 'arma::Mat<double> (*)(unsigned int, const arma::Col<double> &, const arma::Col<double> &, const arma::Col<double> &, const arma::Mat<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:55: note: Z_gn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:65:12 in 
function_pointers.h:81:12: runtime error: call to function H_fn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) through pointer to incorrect function type 'arma::Mat<double> (*)(unsigned int, const arma::Col<double> &, const arma::Col<double> &, const arma::Mat<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:27: note: H_fn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:81:12 in 
function_pointers.h:49:12: runtime error: call to function Z_fn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) through pointer to incorrect function type 'arma::Col<double> (*)(unsigned int, const arma::Col<double> &, const arma::Col<double> &, const arma::Col<double> &, const arma::Mat<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:47: note: Z_fn(unsigned int, arma::Col<double> const&, arma::Col<double> const&, arma::Col<double> const&, arma::Mat<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:49:12 in 
function_pointers.h:33:12: runtime error: call to function log_prior_pdf(arma::Col<double> const&) through pointer to incorrect function type 'double (*)(const arma::Col<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:102: note: log_prior_pdf(arma::Col<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:33:12 in 
function_pointers.h:33:12: runtime error: call to function log_prior_pdf(arma::Col<double> const&) through pointer to incorrect function type 'double (*)(const arma::Col<double> &)'
/tmp/RtmprpYU6Z/sourceCpp-x86_64-pc-linux-gnu-0.12.11/sourcecpp_a8d276dc88da/growth_model_functions.cpp:102: note: log_prior_pdf(arma::Col<double> const&) defined here
SUMMARY: AddressSanitizer: undefined-behavior function_pointers.h:33:12 in 
helske commented 7 years ago

Apparently it is not just my code as I get similar warning also when running the codes of Passing user-supplied C++ functions on rocker with ubsan-clang. And there seems to be similar warnings also in CRAN checks of Rcpp. So I'm going to ignore this for now.

helske commented 7 years ago

Or maybe not.