Message ID | 56C8A021.1000800@ubuntu.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 127672 invoked by alias); 20 Feb 2016 17:19:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 127660 invoked by uid 89); 20 Feb 2016 17:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*Ad:D*ubuntu.com, H*r:Debian-4, H*Ad:U*doko, sk:py-fram X-HELO: einhorn.in-berlin.de Received: from einhorn.in-berlin.de (HELO einhorn.in-berlin.de) (192.109.42.8) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 20 Feb 2016 17:19:34 +0000 X-Envelope-From: doko@ubuntu.com Received: from [192.168.178.29] (ip5f5bd515.dynamic.kabel-deutschland.de [95.91.213.21]) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-4) with ESMTP id u1KHJUYk010120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 20 Feb 2016 18:19:30 +0100 To: gdb-patches@sourceware.org Cc: Sebastien Bacher <seb128@ubuntu.com>, Julian Taylor <jtaylor.debian@googlemail.com> From: Matthias Klose <doko@ubuntu.com> Subject: [patch] fix OverflowError in backtraces with 32bit kernels Message-ID: <56C8A021.1000800@ubuntu.com> Date: Sat, 20 Feb 2016 18:19:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit |
Commit Message
Matthias Klose
Feb. 20, 2016, 5:19 p.m. UTC
This was reported at https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1513922 That's using i386, using "backtrace" gives those errors "Traceback (most recent call last): File "/usr/share/gdb/python/gdb/FrameDecorator.py", line 97, in function if not isinstance(self._base, gdb.Frame): SystemError: <built-in function isinstance> returned a result with an error set #1 0xffffffff in OverflowError: Python int too large to convert to C long" and a patch was suggested by Julian Taylor, which applies to the trunk as well. Matthias
Comments
On 02/20/2016 05:19 PM, Matthias Klose wrote: > This was reported at > https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1513922 > > That's using i386, using "backtrace" gives those errors > > "Traceback (most recent call last): > File "/usr/share/gdb/python/gdb/FrameDecorator.py", line 97, in function > if not isinstance(self._base, gdb.Frame): > SystemError: <built-in function isinstance> returned a result with an > error set > > #1 0xffffffff in OverflowError: Python int too large to convert to C long" > > and a patch was suggested by Julian Taylor, which applies to the trunk > as well. > > Matthias Looks like this was never reviewed, sorry about that. Looks good to me. OK with a ChangeLog entry. I wonder whether we should be using get_addr_from_python here and in the other spot in the file we read an address though: else if (PyLong_Check (py_func)) { CORE_ADDR addr = PyLong_AsUnsignedLongLong (py_func); struct bound_minimal_symbol msymbol; > --- gdb-7.10.orig/gdb/python/py-framefilter.c > +++ gdb-7.10/gdb/python/py-framefilter.c > @@ -1111,7 +1111,7 @@ py_print_frame (PyObject *filter, int fl > > if (paddr != Py_None) > { > - address = PyLong_AsLong (paddr); > + address = PyLong_AsUnsignedLongLong (paddr); > has_addr = 1; > } > Py_DECREF (paddr); Thanks, Pedro Alves
On Tue, Oct 4, 2016 at 3:24 PM, Pedro Alves <palves@redhat.com> wrote: > On 02/20/2016 05:19 PM, Matthias Klose wrote: >> This was reported at >> https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1513922 >> >> That's using i386, using "backtrace" gives those errors >> >> "Traceback (most recent call last): >> File "/usr/share/gdb/python/gdb/FrameDecorator.py", line 97, in function >> if not isinstance(self._base, gdb.Frame): >> SystemError: <built-in function isinstance> returned a result with an >> error set >> >> #1 0xffffffff in OverflowError: Python int too large to convert to C long" >> >> and a patch was suggested by Julian Taylor, which applies to the trunk >> as well. >> >> Matthias > > Looks like this was never reviewed, sorry about that. > > Looks good to me. OK with a ChangeLog entry. > We need this fix in 7.12 branch too.
--- gdb-7.10.orig/gdb/python/py-framefilter.c +++ gdb-7.10/gdb/python/py-framefilter.c @@ -1111,7 +1111,7 @@ py_print_frame (PyObject *filter, int fl if (paddr != Py_None) { - address = PyLong_AsLong (paddr); + address = PyLong_AsUnsignedLongLong (paddr); has_addr = 1; } Py_DECREF (paddr);