From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17115 invoked by alias); 28 Feb 2018 05:33:48 -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 17084 invoked by uid 89); 28 Feb 2018 05:33:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Feb 2018 05:33:46 +0000 Received: from ESESSHC016.ericsson.se (Unknown_Domain [153.88.183.66]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id EA.43.21824.73F369A5; Wed, 28 Feb 2018 06:33:43 +0100 (CET) Received: from ESESSMB503.ericsson.se (153.88.183.164) by ESESSHC016.ericsson.se (153.88.183.66) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 28 Feb 2018 06:32:42 +0100 Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESSMB503.ericsson.se (153.88.183.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Wed, 28 Feb 2018 06:32:42 +0100 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB504.ericsson.se (153.88.183.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26 via Frontend Transport; Wed, 28 Feb 2018 06:32:41 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [10.0.0.110] (192.222.251.162) by SN6PR1501MB2016.namprd15.prod.outlook.com (2603:10b6:805:e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Wed, 28 Feb 2018 05:32:39 +0000 Subject: Re: [PATCH v3 2/2] Make gdbserver work with filename-only binaries To: Sergio Durigan Junior , GDB Patches CC: Pedro Alves , Joel Brobecker References: <20180210014241.19278-3-sergiodj@redhat.com> <20180228032708.19670-1-sergiodj@redhat.com> <20180228032708.19670-3-sergiodj@redhat.com> <87h8q1oje2.fsf@redhat.com> From: Simon Marchi Message-ID: <7663ed32-2e44-78c9-fce9-fd285f3c6bfd@ericsson.com> Date: Wed, 28 Feb 2018 05:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <87h8q1oje2.fsf@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YTXPR0101CA0066.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:1::43) To SN6PR1501MB2016.namprd15.prod.outlook.com (2603:10b6:805:e::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd865113-5159-4a6b-3eca-08d57e6caef6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020);SRVR:SN6PR1501MB2016; X-Microsoft-Exchange-Diagnostics: 1;SN6PR1501MB2016;3:vy5xr9tcSsFuz09nKPVwVZ95EK+Fg22MYMsAEFgYK7sCAGJQdlx1GDuleWNOLUykFjTqMPw2aJLWT8zjqVBiygSAXg3wVXZzLRqOePR7vdUGyq4yGDS/gY8FdGFNTRSUWg7OEQG5KVLAlwJ5msRw4+tEmph+QG0Ag2ZqptvZgoRvbdxTM9kRwWhEY2u6vqjvnHOKp3g6A3PC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YEBQdlIYmLVeEsoulHMrsWAesMnk0hQCRSxeN/MhzyCHxTnsbnY82C4/TCIb09DHME5N6zgGi/QZCyerp+Uaa/+otKiRXEkOBZw6XFL2QlXpTEkdRUtIgPp0/YOiCenGF6ts6eAPso2TwRE+;4:HaAmp8b5H1tuoZ7IR+a2gl55EJnECKBeECXnVw6c0x40L9Va5bXFq57Cmkkzdp89/f+17XI2D/dFGHFlkO27okDi4TD1gYbpd+xB7TIjJBC3+4SZ5uKhXrhmB7f2AlSlDx3dS0lMVprBVmOYuPBP4T3HmQ6SonhkP+RS6p8uBjtXizRzY/iia/8Q3WI8JKUqDwmOaCEvkQDy5F/UeI4ApP/fNBng+F0q4eAYGtQl9bsdf/y0xtx4FfzY271k2Ue/AhcHyUNryjmXaGPXsqtF76+8tyO0pxF08J0WDnBv6dhQCmvWeBG2RFss1pasVJ6zFdgBVtnVPrrQnaXPR1WKsG5rKZvInMjIlh6G00OiXavV90fYOkdYCzcAI8OXOeRi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(265634631926514)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(3231220)(944501161)(52105095)(93006095)(93001095)(10201501046)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:SN6PR1501MB2016;BCL:0;PCL:0;RULEID:;SRVR:SN6PR1501MB2016; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(376002)(39380400002)(39860400002)(396003)(346002)(366004)(52314003)(377424004)(199004)(189003)(6306002)(186003)(305945005)(110136005)(106356001)(2486003)(58126008)(4326008)(86362001)(53546011)(105586002)(36756003)(93886005)(25786009)(53936002)(65826007)(52116002)(966005)(97736004)(316002)(23676004)(52146003)(6246003)(54906003)(6486002)(31696002)(16576012)(50466002)(81166006)(3846002)(47776003)(5660300001)(76176011)(8676002)(6116002)(81156014)(8936002)(6666003)(5890100001)(65956001)(31686004)(229853002)(64126003)(65806001)(386003)(59450400001)(7736002)(16526019)(77096007)(2906002)(66066001)(26005)(2950100002)(478600001)(230700001)(68736007);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR1501MB2016;H:[10.0.0.110];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjZQUjE1MDFNQjIwMTY7MjM6SHlNWDIrYjJsNHg0eGxTQXFqeTViWDkz?= =?utf-8?B?VnpoQitZZ2lTeXkyRVdOSDJNNmhDK09aYVFKQkNUM3dFZUJOYU5KRW9Zd0pr?= =?utf-8?B?N1ZlckYzc1RLNXZqR3VQYkpVRjlONU1xSDRmVnAyQ3B4V2kzSnRDQXN5WHdI?= =?utf-8?B?UWFMbTRjU0tjYVhFRjdNMVN2ZFFTcFM3c2FPVGhVQ1JtTTlrbHM3bDZaTlpx?= =?utf-8?B?ODFzcW4vWnl5Qm9NUmM4enQxdlllV0NzcVpDUnc1R1NDRTZyK1RVSVRLT2l6?= =?utf-8?B?bzRGSEFDems1UlJvN09QSEJHR1g2ZDBlaDBiaEkyOXQ4MmhGUHNLY0ZKY0g1?= =?utf-8?B?TnpJYmJHRm9XcVpZK21qd2kveWVSYkVhZ1hieis3eS9iS1VjQWJ2eWJYT2Zo?= =?utf-8?B?YStqZnJQK0FzRi9TeUJ4MXBOVGZYOVN4YzR3aVJLN0I0YTYxQy92Zmg2K05V?= =?utf-8?B?SzIvZXZReEIvQTNQT1dML2xEMzFxWXplN2E3a2xpK05XTmQ2bDNuc085Q1Bm?= =?utf-8?B?UHVRZ1h2ek9kdjM5TlBWb1RWajM0MUpGZ1BGTGNyT0QyZVhoZ3Yva0g1TE81?= =?utf-8?B?SWt3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CMm5QReoxWchv8=;5:W0+2gXbZQFhcqm4JaWJlh1O+YPSCHS0GpPBmoRc+Q+2OFPHZn9g7OuzdYU9DnZWEKXvaoKGVqS+XsN80N5KgtcCNSsSFYOPZrnpqVcZQByeNqWph6b5McCewBaFfbugUwHQ18LukdZbf33RjHlEi5h95oODPaPNHNvx05TwP+uQ=;24:lzD9/L93DYTdjBVrHFOER1Pk3v5X1WedO6TUsTbdHfmK7lBUCGJQ94iLzpAT4oM8zChCY5OSwKwTQACv7l8Fq1d5p5Gv31MCL/3fqJOGTlE=;7:YzKh50HDNYZ7OF0uPrdA1z8mo0iInh1walUBIytBYQr9u5akGTINOfTOZhgD/+zWNZBxASRwo0QqLrVHuypERDDyF3gQD61BiaREsgI09TIoaNCUi3rRbjzHj8Cntu4WHgZNUDT7xxq72EN7Yo/LIN843chGSuhOKnTt5ryHVA91YxMybxa3100t31mWRMiVd4VMnL10SVECVJAzq+8+EXDU2Sz6YQm4OagubfUYBLGpuRfwMWSsuxXKKMM+3s6N SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 05:32:39.5046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd865113-5159-4a6b-3eca-08d57e6caef6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR1501MB2016 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00446.txt.bz2 On 2018-02-27 10:58 PM, Sergio Durigan Junior wrote: > On Tuesday, February 27 2018, I wrote: > >> Simon mentioned on IRC that, after the startup-with-shell feature has >> been implemented on gdbserver, it is not possible to specify a >> filename-only binary, like: >> >> $ gdbserver :1234 a.out >> /bin/bash: line 0: exec: a.out: not found >> During startup program exited with code 127. >> Exiting >> >> This happens on systems where the current directory "." is not listed >> in the PATH environment variable. Although including "." in the PATH >> variable is a possible workaround, this can be considered a regression >> because before startup-with-shell it was possible to use only the >> filename (due to reason that gdbserver used "exec*" directly). >> >> The idea of the patch is to verify if the program path provided by the >> user (or by the remote protocol) contains a directory separator >> character. If it doesn't, it means we're dealing with a filename-only >> binary, so we call "gdb_abspath" to properly expand it and transform >> it into a full path. Otherwise, we leave the program path untouched. >> This mimicks the behaviour seen on GDB (look at "openp" and >> "attach_inferior", for example). >> >> I am also submitting a testcase which exercises the scenario described >> above. This test requires gdbserver to be executed in a different CWD >> than the original, so I also created a helper function, "with_cwd" (on >> testsuite/lib/gdb.exp), which takes care of cd'ing into and out of the >> specified dir. > > This part is still giving me a few headaches. I've just noticed that > two builders reported the new test as FAIL. When I run it here, I can't > reproduce it, which makes me wonder that it's racy. I don't know if the > culprit is the new "with_cwd" logic or not. Curiously, both builders > reporting the failure are running on s390x > (Debian-s390x-native-extended-gdbserver-m64 and RHEL-s390x-m64). > > Here's an excerpt of report from one of them, > Debian-s390x-native-extended-gdbserver-m64: > > ---------------- > (gdb) file /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath/abspath > Reading symbols from /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath/abspath...done. > (gdb) set remote exec-file /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath/abspath > (gdb) set remote exec-file /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath/abspath > (gdb) disconnect > Ending remote debugging. > (gdb) PASS: gdb.server/abspath.exp: disconnect > Switching to directory /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath (saved CWD: /home/dje/debian-jessie-s390x-1/debian > -s390x-native-extended-gdbserver/build/gdb/testsuite). > spawn /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/../gdbserver/gdbserver --once :2347 abspath > Can't bind address: Address already in use. > Exiting > Port 2347 is already in use. > spawn /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/../gdbserver/gdbserver --once :2348 abspath > Process /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.server/abspath/abspath created; pid = 21406 > Listening on port 2348 > target extended-remote localhost:2348 > Remote debugging using localhost:2348 > Reading /lib/ld64.so.1 from remote target... > warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. > Reading /lib/ld64.so.1 from remote target... > Reading symbols from target:/lib/ld64.so.1...Reading /lib/ld-2.19.so from remote target... > Reading /lib/.debug/ld-2.19.so from remote target... > (no debugging symbols found)...done. > 0x000003fffdfd9280 in ?? () from target:/lib/ld64.so.1 > Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses. > (gdb) break main > Breakpoint 1 at 0x800005bc: file /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.server/normal.c, line 23. > (gdb) continue > The program is not being run. > (gdb) FAIL: gdb.server/abspath.exp: continue to main (the program is no longer running) > Switching back to /home/dje/debian-jessie-s390x-1/debian-s390x-native-extended-gdbserver/build/gdb/testsuite. > ---------------- > > They're both running the testsuite in parallel mode (-j8), but when I > run it locally in parallel I can't reproduce (even when I run in a > loop). > > Anyway, I'll try to find out why this happens. I don't see how changing > the CWD in a test could impact its results, so I'm guessing there's > something else at play here. > > Thanks, > Maybe it's just because of this issue? Note the btrace-related error message. https://sourceware.org/ml/gdb-patches/2018-02/msg00352.html