From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 377273858D38 for ; Wed, 22 Jul 2020 22:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 377273858D38 Received: by mail-qk1-x741.google.com with SMTP id l6so3649382qkc.6 for ; Wed, 22 Jul 2020 15:40:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=agOWeVL/rHT4l8R0+b6zMSoMoc8qlGLmmqi2OXS/b2k=; b=kPhfUbndEgOdvJkGHlknDC36KUFhReNxoDvGZEemxawZ9O9mBHrhCN+uOqOUqj7v00 BjpBtes3A+jePRGiNzSqbGemA8T3imX12W+jdvdRyvswE/4KQesDgF+4WWwFzktmVjh0 htvxnX6MgAtQvUjGR3M3ORR/pVEoaKD+zFEDEnZQxrK6jbCfYJumTM+fE7apnjLIg+BK z5LEZyBXmn3DapZTfHUco6v6A2fxMBdwOA0aw+xf4f/WatpspUEezFbNsMOmaIti3MmO EfPfDQJM9i+oeXBa6JbFfTl/PpknVcmxDpeNZi2TNWgxhqjMo8gWnHQIvv6rSeBuaFb0 pGog== X-Gm-Message-State: AOAM533ksw0B5ZR+aVkrNu1H9re7u9/R/UANRdB7+ndCHxHXCEReULS+ DbnAjvhz2jydlAt8t88XnrJLwnzmdM204Q== X-Google-Smtp-Source: ABdhPJxbSkovRJ/eIPvqEnHSuqVXliFvdKEqpBSnqELC5R38WLQpukO563V3HbPM23jKHOWXRCB8WQ== X-Received: by 2002:a05:620a:5a7:: with SMTP id q7mr2359834qkq.298.1595457621888; Wed, 22 Jul 2020 15:40:21 -0700 (PDT) Received: from ?IPv6:2804:7f0:8081:c421:b178:6df2:3cf0:48? ([2804:7f0:8081:c421:b178:6df2:3cf0:48]) by smtp.gmail.com with ESMTPSA id j52sm990544qtc.49.2020.07.22.15.40.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jul 2020 15:40:21 -0700 (PDT) Subject: Re: [PATCH v5 00/14] Fix BZ 25631 - core file memory access problem To: Kevin Buettner , gdb-patches@sourceware.org References: <20200722005832.863276-1-kevinb@redhat.com> From: Luis Machado Message-ID: <020d4060-b11c-d0d6-4d38-8d26ca07898b@linaro.org> Date: Wed, 22 Jul 2020 19:40:18 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200722005832.863276-1-kevinb@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 22:40:25 -0000 Hi, I'm seeing the following regressions on AArch64 Linux running Ubuntu 18.04 (GCC 7). FAIL: gdb.base/corefile.exp: backtrace in corefile.exp FAIL: gdb.base/corefile.exp: core-file warning-free FAIL: gdb.base/corefile.exp: print func2::coremaker_local FAIL: gdb.base/corefile.exp: up in corefile.exp FAIL: gdb.base/corefile.exp: up in corefile.exp (reinit) On a quick look, the test doesn't go according to what is expected. -- (gdb) PASS: gdb.base/corefile.exp: print coremaker_ro print func2::coremaker_local^M No frame is currently executing in block func2.^M (gdb) FAIL: gdb.base/corefile.exp: print func2::coremaker_local ... (gdb) PASS: gdb.base/corefile.exp: $_exitcode is void bt^M #0 0x0000ffff80d1c4d8 in raise () from /lib/aarch64-linux-gnu/libc.so.6^M Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M (gdb) FAIL: gdb.base/corefile.exp: backtrace in corefile.exp up^M Initial frame selected; you cannot go up.^M (gdb) FAIL: gdb.base/corefile.exp: up in corefile.exp ... (gdb) file gdb/testsuite/outputs/gdb.base/corefile/corefile^M Load new symbol table from "gdb/testsuite/outputs/gdb.base/corefile/corefile"? (y or n) y^M Reading symbols from gdb/testsuite/outputs/gdb.base/corefile/corefile...^M (gdb) up^M Initial frame selected; you cannot go up.^M (gdb) FAIL: gdb.base/corefile.exp: up in corefile.exp (reinit) -- On 7/21/20 9:58 PM, Kevin Buettner via Gdb-patches wrote: > This series fixes several core file related bugs. The bug which > started this work can be viewed here: > > https://sourceware.org/bugzilla/show_bug.cgi?id=25631 > > Other problems were found either during review or during development. > I discuss these in my commit log remarks. > > This v5 series has only minor changes from v4. Unless noted > otherwise, these changes all address Pedro's concerns: > > o Patch #5, Test ability to access unwritten-to mmap data in core file: > > - Add setup_xfail for non-Linux OSes. (I spotted this while testing > on FreeBSD.) > > o Patch #8, Use NT_FILE note section for reading core target memory: > > - Formatting fixes. > - Close bfd after failed bfd_check_format_check. > - Fix SECNAME leak. > > o Patch #11, Adjust coredump-filter.exp to account for NT_FILE note handling: > > - Instead of XFAILing test, use Mihails Strasuns's suggestion > instead. > > o Patch #12, Add new command "maint print core-file-backed-mappings": > > - Formatting fixes. > - Don't crash GDB with gdb_assert(). > - Add comments (in both code and commit log) regarding utility > of this new command. > > o Patch #14, New core file tests with mappings over existing program memory: > > - Formatting fixes. > - Add another "maint print core-file-backed-mappings" test requested > by Pedro in patch #12 review. This one makes sure that we don't > crash GDB when NOT debugging a core file. > > I believe that all patches not listed above have been approved. > Actually, I think that #5 is still approved too; I doubt that adding > an XFAIL changes that. > > Kevin Buettner (14): > Remove hack for GDB which sets the section size to 0 > Adjust corefile.exp test to show regression after bfd hack removal > section_table_xfer_memory: Replace section name with callback > predicate > Provide access to non SEC_HAS_CONTENTS core file sections > Test ability to access unwritten-to mmap data in core file > Update binary_get_section_contents to seek using section's file > position > Add new gdbarch method, read_core_file_mappings > Use NT_FILE note section for reading core target memory > Add test for accessing read-only mmapped data in a core file > gcore command: Place all file-backed mappings in NT_FILE note > Adjust coredump-filter.exp to account for NT_FILE note handling > Add new command "maint print core-file-backed-mappings" > Add documentation for "maint print core-file-backed-mappings" > New core file tests with mappings over existing program memory > > bfd/binary.c | 12 +- > bfd/elf.c | 8 - > gdb/NEWS | 4 + > gdb/arch-utils.c | 16 ++ > gdb/arch-utils.h | 12 + > gdb/bfd-target.c | 3 +- > gdb/corelow.c | 264 ++++++++++++++++++++- > gdb/doc/gdb.texinfo | 8 + > gdb/exec.c | 8 +- > gdb/exec.h | 13 +- > gdb/gdbarch.c | 23 ++ > gdb/gdbarch.h | 6 + > gdb/gdbarch.sh | 3 + > gdb/linux-tdep.c | 244 +++++++++++++------ > gdb/target.c | 18 +- > gdb/testsuite/gdb.base/coredump-filter.exp | 18 +- > gdb/testsuite/gdb.base/corefile.exp | 27 ++- > gdb/testsuite/gdb.base/corefile2.exp | 185 +++++++++++++++ > gdb/testsuite/gdb.base/coremaker.c | 30 ++- > gdb/testsuite/gdb.base/coremaker2.c | 150 ++++++++++++ > 20 files changed, 942 insertions(+), 110 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/corefile2.exp > create mode 100644 gdb/testsuite/gdb.base/coremaker2.c >