public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dmitry.neverov at jetbrains dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug server/31338] New: MinGW error on detach: gdbserver/inferiors.cc:160: A problem internal to GDBserver has been detected
Date: Mon, 05 Feb 2024 09:25:13 +0000	[thread overview]
Message-ID: <bug-31338-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 31338
           Summary: MinGW error on detach: gdbserver/inferiors.cc:160: A
                    problem internal to GDBserver has been detected
           Product: gdb
           Version: 14.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: dmitry.neverov at jetbrains dot com
  Target Milestone: ---

Happens in latest MinGW:
https://github.com/brechtsanders/winlibs_mingw/releases
winlibs-i686-posix-dwarf-gcc-14.0.0-snapshot20240107-mingw-w64msvcrt-11.0.1-r1.7z

To reproduce:

- compile the program

#include <stdio.h>
#include <windows.h>

int main(void) {
  for (int i = 0; i < 10000; i++) {
    printf("%d\n", i);
    Sleep(1000);
  }
  return 0;
}

- run mingw32/bin/gdbserver.exe --once localhost:4242 a.exe

- run mingw32/bin/gdb.exe -nx and execute the commands:

(gdb) file a.exe
(gdb) target remote tcp:localhost:4242
(gdb) b main.c:7
(gdb) continue
(gdb) detach

Gdbserver process is terminated, the a.exe keeps running.

Gdbserver output:
Listening on port 4242
Remote debugging from host ::1, port 65172
0
Detaching from process 6476
../../gdbserver/inferiors.cc:160: A problem internal to GDBserver has been
detected.
remove_process: Assertion `find_thread_process (process) == NULL' failed.

Gdb output:
(gdb) file a.exe
Reading symbols from a.exe...
(gdb) target remote tcp:localhost:4242
Remote debugging using tcp:localhost:4242
Reading C:\WINDOWS\SysWOW64\ntdll.dll from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to
access files locally instead.
Reading C:\WINDOWS\SysWOW64\kernel32.dll from remote target...
Reading C:\WINDOWS\SysWOW64\KernelBase.dll from remote target...
Reading C:\WINDOWS\SysWOW64\msvcrt.dll from remote target...
Reading
c:/R/winlibs32_stage/inst_gdb-14.1/share/gdb/lib/debug/.build-id/ce/2f4b523d856940ee33aaab0cab37b0.debug
from remote target...
Reading
c:/R/winlibs32_stage/inst_gdb-14.1/share/gdb/lib/debug/.build-id/ae/8ddde49412d714d51c90cdaeb34527.debug
from remote target...
Reading
c:/R/winlibs32_stage/inst_gdb-14.1/share/gdb/lib/debug/.build-id/49/8edfaad5f9f445d4e77e14f7de2807.debug
from remote target...
Reading
c:/R/winlibs32_stage/inst_gdb-14.1/share/gdb/lib/debug/.build-id/34/f7f72739101e3b219e5fc1e36b0435.debug
from remote target...
0x776c8088 in ntdll!LdrInitShimEngineDynamic () from
target:C:\WINDOWS\SysWOW64\ntdll.dll
(gdb) b main.c:7
Breakpoint 1 at 0x8f15fe: file main.c, line 7.
(gdb) continue
Continuing.

Thread 1 hit Breakpoint 1, main () at main.c:7
7           Sleep(1000);
(gdb) detach
Detaching from program: c:\w\CLionProjects\CLoop\a.exe, Remote target
Remote communication error.  Target disconnected: No error.
(gdb)

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

             reply	other threads:[~2024-02-05  9:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05  9:25 dmitry.neverov at jetbrains dot com [this message]
2024-02-05  9:33 ` [Bug server/31338] " dmitry.neverov at jetbrains dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31338-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).