From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31178 invoked by alias); 7 Feb 2014 17:17:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31165 invoked by uid 89); 7 Feb 2014 17:17:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2014 17:17:06 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s17HH5Sb031976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 7 Feb 2014 12:17:05 -0500 Received: from host2.jankratochvil.net (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s17HH1fM009986 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 7 Feb 2014 12:17:04 -0500 Date: Fri, 07 Feb 2014 17:17:00 -0000 From: Jan Kratochvil To: Phil Muldoon Cc: gdb-patches@sourceware.org Subject: [patch] [python] Re: GDB crashing on gdb.python/py-linetable.exp Message-ID: <20140207171701.GA25187@host2.jankratochvil.net> References: <20140206213003.GA19756@host2.jankratochvil.net> <52F4B930.1020209@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <52F4B930.1020209@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00216.txt.bz2 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 759 On Fri, 07 Feb 2014 11:45:04 +0100, Phil Muldoon wrote: > I've tried most of the morning to reproduce this on Fedora 19, with > -lmcheck and after several thousand test runs I can't reproduce. Due to the requirement of specific stack layout I found it is reproducible for me on Fedora 20 x86_64 with (it sure could be reduced): CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic" LDFLAGS="-static-libstdc++ -static-libgcc -Wl,-z,relro" ./configure --with-system-readline;make (ulimit -c unlimited;/usr/bin/runtest gdb.python/py-linetable.exp) The fix is obvious, I will check it in. - int py_line; + gdb_py_longest py_line; [...] Regards, Jan --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=1 Content-length: 831 gdb/ 2014-02-07 Jan Kratochvil Fix Python stack corruption. * python/py-linetable.c (ltpy_get_pcs_for_line, ltpy_has_line): Use gdb_py_longest. diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c index e83d46d..8b5362b 100644 --- a/gdb/python/py-linetable.c +++ b/gdb/python/py-linetable.c @@ -168,7 +168,7 @@ static PyObject * ltpy_get_pcs_for_line (PyObject *self, PyObject *args) { struct symtab *symtab; - int py_line; + gdb_py_longest py_line; struct linetable_entry *best_entry = NULL; linetable_entry_object *result; VEC (CORE_ADDR) *pcs = NULL; @@ -200,7 +200,7 @@ static PyObject * ltpy_has_line (PyObject *self, PyObject *args) { struct symtab *symtab; - int py_line; + gdb_py_longest py_line; int index; LTPY_REQUIRE_VALID (self, symtab); --7AUc2qLy4jB3hD7Z--