FS#64681 - [gcc] gdb SyntaxWarning

Attached to Project: Arch Linux
Opened by Vanda Hendrychova (vanda) - Friday, 29 November 2019, 12:02 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
gdb shows a python SyntaxWarning when trying to run a program.
The problem only occurs when using g++, not gcc.

Demo:
~ gdb a.out
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...
(gdb) r
Starting program: /home/vanda/a.out
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
refcounts = ['_M_refcount']['_M_pi']
[Inferior 1 (process 154956) exited normally]


Additional info:
There's a bug report on Redhat Bugzilla already. I am just wondering why it has not been fixed in archlinux yet. (https://bugzilla.redhat.com/show_bug.cgi?id=1749578)


Steps to reproduce:
1) $ g++ hello.cpp -ggdb
2) $ gdb a.out
3) (gdb) r
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Monday, 11 May 2020, 07:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  10.1.0-1
Comment by loqs (loqs) - Friday, 29 November 2019, 18:57 GMT Comment by Cedric Bellegarde (gnumdk) - Tuesday, 28 January 2020, 17:05 GMT
Not fixed in ArchLinux, got many crash in WebKitGTK due to this bug:

Program terminated with signal SIGABRT, Aborted.
#0 0x00007f026ef8ff25 in raise () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f017e82e700 (LWP 23925))]
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
refcounts = ['_M_refcount']['_M_pi']
(gdb)
Comment by loqs (loqs) - Tuesday, 28 January 2020, 17:18 GMT Comment by Cedric Bellegarde (gnumdk) - Tuesday, 28 January 2020, 17:28 GMT
It does not crash on Fedora 31 (using a Fedora only release 9.2.1, WTF) so yes, it fixes the crash.
Comment by Cedric Bellegarde (gnumdk) - Tuesday, 28 January 2020, 17:36 GMT
Ok, just flagged gcc, 9.2.1 is in Debian and Ubuntu too.
Comment by loqs (loqs) - Tuesday, 28 January 2020, 18:42 GMT
@gnumdk comparing gcc-9.2.1-20190827.tar.xz from from Fedora gcc 9.2.1-2 to gcc-9.2.0.tar.xz from Arch gcc 9.2.0-4.
I am not seeing https://github.com/gcc-mirror/gcc/commit/14c154f9534b17d548a79dc3b13c0680ac2c4d96 as applied
So if the fedora package fixed your issue it would appear be a different issue with a different fix.
Comment by Cedric Bellegarde (gnumdk) - Tuesday, 28 January 2020, 20:19 GMT
You are right, this bug is not related to my issue. I have a crash in WebKitGTK and gdb is failing to load backtrace with this error.

BTW, I'm sure https://github.com/gcc-mirror/gcc/commit/14c154f9534b17d548a79dc3b13c0680ac2c4d96 is fixing this issue because of the log message from GDB. The syntax error exists in xmethods.py and the patch is fixing it. Looks like it makes gdb unable to load any information from C++ backtrace.

Loading...