[PyQt] sip: Accessing members results in incorrect/missing data

Phil Thompson phil at riverbankcomputing.com
Mon Jan 13 09:53:27 GMT 2020


On 12/01/2020 23:11, Matthijs van der Burgh wrote:
> Hey All,
> 
> I think my problem is related to
> http://python.6.x6.nabble.com/sip-Member-objects-and-GC-td4503261.html,
> but this thread doesn't provide me any solution.
> 
> I have been using the following library for a long time:
> https://github.com/orocos/orocos_kinematics_dynamics
> 
> I have been using ubuntu 16.04 with sip 4.15.5 for a long time. Now I
> am moving to ubuntu 18.04 and sip 4.15.5 isn't working anymore.
> 
> Some versions of SIP will cause a segmentation fault on import of
> PyKDL, others will cause the following issue.
> 
> By accessing a member directly after calling a constructor or other
> operations which will return a new instance, the data of the member is
> incorrect.
> 
> By executing the following code:
> ```
> # Part of an unittest.Testcase
> v=Vector(3,4,5)
> v1=Vector(4,-2,1)
> w=Wrench(Vector(7,-1,3),Vector(2,-3,3))
> t=Twist(Vector(6,3,5),Vector(4,-2,7))
> R = Rotation.EulerZYX(radians(10),radians(20),radians(-10))
> F = Frame(R, v1)
> F2 = Frame(F)
> v2 = Frame(F).p
> self.assertEqual(F,F2)
> self.assertEqual(F.p,Frame(F).p)
> ```
> This last line will result in the following error:
> ```
> ts/framestest.py", line 150, in testFrame
>     self.assertEqual(F.p,Frame(F).p)
> AssertionError: [           4,          -2,           1] != [
>  0,          -2,           1]
> ```
> I have tried to locate the changes which caused the problem. I did
> this on ubuntu 16.04 as there 4.15.5 does work. I used the master
> branch of the KDL libary. I have started from 4.15.5 up to newer
> version till the error started to show up. I found that 4.16.8 is the
> first version which breaks the bindings. Especially changeset
> 11a92ebd4840,
> https://www.riverbankcomputing.com/hg/sip/rev/11a92ebd4840.
> 
> I hope you could help.

You need to talk to the authors of the bindings.

Phil


More information about the PyQt mailing list