public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
@ 2015-09-20 22:40 noloader at gmail dot com
  2015-09-20 22:53 ` [Bug gdb/18987] " noloader at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2015-09-20 22:40 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18987
           Summary: GDB 7.10 cannot debug programs under X32
                    (internal-error: find_new_threads_once...)
           Product: gdb
           Version: 7.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: noloader at gmail dot com
  Target Milestone: ---

We received a few bug reports from a Debian maintainer who was testing our
software under Debian's X32 chroot environment. Related, see Debian's X32 Port
page at https://wiki.debian.org/X32Port.

Using Debian's X32 port of GDB 7.10 resulted in:

    (gdb) r
    Starting program: .../cryptest.exe
    warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER: Input/output
error
     /build/gdb-gaG2aU/gdb-7.10/gdb/linux-thread-db.c:1675: internal-error:
    find_new_threads_once: Assertion `!target_has_execution ||
    thread_db_use_events ()' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

The issue was duplicated with a fresh download and build of GDB 7.10.

It appears the issue is with `gdb/linux-thread-db.c`, and the assert placed
around line 1675:

    /* See comment in thread_db_update_thread_list.  */
    gdb_assert (!target_has_execution || thread_db_use_events ());

After reading the appropriate comments, its readily apparent (to me) that I'm
not really qualified to hack GDB. However, I needed to get our gear under the
debugger, so:

    #if !defined(__ILP32__) && !defined(_ILP32)
      /* See comment in thread_db_update_thread_list.  */
      gdb_assert (!target_has_execution || thread_db_use_events ());
    #endif

It worked like a charm, and I was able to get our gear running under GDB.

We used `__ILP32__` and `_ILP32` because:

    # cpp -dM < /dev/null | egrep "(ILP|i386|i686|x86_64|amd64|LP64)"
    #define __x86_64 1
    #define __amd64 1
    #define __x86_64__ 1
    #define __ILP32__ 1
    #define _ILP32 1
    #define __amd64__ 1

Finally, Debian's bug report on the GDB 7.10 issue can be found at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799556.

My apologies for two bug reports. According to the Debian wiki page, Debian
wants the bug reports too (https://www.debian.org/Bugs/Reporting). (I probably
jumped the gun by not allowing the Debian folks to file this).

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
@ 2015-09-20 22:53 ` noloader at gmail dot com
  2015-09-21  8:35 ` palves at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2015-09-20 22:53 UTC (permalink / raw)
  To: gdb-prs

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

Jeffrey Walton <noloader at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |noloader at gmail dot com

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
  2015-09-20 22:53 ` [Bug gdb/18987] " noloader at gmail dot com
@ 2015-09-21  8:35 ` palves at redhat dot com
  2015-09-21 23:24 ` noloader at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: palves at redhat dot com @ 2015-09-21  8:35 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
I believe this is fixed in master (commit e0fd7c47bd):

 https://sourceware.org/ml/gdb-patches/2015-08/msg00762.html

Could you give that a try?

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
  2015-09-20 22:53 ` [Bug gdb/18987] " noloader at gmail dot com
  2015-09-21  8:35 ` palves at redhat dot com
@ 2015-09-21 23:24 ` noloader at gmail dot com
  2015-09-22  8:31 ` palves at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2015-09-21 23:24 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Jeffrey Walton <noloader at gmail dot com> ---
(In reply to Pedro Alves from comment #1)
> I believe this is fixed in master (commit e0fd7c47bd):
> 
>  https://sourceware.org/ml/gdb-patches/2015-08/msg00762.html
> 
> Could you give that a try?

Yes sir. From a Debian chroot for X32 (https://wiki.debian.org/X32Port):

  git clone git://sourceware.org/git/binutils-gdb.git gdb-git
  ...
  cd gdb-git

Then

  # ./configure --target=x32-linux
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking target system type... Invalid configuration `x32-linux': machine
`x32' not recognized

Retry:

  # ./configure
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking target system type... x86_64-pc-linux-gnu
  ...
  make[2]: Entering directory '/home/gdb-git/libiberty'
  ...
  make[2]: Entering directory '/home/gdb-git/zlib'
  ...
  make[2]: Entering directory '/home/gdb-git/bfd'
  creating bfdver.h
  rm -f elf32-target.h
  ...
  .../gdb-git/missing: 81: /home/gdb-git/missing: makeinfo: not found
  WARNING: 'makeinfo' is missing on your system.

Yep, no makeinfo for this platform, and no apparent configure option to disable
it:

  # ./configure --help | egrep -i "(info|doc)"
    -V, --version           display version information and exit
    --infodir=DIR           info documentation [DATAROOTDIR/info]
    --mandir=DIR            man documentation [DATAROOTDIR/man]
    --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
    --htmldir=DIR           html documentation [DOCDIR]
    --dvidir=DIR            dvi documentation [DOCDIR]
    --pdfdir=DIR            pdf documentation [DOCDIR]
    --psdir=DIR             ps documentation [DOCDIR]
                            map A to B, C to D ... in debug information

Continuing with build:

  Makefile:443: recipe for target 'bfd.info' failed
  make[3]: *** [bfd.info] Error 127
  ...
  Makefile:1673: recipe for target 'info-recursive' failed
  make[2]: *** [info-recursive] Error 1
  ..
  Makefile:2712: recipe for target 'all-bfd' failed
  make[1]: *** [all-bfd] Error 2
  ...
  Makefile:845: recipe for target 'all' failed
  make: *** [all] Error 2

The complete log is available at
https://www.cryptopp.com/drop/gdb-config.log.zip.

Any suggestions to proceed? I'm not really concerned about the docs; rather I
need the debugger.

**********

And one other note... A dirty compile for getruntime.c under X32:

gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I./../include  -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE ./getruntime.c -o
getruntime.o
./getruntime.c: In function ‘get_run_time’:
./getruntime.c:98:14: warning: enum conversion when passing argument 1 of
‘getrusage’ is invalid in C++ [-Wc++-compat]
   getrusage (0, &rusage);
              ^
In file included from ./getruntime.c:47:0:
/usr/include/x86_64-linux-gnux32/sys/resource.h:87:12: note: expected
‘__rusage_who_t {aka enum __rusage_who}’ but argument is of type ‘int’
 extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
            ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From gdb-prs-return-18630-listarch-gdb-prs=sources.redhat.com@sourceware.org Tue Sep 22 01:12:06 2015
Return-Path: <gdb-prs-return-18630-listarch-gdb-prs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-prs@sources.redhat.com
Received: (qmail 36491 invoked by alias); 22 Sep 2015 01:12:06 -0000
Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <gdb-prs.sourceware.org>
List-Subscribe: <mailto:gdb-prs-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb-prs/>
List-Post: <mailto:gdb-prs@sourceware.org>
List-Help: <mailto:gdb-prs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: gdb-prs-owner@sourceware.org
Delivered-To: mailing list gdb-prs@sourceware.org
Received: (qmail 36400 invoked by uid 48); 22 Sep 2015 01:12:05 -0000
From: "noloader at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/18987] GDB 7.10 cannot debug programs under X32
 (internal-error: find_new_threads_once...)
Date: Tue, 22 Sep 2015 01:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gdb
X-Bugzilla-Component: gdb
X-Bugzilla-Version: 7.10
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: noloader at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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: <bug-18987-4717-QxZv04FlGc@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-18987-4717@http.sourceware.org/bugzilla/>
References: <bug-18987-4717@http.sourceware.org/bugzilla/>
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-q3/txt/msg00334.txt.bz2
Content-length: 498

https://sourceware.org/bugzilla/show_bug.cgi?id\x18987

--- Comment #3 from Jeffrey Walton <noloader at gmail dot com> ---

> The complete log is available at
> https://www.cryptopp.com/drop/gdb-config.log.zip.
>

I uploaded a new log. It should be more complete. The new log is the result of:

   ./configure 2>&1 | tee gdb-config.log
   ./make 2>&1 | tee -a gdb-config.log

The log was fairly boring without the tee.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
                   ` (2 preceding siblings ...)
  2015-09-21 23:24 ` noloader at gmail dot com
@ 2015-09-22  8:31 ` palves at redhat dot com
  2015-09-22 16:47 ` noloader at gmail dot com
  2015-09-22 20:36 ` sergiodj at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: palves at redhat dot com @ 2015-09-22  8:31 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
'configure MAKEINFO=true' is the standard workaround.  I don't know about the
other issues -- it sounds like x32 needs local patches that may be missing
upstream.  Those are orthogonal issues though, best moved to separate bugs.

Could you try whether applying the patch I pointed at (e0fd7c47bd) on the 7.10
branch fixes the internal error?

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
                   ` (3 preceding siblings ...)
  2015-09-22  8:31 ` palves at redhat dot com
@ 2015-09-22 16:47 ` noloader at gmail dot com
  2015-09-22 20:36 ` sergiodj at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2015-09-22 16:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Jeffrey Walton <noloader at gmail dot com> ---
(In reply to Pedro Alves from comment #4)
> 'configure MAKEINFO=true' is the standard workaround.  

Thanks.

> Could you try whether applying the patch I pointed at (e0fd7c47bd) on the
> 7.10 branch fixes the internal error?

No joy. Git is getting in the way while trying to follow
https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset:

    # git fetch origin e0fd7c47bdfatal: Couldn't find remote ref e0fd7c47bd

Sorry about the extra grief.

We might as well close this report since it appears to be fixed.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/18987] GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...)
  2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
                   ` (4 preceding siblings ...)
  2015-09-22 16:47 ` noloader at gmail dot com
@ 2015-09-22 20:36 ` sergiodj at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: sergiodj at redhat dot com @ 2015-09-22 20:36 UTC (permalink / raw)
  To: gdb-prs

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

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sergiodj at redhat dot com

--- Comment #6 from Sergio Durigan Junior <sergiodj at redhat dot com> ---
(In reply to Jeffrey Walton from comment #5)
> > Could you try whether applying the patch I pointed at (e0fd7c47bd) on the
> > 7.10 branch fixes the internal error?
> 
> No joy. Git is getting in the way while trying to follow
> https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-
> specific-revision-changeset:
> 
>     # git fetch origin e0fd7c47bdfatal: Couldn't find remote ref e0fd7c47bd

Jeffrey,

You can clone the upstream git repository normally:

#> git clone git://sourceware.org/git/binutils-gdb.git

Then switch to the 7.10 branch:

#> git checkout gdb-7.10-branch

After that, you can apply the patch mentioned by Pedro.  There are many ways to
do that; for example:

#> git show e0fd7c47bd | git apply --exclude='*ChangeLog*'

This command should reduce the number of conflicts you get because of the
ChangeLog files; however, be aware because you may still see conflicts.

After that, you can finally perform the compilation on your machine (using the
MAKEINFO=true trick that Pedro mentioned).

> We might as well close this report since it appears to be fixed.

It is important to make sure that the issue has been fixed upstream.  Once we
know that, we can close this report.

Since you are using Debian, you may want to perform a "apt-get build-dep gdb"
in order to fetch the necessary packages to build GDB.  That should make things
easier.

Thanks.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-22 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-20 22:40 [Bug gdb/18987] New: GDB 7.10 cannot debug programs under X32 (internal-error: find_new_threads_once...) noloader at gmail dot com
2015-09-20 22:53 ` [Bug gdb/18987] " noloader at gmail dot com
2015-09-21  8:35 ` palves at redhat dot com
2015-09-21 23:24 ` noloader at gmail dot com
2015-09-22  8:31 ` palves at redhat dot com
2015-09-22 16:47 ` noloader at gmail dot com
2015-09-22 20:36 ` sergiodj at redhat dot com

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).