[Crash-utility] [PATCH v3 1/2] Update gdb to 10.1

lijiang lijiang at redhat.com
Mon Jan 25 06:04:46 UTC 2021


Hi, Kazu, Alexey

在 2021年01月16日 01:00, crash-utility-request at redhat.com 写道:
> Date: Fri, 15 Jan 2021 17:35:32 +0800
> From: lijiang <lijiang at redhat.com>
> To: crash-utility at redhat.com, crash-utility-request at redhat.com
> Subject: Re: [Crash-utility] [PATCH v3 1/2] Update gdb to 10.1
> Message-ID: <d3eaaa31-4a70-cc25-12e6-9e08181b93a3 at redhat.com>
> Content-Type: text/plain; charset=utf-8
> 
> Hi, Alexey
> 
> Sorry for the late reply. And also thank you for the update.
> 
> At present, I'm looking at this patchset, but I have to say that this is a big one,
> I will take some time to understand these changes and think more about this.
> 
> And I will provide feedback ASAP.
> 

After applied the v3 series based on the latest crash, I got the following error:

# crash vmlinux vmcore

crash 7.2.9++
Copyright (C) 2002-2020  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
Copyright (C) 2015, 2020  VMware, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
GNU gdb (GDB) 10.1
Copyright (C) 2020 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.
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 3.10.0-957.el7.x86_64/vmlinux...
thread.c:95: internal-error: thread_info* inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.

thread.c:95: internal-error: thread_info* inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Command aborted.
# 

We would make sure that the crash has good backward compatibility.

I didn't test the functions yet, there may be another issues. In view of this, I would suggest temporarily
putting the patch series in our reviewing queue, because this is a big change and need to handle it carefully.

Currently, I'm planning to improve the test cases. Once the test is ready, which can help us find out more
potential issues. And we can improve it based on this series. What do you think? Kazu, Bhupesh and Alexey.

Thanks.
Lianbo



> Thanks.
> Lianbo
> ? 2020?12?29? 18:06, crash-utility-request at redhat.com ??:
>> Date: Tue, 29 Dec 2020 02:06:08 -0800
>> From: Alexey Makhalov <amakhalov at vmware.com>
>> To: <crash-utility at redhat.com>, <k-hagio-ab at nec.com>
>> Subject: [Crash-utility] [PATCH v3 1/2] Update gdb to 10.1
>> Message-ID: <20201229100609.83147-2-amakhalov at vmware.com>
>> Content-Type: text/plain
>>
>> Fully redone gdb-7.6.patch to gdb-10.1.patch to keep all
>> functionality. Changes which were dropped are saved in
>> dropped-gdb-7.6-to-10.1.patch
>>
>> Main difference between gdb-7.6 and gdb-10.1 is the last
>> one was rewritten in C++.
>> I continue to keep crash code in C. Mark transition
>> functions as extern "C" to resolve linking issues.
>>
>> Eliminated error_hook() and SJLJ while running in C++ code
>> (after gdb_command_funnel()) use try-catch mechanism instead.
>>
>> request_types() was redone to do not call
>> GNU_GET_NEXT_DATATYPE multiple times but single usage of
>> GNU_ITERATE_DATATYPES with proper callback instead.
>> Complete iteration happens on C++ side now.
>> Removed "struct global_iterator" from request structure,
>> but added several fields (including callback pointer) to
>> be able to perform iteration on C++ side.
>>
>> Type of "linux_banner" symbol is reported as 'D' by new
>> gdb as its section ".rodata" marked as writable in vmlinux.
>>
>> BFD API has changed.
>>
>> deprecated_command_loop_hook got deprecated. So, call crash
>> main_loop() directly from gdb captured_main().
>>
>> Added symbol file (vmlinux) rebase in gdb by kaslr_offset.
>> by using new function: objfile_rebase().
>> As result, we do not need kernel symbol patching as well as
>> bait_and_switch hook anymore.
>>
>> Added crash_target for gdb to provide target operations
>> such as xfer_partial to read and write crash dump memory.
>> Removed previously used hooks for that in target.c.
>> Keep crash_target.c as a file in crash folder instead of
>> in gdb-10.1.patch for easier development and history
>> tracking.
>> crash_target can be enhanced in future to provide access
>> to CPU registers, so backtrace and frame related commands
>> from gdb can be used.
>>
>> Removed gdb-7.6-proc_service.h.patch is not required as
>> gdb-10.1 already has this change.
>>
>> Extra: add VMware copyright to the version info.
>>
>> TODO:
>> 1) gdb-10.1-ppc64le-support.patch has to be updated with
>> following commits.
>> 2) deprecate #if defined(GDB_X_Y) code as crash really
>> supports only the latest gdb (only one patch).
>> 3) move gdb_funnel_command() and subfunctions to separate
>> file, similar to crash_target.c
>> 4) remove legacy kernel patching and bait_and_switch hook.
>>
>> Signed-off-by: Alexey Makhalov <amakhalov at vmware.com>
>> ---
>>  Makefile                                           |   11 +-
>>  configure.c                                        |   20 +-
>>  crash_target.c                                     |  104 +
>>  defs.h                                             |   35 +-
>>  dropped-gdb-7.6-to-10.1.patch                      |  303 +++
>>  ...support.patch => gdb-10.1-ppc64le-support.patch |    0
>>  gdb-10.1.patch                                     | 1577 ++++++++++++
>>  gdb-7.6-proc_service.h.patch                       |   67 -
>>  gdb-7.6.patch                                      | 2503 --------------------
>>  gdb_interface.c                                    |   85 +-
>>  help.c                                             |    1 +
>>  kernel.c                                           |    2 +-
>>  main.c                                             |    1 -
>>  symbols.c                                          |  125 +-
>>  x86_64.c                                           |   14 +-
>>  15 files changed, 2141 insertions(+), 2707 deletions(-)
>>  create mode 100644 crash_target.c
>>  create mode 100644 dropped-gdb-7.6-to-10.1.patch
>>  rename gdb-7.6-ppc64le-support.patch => gdb-10.1-ppc64le-support.patch (100%)
>>  create mode 100644 gdb-10.1.patch
>>  delete mode 100644 gdb-7.6-proc_service.h.patch
>>  delete mode 100644 gdb-7.6.patch




More information about the Crash-utility mailing list