From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13543 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.linux.lib.musl.general Subject: Re: aio_cancel segmentation fault for in progress write requests Date: Sat, 08 Dec 2018 17:18:13 +0100 Message-ID: <87in049em2.fsf@oldenburg2.str.redhat.com> References: <20181207154419.GD23599@brightrain.aerifal.cx> <20181207165217.GE23599@brightrain.aerifal.cx> <54b4d253-1660-3207-5d59-f23f1c25b2b9@adelielinux.org> <20181207182650.GF23599@brightrain.aerifal.cx> <87h8fpaypx.fsf@oldenburg2.str.redhat.com> <20181207201453.GH23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544285785 19446 195.159.176.226 (8 Dec 2018 16:16:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2018 16:16:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-13559-gllmg-musl=m.gmane.org@lists.openwall.com Sat Dec 08 17:16:21 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gVfHA-0004yY-PK for gllmg-musl@m.gmane.org; Sat, 08 Dec 2018 17:16:20 +0100 Original-Received: (qmail 6072 invoked by uid 550); 8 Dec 2018 16:18:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 6049 invoked from network); 8 Dec 2018 16:18:28 -0000 In-Reply-To: <20181207201453.GH23599@brightrain.aerifal.cx> (Rich Felker's message of "Fri, 7 Dec 2018 15:14:53 -0500") X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 08 Dec 2018 16:18:16 +0000 (UTC) Xref: news.gmane.org gmane.linux.lib.musl.general:13543 Archived-At: * Rich Felker: > On Fri, Dec 07, 2018 at 09:06:18PM +0100, Florian Weimer wrote: >> * Rich Felker: >> >> > I don't think so. I'm concerned that it's a stack overflow, and that >> > somehow the kernel folks have managed to break the MINSIGSTKSZ ABI. >> >> Probably: >> >> >> >> >> It's a nasty CPU backwards compatibility problem. Some of the >> suggestions I made to work around this are simply wrong; don't take them >> too seriously. >> >> Nowadays, the kernel has a way to disable the %zmm registers, but it >> unfortunately does not reduce the save area size. > > How large is the saved context with the %zmm junk? I measured just > ~768 bytes on normal x86_64 without it, and since 2048 is rounded up > to a whole page (4096), overflow should not happen until the signal > context is something like 3.5k (allowing ~512 bytes for TCB (~128) and > 2 simple call frames). I wrote a test to do some measurements: The signal handler context is quite large on x86-64 with AVX-512F, indeed around 3.5 KiB. It is even larger on ppc64 and ppc64el (~4.5 KiB), which I find somewhat surprising. The cancellation test also includes stack usage from the libgcc unwinder. Its stack usage likely differs between versions, so I should have included that in the reported results. Thanks, Florian