MicroscPSF / MicroscPSF-Cpp

Fast and Accurate 3D PSF Computation for Fluorescence Microscopy
MIT License
0 stars 0 forks source link

Memory leak with `libopenblas64 == 0.3.8` #10

Open antonysigma opened 6 days ago

antonysigma commented 6 days ago

When computing the Penrose pseudo-inverse, the SVG algorithm from libopenblas causes memory leak.

Error:

ddressSanitizer:DEADLYSIGNAL
=================================================================
==25845==ERROR: AddressSanitizer: SEGV on unknown address 0x7fff4c97b8e0 (pc 0x7fba449097e4 bp 0x7fff4c9675f0 sp 0x7fff4c967200 T0)
==25845==The signal is caused by a WRITE memory access.
    #0 0x7fba449097e3 in dgeqrf_ (/usr/lib/x86_64-linux-gnu/openblas64-serial/libopenblas64.so.0+0x1a827e3)
    #1 0x7fba4490fe86 in dgesdd_ (/usr/lib/x86_64-linux-gnu/openblas64-serial/libopenblas64.so.0+0x1a88e86)
    #2 0x563001203af8 in void arma::lapack::gesdd<double>(char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, double*, int*, int*, int*) ../3rdparty/armadillo-code/include/armadillo_bits/translate_lapack.hpp:526
    #3 0x563001203af8 in bool arma::auxlib::svd_dc_econ<double>(arma::Mat<double>&, arma::Col<double>&, arma::Mat<double>&, arma::Mat<double>&) ../3rdparty/armadillo-code/include/armadillo_bits/auxlib_meat.hpp:3836
    #4 0x563001249ba8 in bool arma::op_pinv::apply_gen<double>(arma::Mat<double>&, arma::Mat<double>&, arma::get_pod_type<double>::result, unsigned long long) ../3rdparty/armadillo-code/include/armadillo_bits/op_pinv_meat.hpp:267
    #5 0x56300125447c in bool arma::op_pinv::apply_direct<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans> >(arma::Mat<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::elem_type>&, arma::Base<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::elem_type, arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans> > const&, arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::pod_type, unsigned long long) ../3rdparty/armadillo-code/include/armadillo_bits/op_pinv_meat.hpp:140
    #6 0x56300125447c in bool arma::op_pinv_default::apply_direct<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans> >(arma::Mat<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::elem_type>&, arma::Base<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::elem_type, arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans> > const&) ../3rdparty/armadillo-code/include/armadillo_bits/op_pinv_meat.hpp:55
    #7 0x56300125447c in void arma::op_pinv_default::apply<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans> >(arma::Mat<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>::elem_type>&, arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> const&) ../3rdparty/armadillo-code/include/armadillo_bits/op_pinv_meat.hpp:32
    #8 0x56300125447c in arma::Mat<double>::Mat<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>(arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> const&) ../3rdparty/armadillo-code/include/armadillo_bits/Mat_meat.hpp:5043
    #9 0x56300125447c in arma::partial_unwrap_default<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> >::partial_unwrap_default(arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> const&) ../3rdparty/armadillo-code/include/armadillo_bits/unwrap.hpp:1198
    #10 0x56300125447c in arma::partial_unwrap<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> >::partial_unwrap(arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default> const&) ../3rdparty/armadillo-code/include/armadillo_bits/unwrap.hpp:1257
    #11 0x56300125447c in void arma::glue_mixed_times::apply<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans> >(arma::Mat<arma::eT_promoter<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans> >::eT>&, arma::mtGlue<arma::eT_promoter<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans> >::eT, arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans>, arma::glue_mixed_times> const&) ../3rdparty/armadillo-code/include/armadillo_bits/glue_mixed_meat.hpp:37
    #12 0x5630011783eb in arma::Mat<std::complex<double> >::Mat<arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans>, arma::glue_mixed_times>(arma::mtGlue<std::complex<double>, arma::Op<arma::Op<arma::eOp<arma::Glue<arma::Col<double>, arma::Row<double>, arma::glue_times>, arma::eop_besselj<(unsigned char)0> >, arma::op_htrans>, arma::op_pinv_default>, arma::Op<arma::Mat<std::complex<double> >, arma::op_htrans>, arma::glue_mixed_times> const&) ../3rdparty/armadillo-code/include/armadillo_bits/Mat_meat.hpp:6139
    #13 0x5630011783eb in microsc_psf::makePSF(microsc_psf::microscope_params_t, microsc_psf::pair_t<units::Micrometer<double> >, microsc_psf::pair_t<unsigned int>, units::Micrometer<double>, microsc_psf::precision_li2017_t) ../microsc-psf/src/main.cpp:151
    #14 0x5630010979bf in main ../examples/generate-psf.cpp:24
    #15 0x7fba41c81082 in __libc_start_main ../csu/libc-start.c:308
    #16 0x56300112871d in _start (~/MicroscPSF-Cpp/build/examples/generate-psf+0x26f71d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/openblas64-serial/libopenblas64.so.0+0x1a827e3) in dgeqrf_
==25845==ABORTING