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

Memory leaks in LazyPRM.cpp #833

Closed
wbq1234 opened this issue Sep 18, 2021 · 2 comments
Closed

Memory leaks in LazyPRM.cpp #833

wbq1234 opened this issue Sep 18, 2021 · 2 comments

Comments

@wbq1234
Copy link

wbq1234 commented Sep 18, 2021

Here are some outputs:

#0 0x7f5dbf085532 in operator new(unsigned long)
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x7f5dbe484b59 in ompl::base::RealVectorStateSpace::allocState() const
/ompl-main/src/ompl/base/spaces/src/RealVectorStateSpace.cpp:274
#2 0x7f5dbe3d7814 in ompl::base::StateSpace::cloneState(ompl::base::State const*) const
/ompl-main/src/ompl/base/src/StateSpace.cpp:228
#3 0x7f5dbe996993 in ompl::base::SpaceInformation::cloneState(ompl::base::State const*) const
/ompl-main/src/ompl/base/SpaceInformation.h:259
#4 0x7f5dbe996993 in ompl::geometric::LazyPRM::solve(ompl::base::PlannerTerminationCondition const&)
/ompl-main/src/ompl/geometric/planners/prm/src/LazyPRM.cpp:368

After our analysis, this crash comes from LazyPRM.cpp. In line 368/343/324 of lazyPRM.cpp, they can apply for memory space. At the same time, the freeMemory() function can release the memory. However, during our testing, the program will still run to LazyPRM.cpp: 368/343/324 (application meomory space) after the last call of freeMemory(), so the memory space is not completely released and causing memory leaks.

@wbq1234
Copy link
Author

wbq1234 commented Oct 9, 2021

After tracing and analyzing, we fixed it on LazyPRM.cpp:151,we modified the destructor as flowling:
图片1

Call freeMemory() can solve the problem.As we know: the program will still apply for memory for states after the last call of freeMemory().So we can call freeMemory() in the destructor.Finally,the problem will be solved.

@carnil
Copy link

carnil commented Jun 20, 2022

This issue was referenced for CVE-2021-41490

zkingston added a commit that referenced this issue Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants