Bug 16940 - S390: 64-bit GDB can't debug multithreaded 31-bit inferior
Summary: S390: 64-bit GDB can't debug multithreaded 31-bit inferior
Alias: None
Product: gdb
Classification: Unclassified
Component: tdep (show other bugs)
Version: 7.7
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2014-05-13 13:59 UTC by Andreas Arnez
Modified: 2014-05-13 17:22 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Arnez 2014-05-13 13:59:56 UTC
When debugging a multithreaded 31-bit inferior (compiled with "gcc -m31 -lpthread), a 64-bit gdb usually crashes like this:

(gdb) run
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7d68cb80 (LWP 21445)]
warning: Can't attach LWP -844998064: No child processes
linux-thread-db.c:434: internal-error: thread_get_info_callback: Assertion `inout->thread_info != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 

This is caused by a bad offset in fill_gregset() since commit 2ccd146855365598ad2644ef8139f2f2a6747b90 (https://sourceware.org/ml/gdb-patches/2013-09/msg00355.html).

The same bug also causes failures with inferior function calls.
Comment 1 cvs-commit@gcc.gnu.org 2014-05-13 14:41:50 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.7-branch has been updated
       via  20dca09662aa0d2706fbe325b8f448ef74773028 (commit)
      from  ccbc6d2e1f4deed715c63b0652e988c69c94a31d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit 20dca09662aa0d2706fbe325b8f448ef74773028
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Tue May 13 14:55:53 2014 +0200

    PR target/16940 S390: Fix erroneous offset in fill_gregset.
    This fixes a bug that leads to various failures when debugging a
    31-bit inferior with a 64-bit gdb on s390x.


Summary of changes:
 gdb/ChangeLog        |    6 ++++++
 gdb/s390-linux-nat.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)
Comment 2 Andreas Arnez 2014-05-13 17:22:24 UTC
Fixed with this patch: