[Bug c++/30384] New: gdbserver get an error when father process exit
hewei4321017 at 163 dot com
sourceware-bugzilla@sourceware.org
Mon Apr 24 11:13:02 GMT 2023
https://sourceware.org/bugzilla/show_bug.cgi?id=30384
Bug ID: 30384
Summary: gdbserver get an error when father process exit
Product: gdb
Version: 13.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: hewei4321017 at 163 dot com
Target Milestone: ---
Overview:
when debugging multi-process with gdb and gdbserver on ubuntu 22.04,
gdbserver get
an error "Cannot get thread handle for LWP 556726: generic error" when parent
exit
Steps to Reproduce:
1、compile excutable
g++ main.cpp -g -o test
2、run gdbserver with command
hewei@hewei-VirtualBox:~/project/gdb-13.1$ ./gdbserver/gdbserver 0.0.0.0:5012
/home/hewei/project/testipc/src/main/test
Process /home/hewei/project/testipc/src/main/test created; pid = 557078
Listening on port 5012
3、run gdb and input the following command
set mi-async on
set detach-on-fork off
set follow-fork-mode parent
set schedule-multiple on
target remote 10.27.8.145:5012
continue
4、when father process exit,gdbserver will get an error.
Child exited with status 0
gdbserver: Cannot get thread handle for LWP 557093: generic error
5、After that,it won't be able to debug the child process any more. When I try
to switch to the child and press "ctrl + c" to interrupt the child in gdb, it
will output the following msg:
Reading
/usr/local/lib/debug/.build-id/02/17e95cdd5172617b053d3772efce4317a55898.debug
from remote target...
[Inferior 1 (process 557078) exited normally]
(gdb) info inferior
Num Description Connection Executable
* 1 <null> 1 (remote 10.27.8.145:5012)
target:/home/hewei/project/testipc/src/main/test
2 process 557093 1 (remote 10.27.8.145:5012)
target:/home/hewei/project/testipc/src/main/test
(gdb) inferior 2
[Switching to inferior 2 [process 557093]
(target:/home/hewei/project/testipc/src/main/test)]
[Switching to thread 2.1 (Thread 557093.557093)]
^C
^CThe target is not responding to GDB commands.
Stop debugging it? (y or n)
Actual Results:
unable to continue debugging child process
Actual Results:
After parent exit, I can continue to debug the child.
Additional Builds and Platforms
gdb and gdbserver are built on ubuntu 22.04 with gcc 7.55
hewei@hewei-VirtualBox:~/project/testipc/src/main$ gcc --version
gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
build command:
./configure --enable-targets=aarch64-linux-gnu,x86_64-linux-gnu
CFLAGS="-lpthread -g" CXXFLAGS="-lpthread -g" LIBS="-lpthread -g" && make
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list