Skip to content

Conversation

@pac48
Copy link
Contributor

@pac48 pac48 commented Jan 7, 2025

@henrygerardmoore @rhaschke I have been investigating this issue where calling plan() on the same task more than once can lead to a segfault. The is some internal state the task that is modified during planning, which causes subsequent planning to fail. For example, the states_ field of StagePrivate contained some values from the last run on the subsequent run. My solution is to call the reset() method on the MTC Task object before calling init() and planning. This fixed the segfault we were seeing and also generated valid plans.

Let me know if this is a suitable solution or if there is another recommended way to avoid stale task objects causing failures.

Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
@pac48
Copy link
Contributor Author

pac48 commented Jan 7, 2025

Looks like CI failed due to a segfault caused by this change

moveit::task_constructor::InterfaceState::Priority::operator<(moveit::task_constructor::InterfaceState::Priority const&) const
    Segmentation fault (Address not mapped to object [0xed])

@rhaschke
Copy link
Contributor

rhaschke commented Jan 7, 2025

In principle, it should be possible to (re)run plan() without resetting beforehand - for example to continue planning when a previous run prematurely stopped, e.g. due to a timeout. If that's not working for you, I would like to see a minimal example reproducing this.

Unfortunately, your PR revealed another issue: calling reset() before plan() should be possible as well - namely, if you want to plan from scratch instead of continuing.

@pac48
Copy link
Contributor Author

pac48 commented Feb 10, 2025

Unfortunately, I do not currently have the bandwidth to investigate this further. Closing for now.

@pac48 pac48 closed this Feb 10, 2025
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

Successfully merging this pull request may close these issues.

2 participants