From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26867 invoked by alias); 7 Jan 2015 17:57:11 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 26834 invoked by uid 48); 7 Jan 2015 17:57:10 -0000 From: "arnez at linux dot vnet.ibm.com" To: gdb-prs@sourceware.org Subject: [Bug corefiles/17808] 7.9 regression: internal-error: i386_supply_gregset: Assertion `len == tdep->sizeof_gregset' failed. Date: Wed, 07 Jan 2015 17:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: corefiles X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arnez at linux dot vnet.ibm.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00020.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17808 --- Comment #3 from Andreas Arnez --- 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 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.