[Crash-utility] [PATCH] Do not pass through the 'sy' command to GDB

Lianbo Jiang lijiang at redhat.com
Wed Mar 17 13:32:59 UTC 2021


The 'sy' command may be misused, which is mistakenly considered as
the 'symbol-file' command in the crash utility, this will discard
symbol table from the current symbol file, and eventually caused the
failure of crash utility after executing the 'sys' command as below:

crash> sy
GNU_GET_DATATYPE[sy]: returned via gdb_error_hook
Discard symbol table from `/usr/lib/debug/usr/lib/modules/5.11.0-2.el9.x86_64/vmlinux'? (y or n) Please answer y or n.
Discard symbol table from `/usr/lib/debug/usr/lib/modules/5.11.0-2.el9.x86_64/vmlinux'? (y or n) No symbol file now.
crash> sys
GNU_GET_SYMBOL_TYPE: returned via gdb_error_hook
double free or corruption (!prev)
Aborted (core dumped)

Actually, the 'symbol-file' command has been added to the gdb-prohibited
list. To prevent current error, let's add the 'sy' command to the list
so that the crash utility does not pass the 'sy' command directly to GDB.

Signed-off-by: Lianbo Jiang <lijiang at redhat.com>
---
 gdb_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb_interface.c b/gdb_interface.c
index f4f4dd3993db..1f10006a2d63 100644
--- a/gdb_interface.c
+++ b/gdb_interface.c
@@ -702,7 +702,7 @@ static char *prohibited_list[] = {
 	"clear", "disable", "enable", "condition", "ignore", "frame", 
 	"select-frame", "f", "up", "down", "catch", "tcatch", "return",
 	"file", "exec-file", "core-file", "symbol-file", "load", "si", "ni", 
-	"shell", 
+	"shell", "sy",
 	NULL  /* must be last */
 };
 
-- 
2.29.2




More information about the Crash-utility mailing list