You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use libcmaes.so as a shared library through CMake, so I installed it to a specific location and imported it into my own project using the location as below:
In my project, I tried to run the sample code that's given in the README. While the code appears to run successfully, I get a 'double free or corruption' error at termination.
Output:
best solution: best solution => f-value=2.52029e-15 / fevals=2810 / sigma=1.91516e-07 / iter=281 / elaps=7ms / x= 2.14112e-08 -1.14725e-08 -1.84194e-08 1.60249e-08 1.65269e-08 -1.96509e-08 -1.07566e-09 -2.31984e-09 2.53547e-08 5.04625e-09
optimization took 0.007 seconds
*** Error in `./nbvplanner': double free or corruption (out): 0x0000000001202320 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f46e0bbe7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f46e0bc737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f46e0bcb53c]
/home/sai/code/nbvplanner/lib/libcmaes/install/lib/libcmaes.so.0(_ZN8libcmaes12CMASolutionsD1Ev+0x13)[0x7f46e16e91b3]
First few lines of valgrind output:
best solution: best solution => f-value=4.71486e-16 / fevals=2980 / sigma=1.10926e-07 / iter=298 / elaps=336ms / x=-7.32494e-10 6.19359e-09 -5.35323e-09 4.65318e-10 5.68156e-10 1.07733e-08 1.03594e-08 -7.60523e-09 8.57882e-09 -6.96962e-09
optimization took 0.336 seconds
==7953== Invalid free() / delete / delete[] / realloc()
==7953== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7953== by 0x507A1B2: libcmaes::CMASolutions::~CMASolutions() (in /home/sai/code/nbvplanner/lib/libcmaes/install/lib/libcmaes.so.0.0.0)
==7953== by 0x4112B1: main (in /home/sai/code/nbvplanner/build/nbvplanner)
==7953== Address 0x6e785c0 is 32 bytes inside a block of size 112 alloc'd
==7953== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7953== by 0x4156BF: libcmaes::CMASolutions::CMASolutions(libcmaes::CMASolutions const&) (in /home/sai/code/nbvplanner/build/nbvplanner)
==7953== by 0x416391: libcmaes::CMASolutions libcmaes::cmaes<libcmaes::GenoPheno<libcmaes::NoBoundStrategy, libcmaes::NoScalingStrategy> >(std::function<double (double const*, int const&)>&, libcmaes::CMAParameters<libcmaes::GenoPheno<libcmaes::NoBoundStrategy, libcmaes::NoScalingStrategy> >&, std::function<int (libcmaes::CMAParameters<libcmaes::GenoPheno<libcmaes::NoBoundStrategy, libcmaes::NoScalingStrategy> > const&, libcmaes::CMASolutions const&)>&, std::function<Eigen::Matrix<double, -1, 1, 0, -1, 1> (double const*, int const&)>, libcmaes::CMASolutions const&, std::function<int (libcmaes::CMAParameters<libcmaes::GenoPheno<libcmaes::NoBoundStrategy, libcmaes::NoScalingStrategy> > const&, libcmaes::CMASolutions const&, std::basic_ofstream<char, std::char_traits<char> >&)>&) (in /home/sai/code/nbvplanner/build/nbvplanner)
==7953== by 0x4111D8: main (in /home/sai/code/nbvplanner/build/nbvplanner)
==7953==
I was wondering if anyone had any idea why this might be happening?
The text was updated successfully, but these errors were encountered:
Hi, you might want to remove the -mfma just in case it gets in the way. Other than that you may want to share the nvbplanner code so see how you are using the lib.
Removing -mfma did the trick (I thought that was needed because it was mentioned in some other issues regarding seg faults, but apparently not). Thank you!
I am trying to use libcmaes.so as a shared library through CMake, so I installed it to a specific location and imported it into my own project using the location as below:
In my project, I tried to run the sample code that's given in the README. While the code appears to run successfully, I get a 'double free or corruption' error at termination.
Output:
First few lines of valgrind output:
I was wondering if anyone had any idea why this might be happening?
The text was updated successfully, but these errors were encountered: