[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 Rainer Bielefeld changed: What|Removed |Added AssignedTo|libreoffice-b...@lists.free |mst...@redhat.com |desktop.org | CC||LibreOffice@bielefeldundbus ||s.de --- Comment #16 from Rainer Bielefeld 2012-04-05 08:11:13 PDT --- I added Fix submitter as assignee because this will ease queries and bug tracking. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 Michael Stahl changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED Version|LibO 3.5.1 RC1 |LibO 3.5.0 RC2 -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #13 from db3l@gmail.com 2012-03-13 20:16:01 PDT --- I've been able to verify (though it took a few more iterations to crash) that the bug exists when building for Python 3 (tested against the current 3.2.2), and that the supplied patch is compatible. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #12 from db3l@gmail.com 2012-03-13 18:27:49 PDT --- Created attachment 58412 --> https://bugs.freedesktop.org/attachment.cgi?id=58412 Return new references from PyUNO_cmp Always return a new reference from the rich comparison function. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 db3l@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Comment #11 from db3l@gmail.com 2012-03-13 18:25:10 PDT --- I'm re-opening this because while the committed patch fixes getting the comparison code called under Python 2.x, after using it for a bit it turns out there's an additional subtler issue with the new rich comparison function that I only started seeing once it was getting called in my environment. The problem is that the new rich comparison function does not return new references to Py_True/Py_False (e.g., increment reference counts) which leads to memory corruption and an eventual segv after some number of comparisons, or presumably at any time after a comparison depending on memory use. For example: >>> import uno >>> from com.sun.star.style import TabStop >>> a = [TabStop() for x in range(10)] >>> b = [TabStop() for x in range(10)] >>> a==b True >>> a==b Segmentation fault (A bunch of tabstops used just to force more comparisons more quickly) Personally, I just need LO 3.5.x not to break existing Python 2.x behavior so am almost inclined to just revert to the older 3-way comparison function under Python 2, leaving the rich comparison function as Python 3 only. But the rich comparison rules (always return a new reference) should be the same there so the crash exposure should already exist in Python 3 as well. So I've got a new patch to always return a new reference. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 Caolán McNamara changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #7 from db3l@gmail.com 2012-03-08 22:30:16 PST --- Drat - that's what I get for throwing in a fairly gratuitous tweak for consistency's sake - it's probably why the original Python 3 patch removed it. I'm traveling until Saturday night - if anyone wants to attach a patch just to remove the "(cmpfunc)" cast before then that should address this - if not I'll add the fix Sat or Sun. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #6 from Maxime de Roucy 2012-03-08 09:20:41 PST --- cmpfunc isn't supported by python3.2 : % grep cmpfunc /usr/include/python3.2mu/* /usr/include/python3.2mu/object.h:typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); /usr/include/python3.2mu/object.h:richcmpfunc tp_richcompare; So now when I try to build LO with python3.2 it fail saying that cmpfunc isn't defined. (Simple solution is to build LO with python2 ... but it's just to let you know.) -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 Michael Stahl changed: What|Removed |Added CC||atayoo...@googlemail.com, ||dtar...@redhat.com, ||mst...@redhat.com Keywords||regression --- Comment #4 from Michael Stahl 2012-03-05 10:45:26 PST --- the Python 3 commit apparently converted the PyUNO_cmp function to a "rich compare" function. so your patch looks entirely plausible to me; unless some of the people on CC: who actually know Python tell me a good reason not to, i'll commit it soon. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 db3l@gmail.com changed: What|Removed |Added Attachment #57987|0 |1 is obsolete|| --- Comment #3 from db3l@gmail.com 2012-03-05 00:26:38 PST --- Created attachment 58017 --> https://bugs.freedesktop.org/attachment.cgi?id=58017 Correct comparisons when building for Python 2.x Update the proposed patch to maintain Python 3 compatibility - only Python 2 needs the rich comparison tp_flags value. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #2 from db3l@gmail.com 2012-03-03 15:14:11 UTC --- Created attachment 57987 --> https://bugs.freedesktop.org/attachment.cgi?id=57987 Correct rich comparison of wrapped objects -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)
https://bugs.freedesktop.org/show_bug.cgi?id=46926 --- Comment #1 from db3l@gmail.com 2012-03-03 15:13:37 PST --- Ok, this turned out to be pretty simple. While a new rich comparison function was implemented in the Python 3 changeset, the tp_flags value in the object type structure was not set to indicate that rich comparisons were supported. So the comparison function was never called, and nothing (aside from comparing an object to itself) will ever compare true. I'm attaching a patch correcting this. I also adjusted the final return code of the comparison function, though I still suspect the function can never be called with anything but Py_EQ, so perhaps arguably all support for Py_NE should be removed. This was a smaller change though. The patch includes a small change to include the older cmpfunc reference in the type structure, to maintain consistency with the rest of the structure where method values (even if null) show the casts. -- David -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs