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

Optimized build -O2 causes memory leak in libhdf5-dev 1.10.0-patch1 #10

Open
antonysigma opened this issue Jun 23, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@antonysigma
Copy link
Owner

antonysigma commented Jun 23, 2022

Known bugs: On Ubuntu 18.04 hosting libhdf5-dev 1.10.0-patch1, compiling the library with -O2 optimization flag will cause memory leak in H5PL_load.

This problem does not exist on Ubuntu 20.04 hosting HDF5 >=1.10.3.

Steps to recreate the issue:

meson --buildtype=debugoptimized -Db_sanitize=address,undefined -Db_lundef=false build-debugoptimized/
cd build-debugoptimized
ninja test
cat meson-log/testlog.txt

Error log:

1/1 jpegls-hdf-filter:benchmark / Writing small chunks FAIL            0.97s   exit status 1
14:56:43 HDF5_PLUGIN_PATH=/home/antony/jpegls-hdf-filter/build/debugoptimized/examples/.. MALLOC_PERTURB_=101 /home/antony/jpegls-hdf-filter/build/debugoptimized/examples/direct_chunk_write
----------------------------------- output -----------------------------------
stdout:
Exporting time profiling data...
stderr:

=================================================================
==5228==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 81 byte(s) in 1 object(s) allocated from:
    #0 0x7f4536007b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f4535b9a11b in H5PL_load (/usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100+0x1c911b)

SUMMARY: AddressSanitizer: 81 byte(s) leaked in 1 allocation(s).
@antonysigma antonysigma added the bug Something isn't working label Jun 23, 2022
@antonysigma
Copy link
Owner Author

If we disable -O2 option by:

meson --buildtype=plain -Db_sanitize=address,undefined -Db_lundef=false build-plain/

then the memory leak error vanishes on libhdf5-dev 1.10.0-patch1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant