From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91900 invoked by alias); 17 Oct 2017 17:37:25 -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 91865 invoked by uid 89); 17 Oct 2017 17:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=offering, journal, tweaking 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; Tue, 17 Oct 2017 17:37:24 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9HHaqGO143740 for ; Tue, 17 Oct 2017 13:37:22 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dnkvxyjjh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 17 Oct 2017 13:37:14 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Oct 2017 18:36:20 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Oct 2017 18:36:18 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9HHaIpG27394234; Tue, 17 Oct 2017 17:36:18 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC9C142049; Tue, 17 Oct 2017 18:31:51 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CB0B42042; Tue, 17 Oct 2017 18:31:51 +0100 (BST) Received: from oc1027705133.ibm.com (unknown [9.152.212.164]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 17 Oct 2017 18:31:51 +0100 (BST) From: Andreas Arnez To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] GDB test suite: Get core files on targets with systemd-coredump References: <1505760152-28775-1-git-send-email-arnez@linux.vnet.ibm.com> <1505760152-28775-3-git-send-email-arnez@linux.vnet.ibm.com> <38b0202f-5c78-a8bb-7bc8-e86f3a02ca33@redhat.com> Date: Tue, 17 Oct 2017 17:37:00 -0000 In-Reply-To: <38b0202f-5c78-a8bb-7bc8-e86f3a02ca33@redhat.com> (Pedro Alves's message of "Tue, 17 Oct 2017 11:22:28 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 17101717-0020-0000-0000-000003C1BB9C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101717-0021-0000-0000-000042564192 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-17_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710170248 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00536.txt.bz2 On Tue, Oct 17 2017, Pedro Alves wrote: > On 09/18/2017 07:41 PM, Andreas Arnez wrote: >> So far the test suite skips tests if they need system-generated core files >> and the core files can not be found. In particular this is usually the >> case on systems with an active systemd-coredump service. On such systems, >> core files are not written into the local directory, but made accessible >> via a command-line utitily "coredumpctl" instead. >> >> This patch enables processing core files on such systems as well. Note >> that there are a few quirks: >> >> * In my tests, after invoking a command that dumps core, it could happen >> that "coredumpctl" did not find the dump immediately afterwards. After >> waiting a bit, the dump was found and could be accessed. Thus the patch >> performs a single wait-and-retry in case of failure. >> >> * There does not seem to be a way for a user to remove specific core dumps >> from the journal. Thus it can happen that "coredumpctl" returns an old >> dump, and the test case continues with that instead of the new one. It >> might be possible to improve the logic here, by considering the time >> stamps as well. I leave that for a future patch. >> >> * On the system I've tested it on, the bigcore.exp test case still failed >> because coredumpctl truncated the core file after 4G for some reason. > > I'm a bit unsure about whether this is the right approach, > expecially given the caveats above. Also, this seems to mean that > running the testsuite on such a system clutters the system log on and on, > maybe even triggers dispatch of notifications to admins, etc. The caveats above are really bugs/design flaws of systemd-coredump. If nothing else, maybe this discussion helps addressing them. Offering no way to prevent system log cluttering could be viewed as another flaw, see also below. > I wonder whether there's a way to tell systemd-coredump to > let the core dumps be generated on the file system for the current > shell environment? Like we try to run "ulimit -c unlimited". I agree that there *should* be such a way -- but I haven't found any. And such a mechanism should probably allow suppressing the log entries as well. > Failing that, it may be better to instead make the testsuite skip > the tests gracefully, and display a big and visible warning > if systemd-coredump is detected as active. This might be the right trade-off if we expect test cases to be executed only on systems that the user has full control over. But I consider this restriction too tight and would prefer a "best effort" approach instead. Maybe we should emit a warning *and* try our best to execute the test? > I mean, you already have to tweak other things in the system in > order to be able to run the testsuite correctly. For example, > you have to tweak /proc/sys/kernel/yama/ptrace_scope to make > attach tests work at all, for example. systemd-coredump kind of > seems like more of the same. So should we document a sequence of admin commands that makes a system debug-ready, or in particular ready for the GDB test suite? But I'm not so sure about this. IMHO a default mainstream Linux installation should be suited for development- and debugging purposes *without* any tweaking. Also, if there are good reasons for a security measure, we shouldn't rely on disabling it globally. With respect to Yama's ptrace scope, the distributions seem to differ. For instance, Fedora does not activate it by default (https://fedoraproject.org/wiki/Security_Features_Matrix), while Ubuntu does (https://wiki.ubuntu.com/Security/Features). And I wonder whether this feature couldn't be adjusted to be more debug-friendly either. -- Andreas