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

Fix 'double free or corruption' error on yarpdev --list #900

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

martinaxgloria
Copy link
Contributor

@martinaxgloria martinaxgloria commented Aug 28, 2023

This PR should fix #840.

Together with @sgiraz, we found out that the double free or corruption error that was retrieved when running yarpdev --list may occur in eth::EthBoards class. In particular, it seems that the destructor of this class is responsible for destroying some members of this class, but then another function is trying to free memory that was already freed.

@marcoaccame what do you think about it? Could you please have a look?

@pattacini
Copy link
Member

Detailed analysis reported in:

@traversaro
Copy link
Member

Are this variables used anywhere? If they are not used, perhaps an easier fix is just to remove them?

@traversaro
Copy link
Member

Are this variables used anywhere? If they are not used, perhaps an easier fix is just to remove them?

I may be wrong, but it seems that defaultnames is not used.

@martinaxgloria
Copy link
Contributor Author

Are this variables used anywhere? If they are not used, perhaps an easier fix is just to remove them?

Hi @traversaro,
they seem not to be used anywhere

@martinaxgloria
Copy link
Contributor Author

We could keep this PR open waiting for @marcoaccame feedback (I think he's the author of this code) and then we decide how to fix this issue

Copy link
Contributor

@marcoaccame marcoaccame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @martinaxgloria, your change compiles and solves the problem. So it is fine by me.

Only comment (to myself, as I wrote this code): variable defaultnames is not used so it may be removed. But for now, let's go for the quick fix.

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me

@pattacini pattacini merged commit 2d10341 into robotology:master Sep 4, 2023
@martinaxgloria martinaxgloria deleted the fix/double_free branch September 4, 2023 08:27
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.

malloc_consolidate(): invalid chunk size Aborted (core dumped) error when running yarpdev --list
4 participants