public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
@ 2014-09-16 13:13 jerome.gardou at reactos dot org
  2015-02-26 19:44 ` [Bug remote/17397] " jerome.gardou at reactos dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2014-09-16 13:13 UTC (permalink / raw)
  To: gdb-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4005 bytes --]

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

            Bug ID: 17397
           Summary: i686-w64-mingw32 remote multiprocess debugging:
                    thread.c:1002: internal-error: switch_to_thread:
                    Assertion `inf != NULL' failed.
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: jerome.gardou at reactos dot org

Created attachment 7788
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7788&action=edit
Relevant GDB log.

Hello,

I am developing an homebrew gdb stub for ReactOS. Code can be found here:
http://git.reactos.org/?p=reactos.git;a=tree;f=reactos/drivers/base/kdgdb

As this is a kernel debugger, it is per se a multiprocess environment, and
advertised as such at connection time with GDB.

info thread triggers the following assert:
thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL'
failed.

Attached is the relevant log with "debug remote" set to 1 and the core dump at
the time the failed assertion is raised.

To reduce noise, I didn't load any symbol files when producing the log.
(results are similar with them).

GDB 7.8 was compiled from source with ./configure --target=i686-w64-mingw32
--with-expat

I am ready and willing to give further details on this issue, as it hinders
further use of GDB in this environment.

Best regards
Jérôme

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From gdb-prs-return-16619-listarch-gdb-prs=sources.redhat.com@sourceware.org Tue Sep 16 13:14:51 2014
Return-Path: <gdb-prs-return-16619-listarch-gdb-prs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-prs@sources.redhat.com
Received: (qmail 29887 invoked by alias); 16 Sep 2014 13:14:51 -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 29865 invoked by uid 48); 16 Sep 2014 13:14:50 -0000
From: "jerome.gardou at reactos dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging:
 thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL'
 failed.
Date: Tue, 16 Sep 2014 13:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gdb
X-Bugzilla-Component: remote
X-Bugzilla-Version: 7.8
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jerome.gardou at reactos dot org
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: attachments.created
Message-ID: <bug-17397-4717-x2LVnCpLQC@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-17397-4717@http.sourceware.org/bugzilla/>
References: <bug-17397-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: 2014-q3/txt/msg00608.txt.bz2
Content-length: 324

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

--- Comment #1 from jerome.gardou at reactos dot org ---
Created attachment 7789
  --> https://sourceware.org/bugzilla/attachment.cgi?idw89&actioníit
Core dump at the time of the crash.

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
@ 2015-02-26 19:44 ` jerome.gardou at reactos dot org
  2015-02-27 10:08 ` jerome.gardou at reactos dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-26 19:44 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from jerome.gardou at reactos dot org ---
Created attachment 8149
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8149&action=edit
GDB backtrace

Here is a relevant backtrace from the crashed GDB session.

i686-w64-mingw32-gdb --version
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu
--target=i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
  2015-02-26 19:44 ` [Bug remote/17397] " jerome.gardou at reactos dot org
@ 2015-02-27 10:08 ` jerome.gardou at reactos dot org
  2015-02-27 11:45 ` palves at redhat dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-27 10:08 UTC (permalink / raw)
  To: gdb-prs

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

jerome.gardou at reactos dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #7788|0                           |1
        is obsolete|                            |

--- Comment #3 from jerome.gardou at reactos dot org ---
Created attachment 8150
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8150&action=edit
GDB log triggering the crash

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
  2015-02-26 19:44 ` [Bug remote/17397] " jerome.gardou at reactos dot org
  2015-02-27 10:08 ` jerome.gardou at reactos dot org
@ 2015-02-27 11:45 ` palves at redhat dot com
  2015-02-27 12:01 ` jerome.gardou at reactos dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: palves at redhat dot com @ 2015-02-27 11:45 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

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

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
I suspect this is fixed in more recent GDB.  Could you try mainline?

Also, can you debug GDB a little?  What was the ptid of the thread that
GDB was expecting to find in the thread list, but isn't there?  And why isn't
it there anymore?  The ptid is unfortunately not visible here (frame #6):

...
#4  0x00000000006336b9 in internal_verror (file=<optimized out>, 
    line=<optimized out>, fmt=<optimized out>, ap=ap@entry=0x7fff7cd84ac8)
    at utils.c:803
#5  0x0000000000633762 in internal_error (file=file@entry=0x771a62 "thread.c", 
    line=line@entry=1002, string=<optimized out>) at utils.c:813
#6  0x000000000056a6df in switch_to_thread (ptid=...) at thread.c:1002
#7  0x000000000056b607 in print_thread_info (uiout=0x2233590, 
    requested_threads=0x226f8e0 "1", pid=-1) at thread.c:928
#8  0x00000000004aa601 in mi_cmd_execute (parse=0x2228820)
    at ./mi/mi-main.c:2253
#9  captured_mi_execute_command (context=0x2228820, uiout=0x2233590)
    at ./mi/mi-main.c:1988
#10 mi_execute_command (cmd=0x22701c0 "23-thread-info 1", 
    from_tty=<optimized out>) at ./mi/mi-main.c:2116
...

Please get a backtrace with "set print frame-arguments all".

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (2 preceding siblings ...)
  2015-02-27 11:45 ` palves at redhat dot com
@ 2015-02-27 12:01 ` jerome.gardou at reactos dot org
  2015-02-27 12:03 ` jerome.gardou at reactos dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-27 12:01 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from jerome.gardou at reactos dot org ---
Created attachment 8151
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8151&action=edit
GDB 7.9 crash log

I tried with GDB 7.9, with debugging (-g3) enabled and disabled optimizations.
There is still an assert failing, but quite different this time. I don't know
if this is a different symptom of the same bug, or another one.

Here is the log triggering the crash.

I will try to compile mainline as soon as I can.

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (3 preceding siblings ...)
  2015-02-27 12:01 ` jerome.gardou at reactos dot org
@ 2015-02-27 12:03 ` jerome.gardou at reactos dot org
  2015-02-27 14:02 ` jerome.gardou at reactos dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-27 12:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from jerome.gardou at reactos dot org ---
Created attachment 8152
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8152&action=edit
GDB 7.9 crash dump

GDB 7.9 core analysis.

Please let me know if you need some more info from a particular frame.

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (4 preceding siblings ...)
  2015-02-27 12:03 ` jerome.gardou at reactos dot org
@ 2015-02-27 14:02 ` jerome.gardou at reactos dot org
  2015-02-27 16:48 ` jerome.gardou at reactos dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-27 14:02 UTC (permalink / raw)
  To: gdb-prs

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

jerome.gardou at reactos dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #8151|0                           |1
        is obsolete|                            |

--- Comment #7 from jerome.gardou at reactos dot org ---
Created attachment 8153
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8153&action=edit
GDB 7.9 log triggering the crash

Sorry, attached wrong file.

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (5 preceding siblings ...)
  2015-02-27 14:02 ` jerome.gardou at reactos dot org
@ 2015-02-27 16:48 ` jerome.gardou at reactos dot org
  2015-03-19 11:26 ` palves at redhat dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-02-27 16:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from jerome.gardou at reactos dot org ---
I've tried today's git (commit ID 96c20bc18d71ca5ae3335d48ff2b459d495032d3),
the same problem occurs.

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (6 preceding siblings ...)
  2015-02-27 16:48 ` jerome.gardou at reactos dot org
@ 2015-03-19 11:26 ` palves at redhat dot com
  2015-04-04 14:59 ` jerome.gardou at reactos dot org
  2015-04-07  8:35 ` palves at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: palves at redhat dot com @ 2015-03-19 11:26 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Pedro Alves <palves at redhat dot com> ---
Thanks.  I can reproduce this with GNU/Linux gdbserver.

On one shell:

$ gdbserver --multi :9999 a.out

On another, connect with extended-remote, so we can start
two processes under the same gdbserver:

$ gdb a.out -ex "tar extended-remote :9999"
...
GNU gdb (GDB) 7.9.50.20150318-cvs
...
Reading symbols from ./a.out...done.
Remote debugging using :9999
...
0x0000003615a011f0 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) info inferiors 
  Num  Description       Executable        
* 1    process 24970     a.out
(gdb) add-inferior 
Added inferior 2
(gdb) inferior 2
[Switching to inferior 2 [<null>] (<noexec>)]
(gdb) info inferiors 
  Num  Description       Executable        
* 2    <null>                              
  1    process 24970     a.out
(gdb) file a.out
Reading symbols from a.out...done.
(gdb) info inferiors 
  Num  Description       Executable        
* 2    <null>            a.out
  1    process 24970     a.out
(gdb) start
Temporary breakpoint 1 at 0x411b67: main. (2 locations)
Starting program: /home/pedro/a.out

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd908) at
/home/pedro/foo.c:10
10      return 0;
(gdb) info inferiors 
  Num  Description       Executable        
* 2    process 24977     a.out
  1    process 24970     a.out

Now, disconnect, and reconnect, to emulate the OPs use case.

(gdb) disconnect 
Ending remote debugging.
(gdb) info inferiors 
  Num  Description       Executable        
* 2    <null>            a.out
  1    <null>            a.out
(gdb) tar remote :9999
Remote debugging using :9999
Reading symbols from /lib64/libdl.so.2...Reading symbols from /usr/lib/debug
(...)
main (argc=1, argv=0x7fffffffd908) at /home/pedro/foo.c:10
10      return 0;
(gdb) info inferiors 
  Num  Description       Executable        
* 2    process 24977     a.out
  1    <null>            a.out
(gdb) info threads 
  Id   Target Id         Frame 
* 2    Thread 24977      main (argc=1, argv=0x7fffffffd908) at
/home/pedro/foo.c:10
  1    Thread 24970      
/home/pedro/gdb/mygit/src/gdb/thread.c:1182: internal-error: switch_to_thread:
Assertion `inf != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (7 preceding siblings ...)
  2015-03-19 11:26 ` palves at redhat dot com
@ 2015-04-04 14:59 ` jerome.gardou at reactos dot org
  2015-04-07  8:35 ` palves at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: jerome.gardou at reactos dot org @ 2015-04-04 14:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from jerome.gardou at reactos dot org ---
Thanks for looking into this.
Quoting you: "Now, disconnect, and reconnect, to emulate the OPs use case." I
guess this is the way you "emulate" the fact that processes were created before
the GDB connection, or is there something wrong in the way the stub talks to
GDB ?

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


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

* [Bug remote/17397] i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
  2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
                   ` (8 preceding siblings ...)
  2015-04-04 14:59 ` jerome.gardou at reactos dot org
@ 2015-04-07  8:35 ` palves at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: palves at redhat dot com @ 2015-04-07  8:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #11 from Pedro Alves <palves at redhat dot com> ---
> Quoting you: "Now, disconnect, and reconnect, to emulate the OPs use case." I 
> guess this is the way you "emulate" the fact that processes were created before 
> the GDB connection, 

Correct.

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


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

end of thread, other threads:[~2015-04-07  8:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 13:13 [Bug remote/17397] New: i686-w64-mingw32 remote multiprocess debugging: thread.c:1002: internal-error: switch_to_thread: Assertion `inf != NULL' failed jerome.gardou at reactos dot org
2015-02-26 19:44 ` [Bug remote/17397] " jerome.gardou at reactos dot org
2015-02-27 10:08 ` jerome.gardou at reactos dot org
2015-02-27 11:45 ` palves at redhat dot com
2015-02-27 12:01 ` jerome.gardou at reactos dot org
2015-02-27 12:03 ` jerome.gardou at reactos dot org
2015-02-27 14:02 ` jerome.gardou at reactos dot org
2015-02-27 16:48 ` jerome.gardou at reactos dot org
2015-03-19 11:26 ` palves at redhat dot com
2015-04-04 14:59 ` jerome.gardou at reactos dot org
2015-04-07  8:35 ` palves 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).