Memory leak and incorrect behaviour of generated bindings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sip4 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Happening on all release of sip from 4.16.8 until 4.19.20, so Xenial and newer are all affected.
I have tested this on both Xenial(sip 4.17) and Bionic(4.19.7).
My request is to update all affected releases to 4.19.21.
[Impact]
Since the release of sip 4.16.8, but especially commit https:/
The reference problem:
(generateVariab
In the get function of a class member, there isn't a reference kept to the containing class. Therefore if no other references are kept to the containing class, the containing class in cpp is deleted, also if there are still references to the member. This causes also the member in cpp to be deleted, while in python there is still a reference to the member. Which can't be accessed anymore.
Fixed in:
https:/
https:/
https:/
The memory leak problem:
(sip_api_
A new reference to "key_obj" is obtained from PyLong_
Fixed in:
https:/
Both problems are fixed in 4.19.21. Also the entire changelog between 4.19.20 and 4.19.21 is related to fixing only these two problems.
The converstation between me and the develop of sip can be read here: http://
[Test Case]
As sip is a library to generate python bindings. So my test case will be an "applied" test case. My test case is focused on the 'python_
For this test case, please use the "test/sip_bug" branch of my fork of the library, https:/
To test the reference problem, follow the steps from travis config. (Of course skipping the installation of python-sip-dev if testing with other sip versions.)
To test the memory leak, run the following code (After running the steps from the travis config):
```
import PyKDL as kdl
F = kdl.Frame(
kdl.
kdl.Vector(1, 2, 3))
while True:
v = F.p
```
See http://
[Regression Potential]
Different versions of SIP have been released on multiple distributions. No bugs have been reported of these versions. I have tested multiple versions of SIP in the affected range on both Xenial and Bionic. I didn't experience any bugs other than the two reported here.
[Other Info]
Already mentioned, but the conversation between me and the developer, http://
Changed in sip4 (Ubuntu): | |
status: | New → Fix Committed |
Hi Matthijs!
For 20.04 (Focal), this is now fixed, so I am changing the bug status accordingly.
For 18.04 (Bionic), I prepared a test package in https:/ /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 3941. Can you please test if it works fine for you?
For 16.04 (Xenial), the patches do not apply cleanly. If you managed to backport the fixes, can you attach your backported patch?