public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/27205] [-m32] FAIL: gdb.base/longjmp.exp: next over longjmp(1)
Date: Thu, 28 Jan 2021 09:59:46 +0000	[thread overview]
Message-ID: <bug-27205-4717-atvnCFBdfB@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27205-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27205

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a7f6487d0a2f9a5f16d0f67904ac35100313eb1

commit 2a7f6487d0a2f9a5f16d0f67904ac35100313eb1
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Jan 28 10:59:42 2021 +0100

    [gdb/breakpoints] Fix longjmp master breakpoint with separate debug info

    When running test-case gdb.base/longjmp.exp with target board unix/-m32, we
    run into:
    ...
    (gdb) next^M
    Warning:^M
    Cannot insert breakpoint 0.^M
    Cannot access memory at address 0x7dbf7353^M
    ^M
    __libc_siglongjmp (env=0x804a040 <env>, val=1) at longjmp.c:28^M
    28        longjmps++;^M
    (gdb) FAIL: gdb.base/longjmp.exp: next over longjmp(1)
    ...

    The failure to access memory happens in i386_get_longjmp_target and is due
to
    glibc having pointer encryption (aka "pointer mangling" or "pointer guard")
of
    the long jump buffer.  This is a known problem.

    In create_longjmp_master_breakpoint (which attempts to install a master
    longjmp breakpoint) a preference scheme is present, which installs a
    probe breakpoint if a libc:longjmp probe is present, and otherwise falls
back
    to setting breakpoints at the names in the longjmp_names array.

    But in fact, both the probe breakpoint and the longjmp_names breakpoints
are
    set.  The latter ones are set when processing libc.so.debug, and the former
    one when processing libc.so.  In other words, this is the longjmp variant
of
    PR26881, which describes the same problem for master exception breakpoints.

    This problem only triggers when the glibc debug info package is installed,
    which is not due to the debug info itself in libc.so.debug, but due to the
    minimal symbols (because create_longjmp_master_breakpoint uses minimal
symbols
    to translate the longjmp_names to addresses).

    The problem doesn't trigger for -m64, because there tdep->jb_pc_offset is
not
    set.

    Fix this similar to commit 1940319c0ef (the fix for PR26881): only install
    longjmp_names breakpoints in libc.so/libc.so.debug if installing the
    libc:longjmp probe in libc.so failed.

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-01-28  Tom de Vries  <tdevries@suse.de>

            PR breakpoints/27205
            * breakpoint.c (create_longjmp_master_breakpoint_probe)
            (create_longjmp_master_breakpoint_names): New function, factored
out
            of ...
            (create_longjmp_master_breakpoint): ... here.  Only try to install
            longjmp_names breakpoints in libc.so/libc.so.debug if installing
probe
            breakpoint in libc.so failed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-01-28  9:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 15:51 [Bug breakpoints/27205] New: " vries at gcc dot gnu.org
2021-01-23  6:38 ` [Bug breakpoints/27205] " vries at gcc dot gnu.org
2021-01-23  9:02 ` vries at gcc dot gnu.org
2021-01-23  9:30 ` vries at gcc dot gnu.org
2021-01-23  9:50 ` vries at gcc dot gnu.org
2021-01-27 14:31 ` vries at gcc dot gnu.org
2021-01-28  9:59 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-28 10:02 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27205-4717-atvnCFBdfB@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).