gdb/gdb-python-stacksmash.patch
Jan Kratochvil 2c55a5441d Rebase to FSF GDB 7.7.
- New rpmbuild option: --with asan
2014-02-07 19:38:14 +01:00

66 lines
1.9 KiB
Diff

http://sourceware.org/ml/gdb-patches/2014-02/msg00216.html
Subject: [patch] [python] Re: GDB crashing on gdb.python/py-linetable.exp
--7AUc2qLy4jB3hD7Z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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
gdb/
2014-02-07 Jan Kratochvil <jan.kratochvil@redhat.com>
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--