https://bugs.freedesktop.org/show_bug.cgi?id=46926

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #11 from [email protected] 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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to