X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAD10385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1676463264; bh=vtvsToTrk09TR8UytasiXBqm4Tm4UXcW7PBfs+eEcc0=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=K8uhVGY1q7NWwaDlXBV0JKhMZ7qgu8iGVYNDoDH8/Hasmm+XLFs1SWHZtXYL2SL2Q UNpkh6N8GJBg1GwzhW35CFQpjfLp13BXwYcsvGoFrYhThq8Vn1pG1vI1HE1CrPOkv/ kKR0SW3iLXbIyUyzu0NZmxf/da7Q8i7Ube4vGAo0= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com Date: Wed, 15 Feb 2023 13:13:36 +0100 To: cygwin AT cygwin DOT com Subject: Re: Fw: Re: Why do these mprotect always fail? Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com, w6b7rk5yu4mt25v3 References: MIME-Version: 1.0 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 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen , w6b7rk5yu4mt25v3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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 -- 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