Closed ghost closed 3 years ago
thnx a lot for looking into this :( it's quite a sad news.... what's the compiler you've testing?
I'm using gcc version 9.3.0
Running valgrind on many of the examples reports "possibly lost" memory leaks. One of sources is OpenMP. For example DotFeatures::dot. I really don't get how this is the case, since openmp must use threading primitives, and shared_ptr control block is thread safe.
OpenMP also has a lot of false positives in valgrind. That is because memory management is handled by the openmp runtime, which probably has some static initialisation of thread pools and valgrind cannot track all mem allocs/free. I think it is safe to assume that most the warnings related to openmp can be ignored. I think some projects add these OpenMP related warnings to the valgrid suppression file.
we do have our suppression file: https://github.com/shogun-toolbox/shogun/blob/develop/configs/valgrind.supp
hasn't been updated in a while though
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is now being closed due to a lack of activity. Feel free to reopen it.
The example
cross_validation_support_vector_machine
fails with high probability (double free / segfault). Running valgrind showed that the source of the problem is the functionevaluate_one_run
in CrossValidation. I reported this bug before, suspecting that the problem isSG_REF
andSG_UNREF
. It turns out that openmp does not officially support C++11 features includingstd::atomic
andstd::shared_ptr
. Some implementations support them unofficially, but it seems that mine doesn't. Removing the line for using openmp fixes the problem.Resources: https://stackoverflow.com/questions/21554099/can-stdatomic-be-safely-used-with-openmp https://stackoverflow.com/questions/53198251/openmp-and-shared-ptr