Message ID | AS8P193MB1285F810C8C9E340FCAAE304E4122@AS8P193MB1285.EURP193.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94C383858C66 for <patchwork@sourceware.org>; Mon, 22 Apr 2024 09:54:10 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2024.outbound.protection.outlook.com [40.92.74.24]) by sourceware.org (Postfix) with ESMTPS id 9768E3858D35 for <gdb-patches@sourceware.org>; Mon, 22 Apr 2024 09:53:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9768E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9768E3858D35 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.92.74.24 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713779622; cv=pass; b=SnKyrxGAjPh8iFT5pYmSoby6J3XIXKH9Oe/w+Q9vYjCq4kqAhWJ6yEDPbtsQKIPmQbtIfyVHNUSEZ4u9HrQJmLetl5cxo6a7BZzVov1sJ1I0hrN8fvhftI4Uv+iTUrz2vVdGtctikNVd91qlIdT9Q1ek7BOKcAizs34GKm/LMs4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713779622; c=relaxed/simple; bh=Nj8fvd9ztW53mf2924WWo+3siSIslZ6QVwzc3CWURHg=; h=DKIM-Signature:Message-ID:Date:From:Subject:To:MIME-Version; b=HOSB6xj2MfAiLEDcztNF7ARVAFd6yKCeLpcbc5kd7HqCuxYA520ulZLhmHcmfqGN7+GxRq6GX3n78+IkeIRB8dBnhzDSfGVV6AIt6HK8FYA/TPQCwVjGedXtnKxzlTxo9YIXtYOnmjBJW83kjXYbqm93HYAx3HErx+xACXcGukQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YK6+XA5vepFmuummp/60kSEW2XoFQWsNW6loIs1NGyXuPWiAoO+ELsiYaZBa6Xr79M0M908Dmfv4FYO292EK+UA+8V7QiM76cBStXLtrKSNGzHtVwuqN8fjNL40H4FdEDW0roXQBtH+LzgLpNqYKG57YYYILInOVht9vQa6BMK58CSgXezu15e2pShLGNsTqQFrFp6nT8tXItRsEIisxk/Lrt+y2xUBF/REVwSk1vE+ftYNlml4R7l+G5e6V15J9SUP4a44mwGUeb7jzrOJkLViun6fw/xPNqcgUot3q0u6xpWIgchrvMIt2JWYRIPyuZkyymN4OeLhSfQ8jf8SkAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=spXSfZCKr9y4NPq3j/TK9cJ/VrOAloiLyX9v2uqSo5E=; b=hFFhfoVb2cRqGmwlrN8ElqDsjbLDpw9AMdKYXg2A1MXHQyCnpEX59RnQLxDYmrea21tsM4GFBqdZ1kjg/9dogvthqPO4Yjlw8w4dyj8ooFCAxuviQZJytPV5hj9+Avpm9uxQH/tW8iji43tDkSPHTv/q33QgCGh9MDq6AvUH4W6CfbyK+i1sHyi5K3qwpM055eEKPitjfhyQK6wbW/hzYR0NragmhY0SBjN766yMms3A5RAdR6bsM/XfWiIZwm4rHYuEzoFU9R0kBdbAahTekQaNzteP5hSm9ILLoZ4sIXihmGv9t54FAHRzlTeBmniCQ56E2qXzHgAN0cNMze9/pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HOTMAIL.DE; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=spXSfZCKr9y4NPq3j/TK9cJ/VrOAloiLyX9v2uqSo5E=; b=KPU3F07baeGxCaAMhHuZ6uxc+z1eRZZhE9Lky7YikW9ymkcGH/Iuf8bafb9gnLXMKhqQb8TvgiaZSUjlhbdQ/xECnm0o1NP5eKAn+AZdZMrWH5Yj4t4vugSg8lizxh88HGSkuXO7jAHZbJMt1s1qx06wgb9hFOsXPcxlKnMne6e6wXtNSxYu22wyxt7LUG4pr/sty6rlEbEgOGwdKta0xJ7MrYOTbZXGA7wAheZlDl9/Uo5qyg2N1idEkNQcJMQHvwCL8fTMI71v2TOE1+anDVMNSd8s4UKEoARxeMCXOI2FpV/pXJ+egpPGTG4JsVVD/cY4Bo0yCxe3oNf/zV/WTw== Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) by DB8P193MB0567.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Mon, 22 Apr 2024 09:53:38 +0000 Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::5403:f1ad:efaf:1f71]) by AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::5403:f1ad:efaf:1f71%4]) with mapi id 15.20.7472.044; Mon, 22 Apr 2024 09:53:38 +0000 Message-ID: <AS8P193MB1285F810C8C9E340FCAAE304E4122@AS8P193MB1285.EURP193.PROD.OUTLOOK.COM> Date: Mon, 22 Apr 2024 11:55:34 +0200 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Bernd Edlinger <bernd.edlinger@hotmail.de> Subject: [PATCH v2] Fix random dejagnu test abort with simulator target To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>, Tom de Vries <tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TMN: [QtX2oPMoeEo5HgssIqUnuwRN+DbhqNcsErtkmSN3gAefd6a6ZYjJIwlgAYtxfSG0] X-ClientProxiedBy: FR4P281CA0369.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f8::9) To AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) X-Microsoft-Original-Message-ID: <8e953fb0-e7f7-4047-96f3-979a8cc4b7e6@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P193MB1285:EE_|DB8P193MB0567:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bc3d64d-47f8-4dd6-0a99-08dc62b21564 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tf8nYyp/j2lf9B7V3ygu/Q7V0ZnVErGFzN7z+EfYnTDF3HM6yVKe2rH0gu19JKKZb/tNAJ2ydtfuYt4zpQWI3Md3ICk7MA95qkYXPb0KdWHPPIm8BbLhh0UQMIyDkuyuEVIIXB+25tNXawdo/8VkEbSDfR4EKLy5lUoah23bzE7J/7SbwcdJZu9cfSQ167Bwke9tFzh2EbaUeelDTps5dx0tCBU5BtgTUFNwYKoQTidedChOk9L/CpkSUHlngktJY7SIen/969/STvlnTXhHe6ys042MyULE3oXzJCUpLuDZwkWF89mYF9+YqFsyIrh24MIFdoVu6usSA3ze5TkSa+ezckkzmitOUpZG57y80nz+HQpFqeQF60HCi9gafoq3n134sMWiQwpRab7VkIGxxiTzfiIvA/7Tx0v28TsLFnIj3PwA6cUTqDyEza7UsV0ohOae0TKpByaGbBKnttEleiWaubY07rLPcpTnvXAFQa/GRNIUQZbLrQmuRNgOEo/2XVwOIzHsR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WHUnAh5oq5ACgr+DK3rQf?= =?utf-8?q?/ZUBd7qjg7n5If3dqJlYCR2Y2x/T5CwvHv+SBtqFnVrNw7xoFejNMrrXyZ+9z8dyC?= =?utf-8?q?4KIEZGqXeAP5Wu9FeBGw9PUaCUsg0xew/KVs0md9Yof6A5S/EjX3mY5nqOXiTtMmz?= =?utf-8?q?/U6js2VSai6Dsd2stJH4QleTxr9V7/uzDWgsIpGD9WWYqZ0OFz4IXYtmRQdLgD39y?= =?utf-8?q?yeSE97NGiVwlo1AxVLH79Bj0VUE52e25fkN0Ikh1ZtnDEStuDZcpvPiPDFBgKfn/H?= =?utf-8?q?hpORapKT/1s+a1h9mvEK/+Liys+0r8zG+kL/WzYA8NaC/8wHYsHXmWBKrjbOzzfQM?= =?utf-8?q?cdRePGN3jgHt8aTgynRJmH6fOwAvAPv30TJmLre6InrhVs+Vyk+dNNkNCKARd5aKG?= =?utf-8?q?G2/qN7PE7/h+POXLzwhyFvI/PR2OQj9HCqPJQJ//pd02cpx3FJomwDQXh3/MeCVil?= =?utf-8?q?a48bCGIqMUAJ72M8yIEDZE3/l8SIJyoMErYNpS4Bi2YvXLCBwosEmIvsHoaQQ/SD6?= =?utf-8?q?uTEztUZiniufQG5E8framwCbuPASLLlbpMq8//XngKQWqZrUuW6B/MIT+NZKWhtdc?= =?utf-8?q?3g0JXhR1xsf0/v50?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-80ceb.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 8bc3d64d-47f8-4dd6-0a99-08dc62b21564 X-MS-Exchange-CrossTenant-AuthSource: AS8P193MB1285.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 09:53:38.5227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P193MB0567 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
[v2] Fix random dejagnu test abort with simulator target
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-arm | success | Testing passed |
Commit Message
Bernd Edlinger
April 22, 2024, 9:55 a.m. UTC
This is probably a dejagnu issue with the gdb testsuite when a simulator target is used. I observed random testrun aborts with dejagnu 1.6.2-1 from ubuntu 20.04 The problem starts when the test case gdb.base/sigwinch-notty.exp tries to execute "sleep", although that is impossible with a simulator. And for unknown reason the test case completes (with errors) before the "after 1000" block is run. Then in a totally different test this happens with 50% likelihood: ERROR: (DejaGnu) proc "bgerror {can't read "gdb_pid": no such variable}" does not exist. The error code is TCL LOOKUP COMMAND bgerror The info on the error is: invalid command name "bgerror" while executing "::tcl_unknown bgerror {can't read "gdb_pid": no such variable}" ("uplevel" body line 1) invoked from within "uplevel 1 ::tcl_unknown $args" === gdb Summary === # of expected passes 30815 # of unexpected failures 241 # of expected failures 3 # of known failures 23 # of unresolved testcases 241 # of untested testcases 96 # of unsupported tests 532 # of paths in test names 1 So the whole test run is aborted in the middle. This patch should fix the issue. Co-Authored-By: Tom de Vries <tdevries@suse.de> --- gdb/testsuite/gdb.base/sigwinch-notty.exp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) v2: I took over Tom's suggestion 1:1, and gave it a few test runs with no unexpected test aborts so far. So this looks quite good to me, and has also a nice improvement of giving an UNSUPPORTED message, with what exactly was the reason why the test did not run.
Comments
Bernd Edlinger <bernd.edlinger@hotmail.de> writes: > This is probably a dejagnu issue with the gdb testsuite > when a simulator target is used. I observed random > testrun aborts with dejagnu 1.6.2-1 from ubuntu 20.04 > The problem starts when the test case gdb.base/sigwinch-notty.exp > tries to execute "sleep", although that is impossible with a > simulator. And for unknown reason the test case completes > (with errors) before the "after 1000" block is run. > > Then in a totally different test this happens with 50% likelihood: > > ERROR: (DejaGnu) proc "bgerror {can't read "gdb_pid": no such variable}" does not exist. > The error code is TCL LOOKUP COMMAND bgerror > The info on the error is: > invalid command name "bgerror" > while executing > "::tcl_unknown bgerror {can't read "gdb_pid": no such variable}" > ("uplevel" body line 1) > invoked from within > "uplevel 1 ::tcl_unknown $args" > > === gdb Summary === > > # of expected passes 30815 > # of unexpected failures 241 > # of expected failures 3 > # of known failures 23 > # of unresolved testcases 241 > # of untested testcases 96 > # of unsupported tests 532 > # of paths in test names 1 > > So the whole test run is aborted in the middle. > > This patch should fix the issue. > > Co-Authored-By: Tom de Vries <tdevries@suse.de> > --- > gdb/testsuite/gdb.base/sigwinch-notty.exp | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > v2: I took over Tom's suggestion 1:1, and gave it a few test runs with > no unexpected test aborts so far. > So this looks quite good to me, and has also a nice improvement of giving > an UNSUPPORTED message, with what exactly was the reason why the test > did not run. > > diff --git a/gdb/testsuite/gdb.base/sigwinch-notty.exp b/gdb/testsuite/gdb.base/sigwinch-notty.exp > index cef21c07c59..621231df6af 100644 > --- a/gdb/testsuite/gdb.base/sigwinch-notty.exp > +++ b/gdb/testsuite/gdb.base/sigwinch-notty.exp > @@ -19,11 +19,17 @@ > > require {!target_info exists gdb,nosignals} > > -# The testfile relies on "run" from the command line, so only works > -# with "target native". > -if { [target_info gdb_protocol] != "" } { > - return > -} > +# The test-case relies on "run" from the command line, so it only works > +# with "target native", so we need host == target. I'm currently reading and rereaching the V1 series to try and understand what's going on here, but I don't understand this comment. # The test-case relies on "run" from the command line, so it only works # with "target native", so we need host == target. Just doesn't make sense to me: 'target extended-remote' will also support the `run` command, as will 'target sim'. The conclusion might well be valid, but I think the logic used to justify it is incorrect. Can we rephrase this comment so it makes sense? Thanks, Andrew > +# > +# The test-case uses "exp_pid -i $gdb_spawn_id" which doesn't work with > +# remote host, so we need build == host. > +# > +# In other words, we need build == host == target. > +require {!is_remote host} {!is_remote target} > + > +# Check that we have "target native" as opposed to native-gdbserver etc. > +require {string equal [target_info gdb_protocol] ""} > > gdb_exit > > -- > 2.39.2
On 4/22/24 15:49, Andrew Burgess wrote: > Bernd Edlinger <bernd.edlinger@hotmail.de> writes: >> +# The test-case relies on "run" from the command line, so it only works >> +# with "target native", so we need host == target. > > I'm currently reading and rereaching the V1 series to try and understand > what's going on here, but I don't understand this comment. > > # The test-case relies on "run" from the command line, so it only works > # with "target native", so we need host == target. > > Just doesn't make sense to me: 'target extended-remote' will also > support the `run` command, as will 'target sim'. > > The conclusion might well be valid, but I think the logic used to > justify it is incorrect. Can we rephrase this comment so it makes > sense? > I probably don't know how to properly explain that. But would very much appreciate any advice how to. The test case ties to do this: The gdb host/build environment is x86_64-pc-linux-gnu, and the target environment is riscv-unknown-elf with newlib so the run command would work but only to run a program that was built with my riscv-unknown-elf-gcc. But the test case ties to run "/usr/bin/sleep 3", therefore the gdb is unable to run that, and since the stdin is redirected to /dev/null the gdb terminates immediately, so the test script terminates with one FAIL and one PASS test case, BUT the after 1000 is still hanging on, and interrupts the whole test run, or just one test case that depends on some kind of race condition, and maybe also a bit on the dejagnu version. It is interesting that the gdb_pid is no longer known, when the after 1000 executes, and creates the cryptic message ERROR: (DejaGnu) proc "bgerror {can't read "gdb_pid": no such variable}" does not exist. Please feel free to ask if I can give more information. Thanks Bernd.
diff --git a/gdb/testsuite/gdb.base/sigwinch-notty.exp b/gdb/testsuite/gdb.base/sigwinch-notty.exp index cef21c07c59..621231df6af 100644 --- a/gdb/testsuite/gdb.base/sigwinch-notty.exp +++ b/gdb/testsuite/gdb.base/sigwinch-notty.exp @@ -19,11 +19,17 @@ require {!target_info exists gdb,nosignals} -# The testfile relies on "run" from the command line, so only works -# with "target native". -if { [target_info gdb_protocol] != "" } { - return -} +# The test-case relies on "run" from the command line, so it only works +# with "target native", so we need host == target. +# +# The test-case uses "exp_pid -i $gdb_spawn_id" which doesn't work with +# remote host, so we need build == host. +# +# In other words, we need build == host == target. +require {!is_remote host} {!is_remote target} + +# Check that we have "target native" as opposed to native-gdbserver etc. +require {string equal [target_info gdb_protocol] ""} gdb_exit