From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id 066DD385B51F for ; Mon, 20 Feb 2023 19:38:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 066DD385B51F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=Shaw.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id U03xpUBc6uZMSUBzcpkzad; Mon, 20 Feb 2023 19:38:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1676921912; bh=vT5wiNHH76mHpuaezWA3vPgqimdR9R1XiKgPYh0jgi0=; h=Date:Reply-To:Subject:To:References:From:Cc:In-Reply-To; b=vxRf6BMqixET26gY4eXmpgunVGHng+d+228zDc3pEgR0tfKGZ0HPV1ZIgd14Uw1pP FbRdCYRaNI9pjcQW1jRoTEu8cviDZRK6JUJH41fWjPkjP6+Ty6srH3FTiLmOnqr9nY Y+c81uSSGipd+9n2ASs5VTgU5MgCzKE2FraLbEZpAd4/cnIxEH3n/SWeChiL/bHupQ e3TDuCIr6E4ipiFmn0pmgfIifvQIC3Jw9YJs+Pg1b1QcJFVcODZva2P8SCquwEdLbC FbN8cHZp5hPzTqh9L8rX89BiS4HrG2xVtSThpC49UAfWLAbRUJskiQnBf3ZcJ/VgdK 76Hpl0lIvTvtg== Received: from [10.0.0.5] ([184.64.102.149]) by cmsmtp with ESMTP id UBzbpBhq23fOSUBzbpnyGt; Mon, 20 Feb 2023 19:38:32 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=63f3cc38 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=NzuefvZ60yVOcrIq:21 a=IkcTkHD0fZMA:10 a=w_pzkKWiAAAA:8 a=7392p9bmP1SmsWvOWsUA:9 a=QEXdDO2ut3YA:10 a=JGqyjehkK1gA:10 a=8r4gX4F_h0Kx79movRPd:22 a=sRI3_1zDfAgwuvI8zelB:22 Message-ID: Date: Mon, 20 Feb 2023 12:38:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Reply-To: cygwin@cygwin.com Subject: Re: I discovered the problems why the program I'm trying to port crashed Content-Language: en-CA To: cygwin@cygwin.com References: From: Brian Inglis Organization: Inglis Cc: w6b7rk5yu4mt25v3 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfMhmaDHaQ94cMM/suSAvRaj6btVuGAwX3eEYwv6OQgpedPSOo7siW76ZE5VV6L4JiuvVDiaSMRX67NAz4SX6OlR1uWICAhIdTqRMfkSySd/vLcj9KFB1 K3592aOkEbVsDDYFOdN0ChkbfSmSmelc95xNvm42O8bIf0uiBgLeJnfcO49KsL0RCynAmUffOlJI6LGH8xcFTmzNWcyI5WGsJOKbiGCs4e07O624b/U7EhzQ X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-02-19 09:56, w6b7rk5yu4mt25v3 via Cygwin wrote: > Quoted from https://cygwin.com/pipermail/cygwin-cvs/2020q3/014516.html: > > "The file mapping will be only a single page, 4K, and since 64 bit systems don't support the AT_ROUND_TO_PAGE flag, the remainder of the 64K slot will result in a SEGV when accessed." > > "The justification is that there's very likely no application actually utilizing the map beyond EOF, and we know that all bytes beyond EOF are set to 0 anyway." > > Unfortunately, the application I'm trying to port do exactly that. If you set JIT_PAGE_SIZE to 64k (same as PAGE_SIZE) to satisfy mprotect then it will expect the whole 64k to be accessible. On other systems, no problems. On Cygwin, crashed with segmentation fault. I was right. Not the application's bug, but Cygwin's quirk (I called it as a quirk but not a bug, because it's a limitation of the platform). SMOP: YMMV Round up the page size yourself and allocate that value if allocation round up not supported on platform or version. I think if 1 byte is mapped, access to byte 2 should be SEGV/UB/)\;`a__! )/ /-." ~~ sb/dwb > Goodbye. It's better to use WSL directly than messing with Cygwin nowadays. For small amounts of Windows interoperability with MS "Linux". May be useful for comparing compatibility, but so are VMs, with fewer MS "quirks". -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry