modelview_test.py segfaults python

Bug #1070772 reported by Dimitri John Ledkov
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
Invalid
Medium
Unassigned
python3.2 (Ubuntu)
Invalid
Medium
Unassigned
shiboken (Debian)
Fix Released
Unknown
shiboken (Ubuntu)
Fix Released
High
Unassigned

Bug Description

python2.7, 3.2 and 3.3. Quantal and Raring.

# cleanup ints: 22 unfreed ints
# <int at 0x1c139f0, refcnt=1, val=65536>
# <int at 0x1c13a08, refcnt=1, val=640>
# <int at 0x1ba4848, refcnt=1, val=590923713>
# <int at 0x1ba4860, refcnt=1, val=907133923>
# <int at 0x1ba4878, refcnt=1, val=69069>
# <int at 0x1ba4890, refcnt=1, val=3644798167>
# <int at 0x1ba48a8, refcnt=1, val=89869747>
# <int at 0x1ba48c0, refcnt=1, val=1927868237>
# <int at 0x1b52540, refcnt=2, val=30>
# <int at 0x1b525e8, refcnt=2, val=23>
# <int at 0x1b52690, refcnt=5, val=16>
# <int at 0x1b52708, refcnt=3, val=11>
# <int at 0x1b52720, refcnt=5, val=10>
# <int at 0x1b52738, refcnt=4, val=9>
# <int at 0x1b52750, refcnt=3, val=8>
# <int at 0x1b52768, refcnt=4, val=7>
# <int at 0x1b52798, refcnt=5, val=5>
# <int at 0x1b527c8, refcnt=12, val=3>
# <int at 0x1b527e0, refcnt=20, val=2>
# <int at 0x1b527f8, refcnt=41, val=1>
# <int at 0x1b52810, refcnt=67, val=0>
# <int at 0x1b52828, refcnt=9, val=-1>
# cleanup floats
Segmentation fault (core dumped)

Reported upstream at https://bugreports.qt-project.org/browse/PYSIDE-121

Tags: ftbfs patch
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Changed in shiboken (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Debian's python2.7 and python3.2 do not segfault.

Revision history for this message
Matthias Klose (doko) wrote :

debian/rules ignores the value of the test runs with the debug interpreters. why? same problem which is hidden by the non-debug build?

Barry Warsaw (barry)
Changed in shiboken (Ubuntu):
assignee: nobody → Barry Warsaw (barry)
Barry Warsaw (barry)
Changed in shiboken (Ubuntu):
assignee: Barry Warsaw (barry) → nobody
importance: High → Undecided
Steve Langasek (vorlon)
Changed in shiboken (Ubuntu):
importance: Undecided → High
Revision history for this message
Barry Warsaw (barry) wrote :

<slangasek> fwiw if someone (ScottK?) considers not having pyside installable
            a problem and feels that it's better to have shiboken skipping the
            test suite and building with a known bug, I don't object [14:47]
<slangasek> I just don't think we should do that as non-users of the package

Revision history for this message
Didier Raboud (odyx) wrote :

Does it also happen with the latest upstream release (1.1.2) ?

Didier Raboud (odyx)
description: updated
Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1070772] Re: modelview_test.py segfaults python

On Oct 27, 2012, at 11:33 AM, Didier Raboud wrote:

>Does it also happen with the latest upstream release (1.1.2) ?

Yes, in exactly the same way.

Didier Raboud (odyx)
no longer affects: python-numpy (Ubuntu)
Changed in python3.2 (Ubuntu):
importance: Undecided → Medium
Changed in python2.7 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Julian Taylor (jtaylor) wrote :

it segfaults for all pythons now, including the -dbg versions.

the problematic code part looks pretty broken:
...
       Py_DECREF((PyObject*)self);
    }
    //Python Object is not destroyed yet
    if (cppData && Shiboken::BindingManager::instance().hasWrapper(cppData)) {
        self->d->hasOwnership = false;
        // the cpp object instance was deleted
        delete[] self->d->cptr;
        self->d->cptr = 0;
    }
...

it decrefs self to zero and then dereferences members again, before a certain commit the comment:
// After this point the object can be death do not use the self pointer bellow
was below the decref instead of at the end of the function, so this code is very likely broken.

unfortunately this is not even the cause of the crash, it already crashes on the decref above, exchanging the order of the code segments does not fix it.

commenting the decref (introducing a memleak) fixes python2 but python 3 still fails:
  70 - sample_duck_punching (SEGFAULT)
 150 - sample_static_nonstatic_methods (SEGFAULT)

Revision history for this message
Julian Taylor (jtaylor) wrote :

filed https://bugreports.qt-project.org/browse/PYSIDE-145 for the other failing tests
it also includes a hacky patch

Revision history for this message
Julian Taylor (jtaylor) wrote :

also filed https://bugreports.qt-project.org/browse/PYSIDE-146 for the python multiarch path issue

Matthias Klose (doko)
tags: added: ftbfs
Revision history for this message
Julian Taylor (jtaylor) wrote :

I prepared a debdiff which fixes the build
the segfault is "fixed" by exchanging it by a memleak, ugly but I don't know how to fix it

tags: added: patch
Changed in shiboken (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shiboken - 1.1.2-2ubuntu1

---------------
shiboken (1.1.2-2ubuntu1) raring; urgency=low

  * python3.3-and-multiarch.patch:
    add python3.3 to list of python versions and deal with multiarch
    include paths
  * memleak-instead-crash.patch:
    to avoid crash on dereferencing object in tests introduce an intentional
    memleak until we have a proper fix (LP: #1070772)
  * static-override-fix.patch:
    fix broken static/non-static overloads in python3
  * update debian/shiboken-dbg.install and debian/rules makeshlibs override
    for new python abi suffixes not having "u"
 -- Julian Taylor <email address hidden> Sat, 23 Feb 2013 12:24:37 +0100

Changed in shiboken (Ubuntu):
status: Confirmed → Fix Released
Changed in shiboken (Debian):
status: New → Fix Released
Matthias Klose (doko)
Changed in python3.2 (Ubuntu):
status: New → Invalid
Changed in python2.7 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.