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 #3 from Andreas Arnez <arnez at linux dot vnet.ibm.com> ---
It seems that the core file is supposed to look as if from an i386
program, but its PRSTATUS looks like from amd64.  Consequently even an
old GDB complains that the general-purpose registers are not
recognized:

(gdb) core-file i386-biarch-core.core 
[New Thread 6901]
warning: Couldn't recognize general-purpose registers in core file.
Core was generated by `./bad'.
Program terminated with signal 11, Segmentation fault.
warning: Couldn't recognize general-purpose registers in core file.
#0  0x00000000 in ?? ()
(gdb) 

After commit 8f0435f75e the warning is skipped and we directly run
into the assertion in i386_supply_gregset instead.

An easy "fix" would be to replace the assertion by something like
this:

  if (len != tdep->sizeof_gregset)
    return;

With that change, the test case succeeds.  However, the registers are
then all <unavailable> without a user-visible explanation why.

I'm not sure how GDB should really behave in this case:

(a) Warn about the section size mismatch?

(b) Interpret the section as a usual i386 PRSTATUS and ignore all
    excess bytes?

(c) Recognize the section as an amd64 PRSTATUS and fill the register
    cache appropriately?

Also, is there a particular reason for using such a "corrupted" core
file?  Or am I misunderstanding something?  And could the test case be
brought upstream as well?

-- 
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]