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+/-. user@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
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.
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.
See bug #21388
This appears to have been introduced in gdb 8.2. Previous gdb versions (I've tested 7.12.1, 8.0.1, and 8.1.1) hit the bad CLI behaviour of bug #21388, but not a segfault. And it's not just 'interp mi -break-list' that triggers the segfault/CLI badness, but any interp/interpreter-exec command.
Looks like it's fixed since at least gdb 10.1, maybe someone else knows the details?
Seems to be fixed.