Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4833867pxv; Tue, 27 Jul 2021 18:25:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWzbtrtQ6FfNo/oLPLLDptKYLDdCjodVLu2h1fF0hQVCvsjiuknkn1n0rIZIgMxWvUjjrN X-Received: by 2002:a6b:5115:: with SMTP id f21mr21667319iob.161.1627435513280; Tue, 27 Jul 2021 18:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627435513; cv=none; d=google.com; s=arc-20160816; b=oqsOsoP/FdENgM7wBM4zzDjc5wYeF3Q7R+MOD/gulCe1Fq2GabA02JYLvSi3RJy4o0 dxOGQG10toTwg4VKWu4KhQdyKdMHpDfVzQtonmFysOJPJPH9TG4NqhCGNdQyF76h+ege oYeOfWwvYnzHGxQ+D+dUdhrv7+2i6WKpSkq2Z9gzz7tvjs/Ax5xXwCL01C+sZI7equDm swUTkHZHwi9EG5ezDfp7cVNDxqndad5YZZ18UZ5bf3ZCinjXdSAB6IBi9cXm9U1/0Y6N PQO8zT8Puvf8QEQioOB5Arb59Ht9541U/ZEogPWzDU/q3WfX3Cy1y402mQ58YeJ+htja PLCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=qcOAmKZ6XlEpzxajr3df3EJ15DHZZ8RZdgiDKKttjE8=; b=tGSrRGELtQf7x+orARW6+41MjQG51nR1Ku2XVsvB0S6ExK512MGP0qtXlmIkekrgr9 8jZkHeakONT2XHBa6pnlTW4x0H8Sf9RAYxpV1NCz3kj4V3ha/75vtpJ4/4pSNv1BKR7+ He39GUgVjXYmh/mkHVpMSZj2Tar7YzrcouLxQgZ+UDvWcMMIP9NzeSMpa5P29wxp+0CF 9kPYkNe1kMRQPWQ9+r3e84SZp3e5pkBqfAz7tfkSUqyk4XpuTAUL8MmNZARA8LOaWZ9L o/ZNf6EreXKbf5LXKZjEKJIQW0Wbw4oWVLM/3nS2XrmoEk+M+J4IGgGL7Jet5mhoEtyW s7vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bphnyQef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si4615710ilk.74.2021.07.27.18.25.02; Tue, 27 Jul 2021 18:25:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bphnyQef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234187AbhG1BXh (ORCPT + 99 others); Tue, 27 Jul 2021 21:23:37 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:57557 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234038AbhG1BXg (ORCPT ); Tue, 27 Jul 2021 21:23:36 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 759333200754; Tue, 27 Jul 2021 21:23:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 27 Jul 2021 21:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=qcOAmK Z6XlEpzxajr3df3EJ15DHZZ8RZdgiDKKttjE8=; b=bphnyQefhT87xYqE1Dz+S+ BCwnhIlGXpb30wU14kB5j38Bz+p3TaPn7/oReiMP0t7HefZlzMMMtTSZOIhQHnCQ SpjD0QZh4PdYAipgYpWeq2Es0e5cXUWNTkM4ymvlwL9mHcp2mSP9fy9saHXwnzp9 gThzFyqSa1Debqy9sth+MA3Zj8R+nw5b5Pyl6gFsXnPriEWwBdRPe8KQVJXu+QFY Zh2t57Dn2Tfquw2phHKsw4B6aydecKsosHWlUiISJdlOUroTRxx9W+RqERRfFDcP 6Y/5Ml+jK/WFVRxwOho57YAzgJXLfxO58C88ZDiy6/wm1fzmTm0yA5f0mtaqEckA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeekgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvufgjkfhfgggtsehttdertddttddvnecuhfhrohhmpefhihhnnhcuvfhh rghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtth gvrhhnpeekveevtdekfedtfefhvdfgleelfefhtdefieetjeejvefghfdufeejkeehgfeu udenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepfhhthhgrihhnsehlihhnuhigqdhmieekkhdr ohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Jul 2021 21:23:29 -0400 (EDT) Date: Wed, 28 Jul 2021 11:23:24 +1000 (AEST) From: Finn Thain To: Al Viro cc: linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , Greg Ungerer , linux-kernel@vger.kernel.org Subject: Re: [RFC][CFT] signal handling fixes In-Reply-To: Message-ID: <689cf6b8-e8fc-dc35-9d47-2c3d3e6aafb1@linux-m68k.org> References: <5622d120-1b89-6898-d091-8b4ceff6418@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Jul 2021, Al Viro wrote: > On Tue, Jul 27, 2021 at 08:21:52PM +1000, Finn Thain wrote: > > On Sun, 25 Jul 2021, Al Viro wrote: > > > > > > > > The series is on top of 5.14-rc1; it lives in > > > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #untested.m68k > > > Individual patches in followups... > > > > > > _Very_ lightly tested on aranym; no real hardware to test it on. > > > Any help with review and testing would be very welcome. > > > > > > > I can test this branch on a Motorola 68040 machine I have here. Can you > > advise how to get decent code coverage? Maybe there's a package out there > > with a signal-heavy test suite? Maybe I need a break point in a signal > > handler? Or perhaps just send ^C to a process running under strace? > > Generally, SIGINT is not the best insertion vector... > True. I see that 'man 7 signal' says that SIGQUIT will produce a coredump. Would that contain anything of interest? > Set a handler of e.g. SIGALRM with sigaction(), with a couple of other signals > in sa_mask (e.g. SIGUSR1 and SIGUSR2). With raise() on those inside the > SIGALRM handler - then they will become deliverable on return from handler. > And have SIGUSR1 and SIGUSR2 handlers print siginfo and ucontext contents > (have them set with SA_SIGINFO in sa_flags, look at the second and third > arguments of sighandler). > > Use alarm(2) to arrange for SIGALRM and sit in a tight loop - that'll give you > delivery on return from interrupt. Alternatively, raise(SIGALRM) will give > you delivery on return from trap. And making that a SIGBUS handler instead, > mmapping a file, truncating it to 0 and dereferencing something in mmapped > area will give you delivery on return from access error trap. Division by > zero (and insertion handler on SIGFPE) ought to give you a type 2 exception > stack frame (4 bytes of aux data, that makes shifted exception frame bugger > format and vector fields of the original). > > FWIW, the third argument of handler points to > struct ucontext { > unsigned long uc_flags; > struct ucontext *uc_link; > stack_t uc_stack; > struct mcontext uc_mcontext; > unsigned long uc_filler[80]; > sigset_t uc_sigmask; /* mask last for extensibility */ > }; > and type/vector is stored in uc_filler[54] (216 bytes into the array), with > aux data from exception stack frame starting from uc_filler[55]. > OK, give me a week or so and I'll see what I can come up with.