Debian Bug report logs - #622152
[britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)

Package: release.debian.org; Maintainer for release.debian.org is Debian Release Team <debian-release@lists.debian.org>;

Reported by: Mehdi Dogguy <mehdi@debian.org>

Date: Sun, 10 Apr 2011 16:10:26 UTC

Severity: normal

Tags: moreinfo, patch

Done: "Adam D. Barratt" <adam@adam-barratt.org.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#622152; Package release.debian.org. (Sun, 10 Apr 2011 16:10:36 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mehdi Dogguy <mehdi@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Sun, 10 Apr 2011 16:10:50 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Mehdi Dogguy <mehdi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Sun, 10 Apr 2011 15:36:17 +0200
[Message part 1 (text/plain, inline)]
Package: release.debian.org
Severity: normal
Tags: patch
User: release.debian.org@packages.debian.org
Usertags: britney

Hi.

It seems that britney2 segfaults at every run when compiled for Python
2.6. After some quick investigation, the problem boils down to the
following:

Britney2 uses PyFoo_Check to check that some structure has the correct
type. That class of functions changed between Python 2.5 and 2.6. The
(relevant part of the) diff is as follows:

In Include/dictobject.h:

-#define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type)
+#define PyDict_Check(op) \
+                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
-#define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)
+#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)

In Include/object.h

 #define PyObject_TypeCheck(ob, tp) \
-       ((ob)->ob_type == (tp) || PyType_IsSubtype((ob)->ob_type, (tp)))
+    (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))

 #define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)
+#define PyType_FastSubclass(t,f)  PyType_HasFeature(t,f)

I (personally) don't care much about (how) python (does it) (tbh)
because in our case, we know that those structures have exactly the
type we are testing against. So, we can use PyFoo_CheckExact variants
instead (btw, that was winning test even with Python 2.5).

Attached is a simple patch that performs the described substitution.
Using this patch, I've been able to run britney2 on my machines
wihtout seeing any problem.

Regards,

-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
[0001-Use-Py-Dict-List-_CheckExact-instead-of-Py-Dict-List.patch (text/x-c, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#622152; Package release.debian.org. (Thu, 17 Nov 2011 20:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adam D. Barratt" <adam@adam-barratt.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Thu, 17 Nov 2011 20:57:03 GMT) Full text and rfc822 format available.

Message #10 received at 622152@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
To: Mehdi Dogguy <mehdi@debian.org>, 622152@bugs.debian.org
Subject: Re: Bug#622152: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Thu, 17 Nov 2011 20:54:02 +0000
tag 622152 + moreinfo
thanks

On Sun, 2011-04-10 at 15:36 +0200, Mehdi Dogguy wrote:
> It seems that britney2 segfaults at every run when compiled for Python
> 2.6. After some quick investigation, the problem boils down to the
> following:
> 
> Britney2 uses PyFoo_Check to check that some structure has the correct
> type. That class of functions changed between Python 2.5 and 2.6. The
> (relevant part of the) diff is as follows:
[...]
> Attached is a simple patch that performs the described substitution.
> Using this patch, I've been able to run britney2 on my machines
> wihtout seeing any problem.

I've finally (!) got to looking at this but have been unable to
reproduce the problem.  It might be a squeeze versus wheezy issue or
some oddity which has resolved itself in the meantime, but after
s/python2.5/python2.6/ in britney-py.c and rebuilding the library on
franck, everything seems to just work[tm].

If I don't change the shebang of britney herself then I do get this:

Traceback (most recent call last):
  File "./britney.py", line 2808, in <module>
    Britney().main()
  File "./britney.py", line 261, in __init__
    self.build_systems(arch)
  File "./britney.py", line 403, in build_systems
    self.systems[a] = buildSystem(a, packages)
SystemError: error return without exception set

but not a segfault.  Running the script  explicitly with python2.6 seems
to work okay in my test runs.

Regards,

Adam





Added tag(s) moreinfo. Request was from "Adam D. Barratt" <adam@adam-barratt.org.uk> to control@bugs.debian.org. (Thu, 17 Nov 2011 20:57:10 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#622152; Package release.debian.org. (Sat, 19 Nov 2011 23:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adam D. Barratt" <adam@adam-barratt.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Sat, 19 Nov 2011 23:21:03 GMT) Full text and rfc822 format available.

Message #17 received at 622152@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
To: 622152@bugs.debian.org
Subject: Re: Bug#622152: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Sat, 19 Nov 2011 23:17:02 +0000
On Thu, 2011-11-17 at 20:54 +0000, Adam D. Barratt wrote:
> On Sun, 2011-04-10 at 15:36 +0200, Mehdi Dogguy wrote:
> > It seems that britney2 segfaults at every run when compiled for Python
> > 2.6. After some quick investigation, the problem boils down to the
> > following:
[...]
> > Attached is a simple patch that performs the described substitution.
> > Using this patch, I've been able to run britney2 on my machines
> > wihtout seeing any problem.
> 
> I've finally (!) got to looking at this but have been unable to
> reproduce the problem.  It might be a squeeze versus wheezy issue or
> some oddity which has resolved itself in the meantime, but after
> s/python2.5/python2.6/ in britney-py.c and rebuilding the library on
> franck, everything seems to just work[tm].
> 
> If I don't change the shebang of britney herself then I do get this:
[...]
> SystemError: error return without exception set
> 
> but not a segfault.  Running the script  explicitly with python2.6 seems
> to work okay in my test runs.

fwiw, the test suite also appears to run without any obvious regressions
(i.e. the number of failing tests is the same).

Regards,

Adam





Information forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#622152; Package release.debian.org. (Sun, 20 Nov 2011 12:03:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mehdi Dogguy <mehdi@dogguy.org>:
Extra info received and forwarded to list. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Sun, 20 Nov 2011 12:03:32 GMT) Full text and rfc822 format available.

Message #22 received at 622152@bugs.debian.org (full text, mbox):

From: Mehdi Dogguy <mehdi@dogguy.org>
To: "Adam D. Barratt" <adam@adam-barratt.org.uk>, 622152@bugs.debian.org
Subject: Re: Bug#622152: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Sun, 20 Nov 2011 12:51:53 +0100
On 11/20/2011 12:17 AM, Adam D. Barratt wrote:
> On Thu, 2011-11-17 at 20:54 +0000, Adam D. Barratt wrote:
>> On Sun, 2011-04-10 at 15:36 +0200, Mehdi Dogguy wrote:
>>> It seems that britney2 segfaults at every run when compiled for Python
>>> 2.6. After some quick investigation, the problem boils down to the
>>> following:
> [...]
>>> Attached is a simple patch that performs the described substitution.
>>> Using this patch, I've been able to run britney2 on my machines
>>> wihtout seeing any problem.
>>
>> I've finally (!) got to looking at this but have been unable to
>> reproduce the problem.  It might be a squeeze versus wheezy issue or
>> some oddity which has resolved itself in the meantime, but after
>> s/python2.5/python2.6/ in britney-py.c and rebuilding the library on
>> franck, everything seems to just work[tm].
>>
>> If I don't change the shebang of britney herself then I do get this:
> [...]
>> SystemError: error return without exception set
>>
>> but not a segfault.  Running the script  explicitly with python2.6 seems
>> to work okay in my test runs.
> 
> fwiw, the test suite also appears to run without any obvious regressions
> (i.e. the number of failing tests is the same).
> 

maybe we should close the bug then? (it could be a temporary problem that
got fixed somewhere since then…)

P.S.: I'll keep all packages infos next time :/

Regards,

-- 
Mehdi Dogguy مهدي الدڤي
http://dogguy.org/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#622152; Package release.debian.org. (Mon, 21 Nov 2011 19:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adam D. Barratt" <adam@adam-barratt.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Mon, 21 Nov 2011 19:24:03 GMT) Full text and rfc822 format available.

Message #27 received at 622152@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
To: Mehdi Dogguy <mehdi@dogguy.org>
Cc: 622152@bugs.debian.org
Subject: Re: Bug#622152: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Mon, 21 Nov 2011 19:20:18 +0000
On Sun, 2011-11-20 at 12:51 +0100, Mehdi Dogguy wrote:
> On 11/20/2011 12:17 AM, Adam D. Barratt wrote:
> > On Thu, 2011-11-17 at 20:54 +0000, Adam D. Barratt wrote:
> >> On Sun, 2011-04-10 at 15:36 +0200, Mehdi Dogguy wrote:
> >>> It seems that britney2 segfaults at every run when compiled for Python
> >>> 2.6. After some quick investigation, the problem boils down to the
> >>> following:
> > [...]
> >> I've finally (!) got to looking at this but have been unable to
> >> reproduce the problem.  It might be a squeeze versus wheezy issue or
> >> some oddity which has resolved itself in the meantime, but after
> >> s/python2.5/python2.6/ in britney-py.c and rebuilding the library on
> >> franck, everything seems to just work[tm].
[...]
> maybe we should close the bug then? (it could be a temporary problem that
> got fixed somewhere since then…)

I was planning on running a py2.6 britney live for a couple of days and
seeing what happened first; what's the worst that could happen? :)

Switching to 2.6 would also get us some other advantages (along with
making DSA happy), like the nicer property decorator syntax.

> P.S.: I'll keep all packages infos next time :/

Thanks.

Regards,

Adam





Reply sent to "Adam D. Barratt" <adam@adam-barratt.org.uk>:
You have taken responsibility. (Sat, 26 Nov 2011 20:54:06 GMT) Full text and rfc822 format available.

Notification sent to Mehdi Dogguy <mehdi@debian.org>:
Bug acknowledged by developer. (Sat, 26 Nov 2011 20:54:06 GMT) Full text and rfc822 format available.

Message #32 received at 622152-done@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
To: 622152-done@bugs.debian.org
Cc: Mehdi Dogguy <mehdi@dogguy.org>
Subject: Re: Bug#622152: [britney2] Port to python2.6 (s/PyFoo_Check/PyFoo_CheckExact/)
Date: Sat, 26 Nov 2011 20:52:10 +0000
On Mon, 2011-11-21 at 19:20 +0000, Adam D. Barratt wrote:
> On Sun, 2011-11-20 at 12:51 +0100, Mehdi Dogguy wrote:
> > On 11/20/2011 12:17 AM, Adam D. Barratt wrote:
> > > On Thu, 2011-11-17 at 20:54 +0000, Adam D. Barratt wrote:
> > >> I've finally (!) got to looking at this but have been unable to
> > >> reproduce the problem.  It might be a squeeze versus wheezy issue or
> > >> some oddity which has resolved itself in the meantime, but after
> > >> s/python2.5/python2.6/ in britney-py.c and rebuilding the library on
> > >> franck, everything seems to just work[tm].
> [...]
> > maybe we should close the bug then? (it could be a temporary problem that
> > got fixed somewhere since then…)
> 
> I was planning on running a py2.6 britney live for a couple of days and
> seeing what happened first; what's the worst that could happen? :)

Well, it seems to have worked okay so far, so yeah let's close this.

Regards,

Adam





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 25 Dec 2011 07:34:52 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 20:04:21 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.