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 symtab/18392] ../../gdb/dwarf2loc.c:834: internal-error: chain_candidate: Assertion `result->callers + result->callees < result->length' failed
Date: Mon, 01 Jun 2015 12:05:00 -0000	[thread overview]
Message-ID: <bug-18392-4717-7EqJJtcSC2@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18392-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

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

commit e0619de699ae6e86d8b93fa96a7668aef2e9636a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Jun 1 14:02:34 2015 +0200

    PR symtab/18392

    Initially there is some chain (let's say the longest one
    but that doe snot matter).  Consequently its elements from the middle are
    being removed and there remains only some few unambiguous top and bottom
ones.

    The original idea why the comparison should be sharp ("<") was that if
there
    are multiple chains like (0xaddr show jmp instruction address):
            main(0x100) -> a(0x200) -> d(0x400)
            main(0x100) -> a(0x200) -> c(0x300) -> d(0x400)
    then - such situation cannot exist - if two jmp instructions in "a" have
the
    same address they must also jump to the same address (*).

    (*) jump to a computed address would be never considered for the DWARF
        tail-call records.

    So there could be:
            main(0x100) -> a(0x200) -> d(0x400)
            main(0x100) -> a(0x270) -> c(0x300) -> d(0x400)
    But then "a" frame itself is ambiguous and it must not be displayed.

    I did not realize that there can be self-tail-call:
            main(0x100) -> a(0x200) -> d(0x400)
            main(0x100) -> a(0x280) -> a(0x200) -> d(0x400)
    which intersects to:
            main(0x100) -> <???>? -> a(0x200) -> d(0x400)
    And so if the first chain was chosen the
            main(0x100) -> a(0x200) -> d(0x400)
    then the final intersection has callers+callees==length.

    > for example, if CALLERS is 3 and
    > CALLEES is 2, what does the chain look like?

    main(0x100) -> x(0x150) -> y(0x200) -> <???>? -> a(0x200) -> d(0x400)

    And if LENGTH is 7 then:
            call_site[0] = main(0x100)
            call_site[1] = x(0x150)
            call_site[2] = y(0x200)
            call_site[3] = garbage
            call_site[4] = garbage
            call_site[5] = a(0x200)
            call_site[6] = d(0x400)

    gdb/ChangeLog
    2015-06-01  Andreas Schwab  <schwab@linux-m68k.org>
            Jan Kratochvil  <jan.kratochvil@redhat.com>

        PR symtab/18392
        * dwarf2-frame-tailcall.c (pretended_chain_levels): Correct
        assertion.
        * dwarf2loc.c (chain_candidate): Likewise.

    gdb/testsuite/ChangeLog
    2015-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>

        PR symtab/18392
        * gdb.arch/amd64-tailcall-self.S: New file.
        * gdb.arch/amd64-tailcall-self.c: New file.
        * gdb.arch/amd64-tailcall-self.exp: New file.

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


  reply	other threads:[~2015-06-01 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09 16:29 [Bug symtab/18392] New: " schwab@linux-m68k.org
2015-06-01 12:05 ` cvs-commit at gcc dot gnu.org [this message]
2015-06-01 12:08 ` [Bug symtab/18392] " jan.kratochvil at redhat dot com

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-18392-4717-7EqJJtcSC2@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).