Discussion:
[Bug python/23544] New: Segmentation fault when executing: python gdb.execute("interp mi '-break-list'")
ovparvu at microsoft dot com
2018-08-17 05:32:55 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23544

Bug ID: 23544
Summary: Segmentation fault when executing: python
gdb.execute("interp mi '-break-list'")
Product: gdb
Version: HEAD
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: ovparvu at microsoft dot com
Target Milestone: ---

For reproducibility purposes details about the host and the sequence of
executed commands is given below. As a side note gdb was compiled with python
support.

$ neofetch
.-/+oossssoo+/-. ***@pc
`:+ssssssssssssssssss+:` ---------------
-+ssssssssssssssssssyyssss+- OS: Ubuntu 18.04.1 LTS x86_64
.ossssssssssssssssssdMMMNysssso. Host: <Sanitized>
/ssssssssssshdmmNNmmyNMMMMhssssss/ Kernel: 4.15.0-30-generic
+ssssssssshmydMMMMMMMNddddyssssssss+ Uptime: <Sanitized>
/sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Packages: <Sanitized>
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Shell: bash 4.4.19
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ Resolution: <Sanitized>
ossyNMMMNyMMhsssssssssssssshmmmhssssssso DE: <Sanitized>
ossyNMMMNyMMhsssssssssssssshmmmhssssssso WM: <Sanitized>
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ WM Theme: <Sanitized>
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Theme: <Sanitized>
/sssssssshNMMMyhhyyyyhdNMMMNhssssssss/ Icons: <Sanitized>
+sssssssssdmydMMMMMMMMddddyssssssss+ Terminal: terminator
/ssssssssssshdmNNNNmyNMMMMhssssss/ CPU: <Sanitized>
.ossssssssssssssssssdMMMNysssso. GPU: <Sanitized>
-+sssssssssssssssssyyyssss+- GPU: <Sanitized>
`:+ssssssssssssssssss+:` Memory: <Sanitized>
.-/+oossssoo+/-.

$ <Sanitized>/gdb
GNU gdb (GDB) 8.2.50.20180816-git
Copyright (C) 2018 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".
(gdb) python gdb.execute("pwd")
Working directory /tmp.
(gdb) interp mi '-break-list'
^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb) python gdb.execute("interp mi '-break-list'")
Segmentation fault
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-17 17:06:35 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23544

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-08-17
CC| |tromey at sourceware dot org
Ever confirmed|0 |1

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Thanks.

It's easy to fix this, but I'm finding it challenging to write a
test case, because two gdb prompts are printed and gdb_test doesn't
like that:

(gdb) python gdb.execute("interp mi -break-list")
^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb) (gdb)
^^^^^^^^^^^ this is bad


I am not sure what's going on there yet.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-17 17:15:24 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23544

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The prompt seems to indicate some deeper problem, because with
my patch to avoid the crash, after the command gdb gets a bit
wedged -- I can't type to it.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-21 14:35:13 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23544

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
See bug #21388
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...