From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.2 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 5F199207EC for ; Wed, 5 Oct 2016 10:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbcJEKuQ (ORCPT ); Wed, 5 Oct 2016 06:50:16 -0400 Received: from mout.gmx.net ([212.227.17.22]:51368 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbcJEKuP (ORCPT ); Wed, 5 Oct 2016 06:50:15 -0400 Received: from virtualbox ([37.24.142.40]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MVIva-1bOWyv1pug-00YhCo; Wed, 05 Oct 2016 12:49:51 +0200 Date: Wed, 5 Oct 2016 12:49:48 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: writeonce@midipix.org cc: musl@lists.openwall.com, git@vger.kernel.org, Jeff King Subject: RE: [musl] Re: Regression: git no longer works with musl libc's regex impl In-Reply-To: <20161004200057.dc30d64f61e5ec441c34ffd4f788e58e.efa66ead67.wbe@email15.godaddy.com> Message-ID: References: <20161004200057.dc30d64f61e5ec441c34ffd4f788e58e.efa66ead67.wbe@email15.godaddy.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:c5EjhnIrtFZOI5WTEGnHVQEOoAV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ger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi writeonce, On Tue, 4 Oct 2016, writeonce@midipix.org wrote: > < On Tue, 4 Oct 2016, Rich Felker wrote: > < > < > On Tue, Oct 04, 2016 at 11:27:22AM -0400, Jeff King wrote: > < > > On Tue, Oct 04, 2016 at 11:08:48AM -0400, Rich Felker wrote: > < > > > < > > > 1. is nonzero mod page size, it just works; the remainder of the > < > > > last page reads as zero bytes when mmapped. > < > > > < > > Is that a portable assumption? > < > > < > Yes. > < > < No, it is not. You quote POSIX, but the matter of the fact is that we > < use a subset of POSIX in order to be able to keep things running on > < Windows. > > As far as I can tell (and as the attached program may help demonstrate), > the above assumption has been valid on all versions of Windows since at > least Windows 2000. And since W2K is already past its end of life, it would be safe for practical considerations. However, I have to add two comments to that: - it is *not* guaranteed. The behavior is undefined, even if you see consistent behavior so far. Future Windows versions might break that assumption freely, though. - some implementations of the REG_STARTEND feature have the nice property that they can read past NUL characters. Granted, not all of them do (AFAIU one example is FreeBSD itself, the first platform to sport REG_STARTEND), but we at least reap the benefit whenever using a regex that *can* read past NUL characters. > In this context, one thing to remember is that the page-size for the mod > operation is 4096, whereas the POSIX page-size (for the purpose of mmap > and mremap) is 65536. Indeed. A colleague of mine spotted the segfault when diffing a file that was *exactly* 4,096 bytes. > Note also that in the case of file-backed mapped sections, using > kernel32.dll or msvcrt.dll or cygwin/newlib or midipix/musl is of little > significance, specifically since all invoke ZwCreateSection and > ZwMapViewOfSection under the hood. Right. It's all backed by the very same kernel functions. Ciao, Johannes