X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44423384F032
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1676921950;
	bh=1cxmOu4mwl3Iksy/CT84JlCT8yKhDUYdIrOBnxZg228=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=CeAkuBK7YC+BhhbzMrMWa0ySNiSmfAkEw2oaJF5Op0RiYlwxOSICekq1K10wL3O0T
	 cemRqxCkY8D6OCjEjyRwE5HSSsp1xboVatJi/9Y3ct2M6Zm8v3Cjw1QUfZf6If1+4o
	 SS8dpSpA1ULO0p1ULTkZIIGOrKAwwsEZbe7gHp0A=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 066DD385B51F
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: <bdd34a5a-b733-ede7-c371-8c1d2fea9d5d@Shaw.ca>
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
Subject: Re: I discovered the problems why the program I'm trying to port
 crashed
Content-Language: en-CA
To: cygwin@cygwin.com
References: <bEc_juo0ZomxwHLHf1mKfbz_S9hMzlkUU691bG-cOPnyCDtaXjdjxwpMgZbbxq0ljP1LU4qJGYOr2IMwKRBmNzsU5bEqovMtZ37aqQOEUXY=@protonmail.com>
Organization: Inglis
In-Reply-To: <bEc_juo0ZomxwHLHf1mKfbz_S9hMzlkUU691bG-cOPnyCDtaXjdjxwpMgZbbxq0ljP1LU4qJGYOr2IMwKRBmNzsU5bEqovMtZ37aqQOEUXY=@protonmail.com>
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
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Brian Inglis <Brian.Inglis@Shaw.ca>,
        w6b7rk5yu4mt25v3 <w6b7rk5yu4mt25v3@protonmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 31KJdWYZ014868

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

