From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FC0E3858C36; Mon, 24 Apr 2023 11:49:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FC0E3858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682336948; bh=QvhdwGSH3YbAvjYEnP4ssdGxupStB70fiO3HWNggW6w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VxbuPpJhXG4XHl/3+zLIbmJiGbkg3AIU1ydaNdsR8zIDhH5WqXoJhEXdwNr5JHiBc 9RJVRyHKSrfHvZ6bJ4rb95pjJO+yi8hcEdZ4EwuL3oV7/p0gCTv2zFJxP+UemVNnsj fMbMJQFeawxlpj0LbxZ8zYvNEosf/uEotrIAyGYM= From: "hewei4321017 at 163 dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/30384] gdbserver get an error when father process exit Date: Mon, 24 Apr 2023 11:49:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hewei4321017 at 163 dot com X-Bugzilla-Status: UNCONFIRMED 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: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30384 --- Comment #3 from =E8=B4=BA=E4=BC=9F --- Comment on attachment 14845 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14845 test code #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(int args, char* argv[], char* envp[]) { int g =3D 1; pid_t pid =3D fork(); if (pid < 0) { return -1; } else if (pid =3D=3D 0) { int i =3D 0; while (1) { int a =3D 3; i++; cout << "child:" << getpid() << endl; sleep(2); } } else if (pid > 0) { // cout << "father pid:"<< getpid() << endl; int i =3D 0; while (i<5) { cout << "father:" << getpid() << endl; i++; sleep(2); } exit(0); } return 0; } --=20 You are receiving this mail because: You are on the CC list for the bug.=