This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/17808] 7.9 regression: internal-error: i386_supply_gregset: Assertion `len == tdep->sizeof_gregset' failed.


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

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-7.9-branch branch has been updated by Joel Brobecker
<brobecke@sourceware.org>:

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

commit 3b7a39661610038aad32563069b10fb2cfc55fab
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Wed Jan 14 12:01:38 2015 +0000

    Fix internal error when core file section is too big

    As reported in PR 17808, a test case with a forged (invalid) core file
    can crash GDB with an assertion failure.  In that particular case the
    prstatus of an i386 core file looks like that from an AMD64 core file.
    Consequently the respective regset supply function i386_supply_gregset
    is invoked with a larger buffer than usual.  But i386_supply_gregset
    asserts a specific buffer size, and this assertion fails.

    The patch relaxes all buffer size assertions in regset supply
    functions such that they merely check for a sufficiently large buffer.
    For consistency the regset collect functions are adjusted as well.

    gdb/ChangeLog:

        PR corefiles/17808:
        * gdbarch.sh (iterate_over_regset_sections_cb): Document this
        function type, particularly its SIZE parameter.
        * gdbarch.h: Regenerate.
        * amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare
        actual against required size using ">=" instead of "==".
        (amd64_collect_fpregset): Likewise.
        * i386-tdep.c (i386_supply_gregset): Likewise.
        (i386_collect_gregset): Likewise.
        (i386_supply_fpregset): Likewise.
        (i386_collect_fpregset): Likewise.
        * mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise.
        (mips_fill_gregset_wrapper): Likewise.
        (mips_supply_fpregset_wrapper): Likewise.
        (mips_fill_fpregset_wrapper): Likewise.
        (mips64_supply_gregset_wrapper): Likewise.
        (mips64_fill_gregset_wrapper): Likewise.
        (mips64_supply_fpregset_wrapper): Likewise.
        (mips64_fill_fpregset_wrapper): Likewise.
        * mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise.
        (am33_supply_fpregset_method): Likewise.
        (am33_collect_gregset_method): Likewise.
        (am33_collect_fpregset_method): Likewise.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]