From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36830 invoked by alias); 4 Jul 2018 11:19:34 -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 36812 invoked by uid 89); 4 Jul 2018 11:19:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mailout2.w1.samsung.com Received: from mailout2.w1.samsung.com (HELO mailout2.w1.samsung.com) (210.118.77.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jul 2018 11:19:31 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180704111928euoutp024aa511c7a2c8250b733a259018a10537~_Jmv1W1dV2015520155euoutp02d for ; Wed, 4 Jul 2018 11:19:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180704111928euoutp024aa511c7a2c8250b733a259018a10537~_Jmv1W1dV2015520155euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1530703168; bh=DnYRrgX4dp1cdfaEz1uVvL23Ajg+Zo5DP9rtKQU4Xuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bWJ8kUKBq26fsvqkyhOymSQdZavfKMSNhdgebU/WDcfhmJlz1UN0mlH6Zgs0n6wcH NOXwf0I+Fabpq7n4zNAghyRQKXKpl+hdRgueXuqnaJpcAHpwTBVpU34kq3Hrdu7Soa fpU/GilsXSJu9zk9lhbQX9f74tb6Jp+Jh4mkga5I= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180704111927eucas1p23c8916339421b29dd393d0e69e39d053~_Jmuwpp1H2605326053eucas1p2y; Wed, 4 Jul 2018 11:19:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id EA.2B.05700.E3DAC3B5; Wed, 4 Jul 2018 12:19:26 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180704111926eucas1p13d4a3f7ef6ca0341162da4dab2b80770~_Jmt0fTkD2770727707eucas1p1K; Wed, 4 Jul 2018 11:19:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180704111926eusmtrp2ebfd4bf986d6b4cd53a2812197818303~_Jmtz62-u0120801208eusmtrp2m; Wed, 4 Jul 2018 11:19:26 +0000 (GMT) Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EE.F9.04183.E3DAC3B5; Wed, 4 Jul 2018 12:19:26 +0100 (BST) Received: from vbarinov (unknown [106.109.129.54]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180704111925eusmtip2ea1274e405c5b33e80bcd36357845853~_JmspdPEk0362703627eusmtip2s; Wed, 4 Jul 2018 11:19:24 +0000 (GMT) Received: by vbarinov (sSMTP sendmail emulation); Wed, 04 Jul 2018 14:19:27 +0300 From: Vyacheslav Barinov To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Check if /proc is usable on gdbserver start Date: Wed, 04 Jul 2018 11:19:00 -0000 In-Reply-To: <85d64cca-716b-b098-dc1c-b5a3e978fe3e@redhat.com> (Pedro Alves's message of "Wed, 4 Jul 2018 10:57:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Message-Id: <20180704111926eucas1p13d4a3f7ef6ca0341162da4dab2b80770~_Jmt0fTkD2770727707eucas1p1K@eucas1p1.samsung.com> X-CMS-MailID: 20180704111926eucas1p13d4a3f7ef6ca0341162da4dab2b80770 X-Msg-Generator: CA X-RootMTR: 20180704073447eucas1p1541c2021074eb8faa58e49f1abe8d733 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180704073447eucas1p1541c2021074eb8faa58e49f1abe8d733 References: <20180704073447eucas1p1541c2021074eb8faa58e49f1abe8d733~_GikXtils0124801248eucas1p1n@eucas1p1.samsung.com> <85d64cca-716b-b098-dc1c-b5a3e978fe3e@redhat.com> X-SW-Source: 2018-07/txt/msg00084.txt.bz2 Pedro Alves writes: > On 07/04/2018 08:34 AM, Vyacheslav Barinov wrote: >> Hello, >> >> Just lost a couple of hours trying to find while gdb can't connect to gdbserver >> in my debug session. >> >> There's a buildroot where I want to debug a binary, and I tried to connect to >> it from outside, but got very weird errors like architecture mismatch or >> protocol errors. At last, after switching on '--debug' for gdbserver I found a >> message 'Can't open /proc/pid/' message and suddenly found that I forgot to >> mount procfs in my buildroot. >> >> I think it's better to check this before running gdbserver. > I'm not certain that it's a good idea to absolute require a /proc mount. > Even though we gradually moved into relying on /proc more (or better said, on > libthread_db less), over the years we've also tried to be tolerant to > missing /proc. I believe people had use cases for that (very constrained > containers or embedded systems? I don't recall exactly though...) > > I assume that you're on either Aarch64 or x86_64 and that the architecture > mismatch is because gdbserver couldn't determine whether the process > was a 64-bit process, because that is done by reading the /proc/PID/exe > file. Maybe other 32-bit- or 64-bit-only archs still minimally work > without /proc. > > I'm thinking that it may be prudent to downgrade this to a warning. > Would that work for you? > > Thanks, > Pedro Alves You are right, I use x86_64 architecture. Okay, if the gdbserver can work without /proc, then just warning for cases like this is enough. Best Regards, Vyacheslav Barinov