From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47997 invoked by alias); 5 Dec 2018 19:35:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 47988 invoked by uid 89); 5 Dec 2018 19:35:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=preceding, Gdb, spawn_id, spawn X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Dec 2018 19:35:42 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB5JZTjk089438 for ; Wed, 5 Dec 2018 14:35:41 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p6jd57ag6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 05 Dec 2018 14:35:36 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Dec 2018 19:34:59 -0000 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 5 Dec 2018 19:34:55 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB5JYsr218415832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 19:34:55 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D83D2AC05E; Wed, 5 Dec 2018 19:34:54 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D277AC059; Wed, 5 Dec 2018 19:34:54 +0000 (GMT) Received: from pedro.localdomain (unknown [9.18.235.147]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 5 Dec 2018 19:34:54 +0000 (GMT) Received: by pedro.localdomain (Postfix, from userid 1000) id 227133C0426; Wed, 5 Dec 2018 17:34:52 -0200 (-02) From: Pedro Franco de Carvalho To: Tom de Vries , Simon Marchi , Gary Benson Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH][gdb/testsuite] Log wait status on process no longer exists error In-Reply-To: <10673518-aad3-7305-6b73-486f9df742eb@suse.de> Date: Wed, 05 Dec 2018 19:35:00 -0000 MIME-Version: 1.0 Content-Type: text/plain x-cbid: 18120519-0068-0000-0000-0000036CDB6E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010177; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01127461; UDB=6.00585621; IPR=6.00907595; MB=3.00024464; MTD=3.00000008; XFM=3.00000015; UTC=2018-12-05 19:34:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120519-0069-0000-0000-000046AA2C16 Message-Id: <87zhtjojhf.fsf@linux.vnet.ibm.com> X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00060.txt.bz2 Tom de Vries writes: > Btw, I noticed that gdb_test_multiple emits an "ERROR: Process no longer > exists" preceding the unresolved message, but does not give details > about the process exit status, which might be helpful. > > How about this patch? > > Thanks, > - Tom Hello, I noticed that in certain cases the wait call used to find out the exit status can hang forever waiting for the GDB process, due to a dejagnu oddity. The gdb_test_multiple procedure uses gdb_expect, which itself uses remote_expect (provided by dejagnu). The remote_expect procedure parses the expect body passed to it and uses the eof block as a "default" case to be executed in case of an error, which means that it can be executed even when there was no actual eof and the GDB process is still running. You can see this happen with a testcase like: gdb_start gdb_test_multiple "show version" "show version" { -re ".*" { error "forced error" } } I'm not sure how to solve this. This was triggered by some testcases when gdbserver failed to start, the testcases don't check this and use the gdbserver spawn_id even though it no longer exists, which is what causes the error to be raised. This gdbserver issue has been fixed since, so for now this will probably not happen. Thanks! -- Pedro Franco de Carvalho > [gdb/testsuite] Log wait status on process no longer exists error > > Proc gdb_test_multiple can run into a process no longer exists error, but when > that happens it shows no details about the process: > ... > ERROR: Process no longer exists > ... > > Fix this by showing the wait status of the process in the log: > ... > ERROR: Gdb process no longer exists > Gdb process exited with wait status 8106 exp8 0 0 CHILDKILLED SIGSEGV \ > {segmentation violation} > ... > > In order to run the wait commmand we need an explicit pid, so we can't use > any_spawn_id, and duplicate the "-i any_spawn_id eof" patter for gdb_spawn_id, > and add the wait status logging there. > > Build and tested on x86_64-linux. > > 2018-10-24 Tom de Vries > > * lib/gdb.exp (gdb_test_multiple): Log wait status on process no > longer exists error. > > --- > gdb/testsuite/lib/gdb.exp | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 2d197d9b5c..f68664b0ef 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -980,6 +980,16 @@ proc gdb_test_multiple { command message user_code } { > set result -1 > } > > + -i $gdb_spawn_id > + eof { > + perror "Gdb process no longer exists" > + verbose -log "Gdb process exited with wait status [wait -i $gdb_spawn_id]" > + if { $message != "" } { > + fail "$message" > + } > + return -1 > + } > + > # Patterns below apply to any spawn id specified. > -i $any_spawn_id > eof {