From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by sourceware.org (Postfix) with ESMTPS id 0D4C83858D33 for ; Wed, 15 Feb 2023 12:13:40 +0000 (GMT) Authentication-Results: sourceware.org; dmarc=permerror header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MVdUQ-1p0jLx2ciq-00RZC1; Wed, 15 Feb 2023 13:13:37 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 5D1B0A81B74; Wed, 15 Feb 2023 13:13:36 +0100 (CET) Date: Wed, 15 Feb 2023 13:13:36 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Cc: w6b7rk5yu4mt25v3 Subject: Re: Fw: Re: Why do these mprotect always fail? Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com, w6b7rk5yu4mt25v3 References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:mhLOEo1KZoJzF+dgjOKjAu1avM5qba9pbFQVAzJ8Rp8jWdzI4Kr 11lfvkZrC2ykiMA82unR1odi+JEMHA4nv5LvBcf2KlGWqHMGLpJlmXMughP9ngegWHKqZaD yLqh8s9TmlqqMT+YveNxj1VMxhoWu7H0rweSjjX0j8nkOa0jCsEz5GG1MSrtGeCP8jFoQ+A ofgf+RPzgOYr6/5/uOGfg== UI-OutboundReport: notjunk:1;M01:P0:mvlYxxwMrps=;qEiGMXZKtHOgR2FTt4EVBsTCtWl Q2KsAUAxDsipc1AQRIYnLIqtTlITGyvx+t6nYeUGRc2WFz6K4LI8HXIQf915EjvSNdFKRtQIg gYFC+IkJ6+2fatJ4OEDRBTtbtiYJO94QbKtIFnBDoTRDBT0WpvC64bT3QNz5psnhPytiooguA O1stW/dzP2UdnO1unYT5FPHjdHDkPgolmxNnoakVIfHgRE/hg40RuC3k04DvpI+N4mA5GjKra eEvDjj5vzmXF/vx957daVDWJ9GQPpmqj2dOr855b5NWSVUkbaXZUywit4bQNuhgIiw321sp4E nK8Kh0fr63uLAPV4SywUsm5gMWLDc7slt3YbTHeVxfiIJdEBj9ETJ272TAHb+JtTdKM/QGoxg lY94jcZGcLDmPXIPcxVAtrL8zy1P9hTEPp6PJIqKRfG1md9ok74hW7Hd2VPM5EFUNqVd31HL5 DiGPhuKJ/qMSj8NwybMt6KjgL3nRntVvqjcyejvJaGQuF5uIzYYDwdp51iBn7gZCY9m2ANFpc 7bTHrzz8Zdxcn6ZkVRW/0WF29FTmt8AgnHbscEYdn9HcNjbHDDR2wUxf+zX53cOF/1iUxqp/q akf7HuWt+LR2muMmFzhIF3UF45fCfTfLU//+MwMIWhAYge1p6RqoDUGF05kfuw3K8saDkrjxj 7zCa6bkbBk0iApwV0xup1UT47oEaGfEzykTdewOCWQ== X-Spam-Status: No, score=-97.4 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_FAIL,SPF_HELO_NONE,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 Feb 15 11:14, w6b7rk5yu4mt25v3 via Cygwin wrote: > Corinna Vinschen wrote: > > > cygwin-developers is for developers woking on Cygwin itself, not for > > developers using Cygwin to develop something else. I dropped the ML > > from the recipient list. > > > > And please don't top-post. Thanks. > > > > On Feb 15 09:43, w6b7rk5yu4mt25v3 via Cygwin wrote: > > > > > Almost forgot, PAGE_SIZE is set to 4096. This is a Linux application, > > > when I compile on Cygwin it complained that PAGE_SIZE is redefined but > > > the compilation was success nevertheless. Only when I run the > > > application, I always exited with "Unable to mprotect". > > > > > > PAGESIZE is 64K on Cygwin. If you change that, it breaks and you can > > keep the pieces. > > > > It would be nice to send a complete, self-contained STC() in plain C, > > so reproducing your issue is simple and doesn't require to rework > > your code to get a running, debuggable testcase. > > PAGE_SIZE is just a naming conflict. If you change it to something > else, JIT_PAGE_SIZE for example, it still fails. You're misunderstanding what PAGESIZE or PAGE_SIZE means. It's the system page size used for mappings, and it's a fixed value defined by the system and provided to you by the system headers and, especially, sysconf(_SC_PAGE_SIZE). It's *NOT* something you can just change and think the result will still work. Especially given that mmap doesn't know that you changed a macro in your application code... > The problem is Cygwin > is not fine with the particular value 4096 but the program needs the > value to be exactly 4096. Sorry, but that can't work. If the program actually demands it, it's non-portable. Corinna