Plugin API passes memory ownership
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Critical
|
William Good |
Bug Description
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 (SoundSourcePro
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:/
Related branches
- RJ Skerry-Ryan: Approve
- William Good: Needs Fixing
-
Diff: 89 lines (+25/-7)4 files modifiedmixxx/plugins/soundsourcem4a/soundsourcem4a.h (+10/-4)
mixxx/plugins/soundsourcewv/soundsourcewv.h (+7/-1)
mixxx/src/soundsource.h (+3/-0)
mixxx/src/soundsourceproxy.cpp (+5/-2)
description: | updated |
Changed in mixxx: | |
status: | In Progress → Fix Committed |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
Changed to crit because if this is encountered segfault does happen. Fixed in lp:~mixxxdevelopers/mixxx/fixes-plugins-mempassing r2847.