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

Plugin API passes memory ownership #5954

Closed
mixxxbot opened this issue Aug 22, 2022 · 2 comments
Closed

Plugin API passes memory ownership #5954

mixxxbot opened this issue Aug 22, 2022 · 2 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: bkgood
Date: 2011-07-21T18:16:33Z
Status: Fix Released
Importance: Critical
Launchpad Issue: lp814215
Tags: plugin, soundsource


The plugin API defines a function which returns a null-terminated array of c-style strings. This memory is allocated (by malloc) in the plugin, and then expected to be freed using free() in the calling code (SoundSourceProxy::something).

This works well where the plugin and mixxx binary are linked to the same C runtime DSO, as is typically the case in Linux, but Windows has more MSVCRT DSOs in the wild than the galaxy has stars (give or take) and different CRT DSOs can use different memory structures in their malloc implementation; this manifests itself in segmentation faults/access violations on plugin usage in Windows. Because we can't guarantee (and shouldn't expect) the two objects to be linked to the same CRT DSO, it's imperative that the unit allocating the memory also be responsible for freeing it; therefore, the plugin API must be modified 
so that this is the case.

See https://code.launchpad.net/~mixxxdevelopers/mixxx/features_m4a_win7/+merge/67111

@mixxxbot
Copy link
Collaborator Author

Commented by: bkgood
Date: 2011-10-09T19:27:46Z


Changed to crit because if this is encountered segfault does happen. Fixed in lp:~mixxxdevelopers/mixxx/fixes-plugins-mempassing r2847.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 1.10.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant