> I still think it's a bug in the code which requires some debugging effort > on your side.
I think that OP does not understand that the page size constant is a property of the platform, and not something that can be redefined at will even though it's a macro. > > #ifndef __CYGWIN__ > > #define PAGE_SIZE 4096 > > #endif If anything, IMO the conditional should look like: #ifndef PAGE_SIZE #define PAGE_SIZE 4096 #endif and only used after all necessary headers that might define PAGE_SIZE on a particular platform (or all platforms that the code is supposed to be run on), have been already included. $.02 Anton Lavrentiev Contractor NIH/NLM/NCBI > -----Original Message----- > From: Cygwin <cygwin-bounces+lavr=ncbi.nlm.nih....@cygwin.com> On Behalf Of > Corinna > Vinschen via Cygwin > Sent: Wednesday, February 15, 2023 11:33 AM > To: w6b7rk5yu4mt25v3 <w6b7rk5yu4mt2...@protonmail.com> > Cc: Corinna Vinschen <corinna-cyg...@cygwin.com>; cygwin@cygwin.com > Subject: [EXTERNAL] Re: Fw: Re: Fw: Re: Why do these mprotect always fail? > > On Feb 15 15:31, w6b7rk5yu4mt25v3 via Cygwin wrote: > > I asked the developer of the interpreter. He said it's OK to use the > > PAGE_SIZE value > different than 4096. So I used this dirty hack: > > > > #ifndef __CYGWIN__ > > #define PAGE_SIZE 4096 > > #endif > > > > This means on Cygwin it will use the default PAGE_SIZE defined on limits.h > > (I'm taking > advantage of the naming conflict here so I don't have to rename PAGE_SIZE to > JIT_PAGE_SIZE > as suggested by the developer of the interpreter). > > > > The result is it's no longer error with "Unable to mprotect" but will > > silently crashed without any error messages printed on the screen. So > > after all, it's Cygwin's quirks here. > > I still think it's a bug in the code which requires some debugging effort > on your side. > > Having said that, if it's actually a Cygwin bug and you want it fixed, > please provide a *simple*, self-contained testcase in plain C, with a > minimum of code to reproduce the issue, and which compiles OOTB. > > > Corinna > > -- > Problem reports: > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcygwin.com%2Fproblems.ht > ml&data=05%7C01%7Clavr%40ncbi.nlm.nih.gov%7C123073164bd640013e1b08db0f7270d6%7C14b77578977 > 342d58507251ca2dc2b06%7C0%7C0%7C638120756411216141%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA > wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xGvkoh2uUrmyDUWi > GeWSvPK9FUOclLRDeAzj0Omb7tM%3D&reserved=0 > FAQ: > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcygwin.com%2Ffaq%2F&data > =05%7C01%7Clavr%40ncbi.nlm.nih.gov%7C123073164bd640013e1b08db0f7270d6%7C14b77578977342d585 > 07251ca2dc2b06%7C0%7C0%7C638120756411216141%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC > JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=A0S3Y%2FH3SplYCgZyvLJGS > SNLefPZ9w%2FG%2FC0yMbZbU7g%3D&reserved=0 > Documentation: > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcygwin.com%2Fdocs.html&d > ata=05%7C01%7Clavr%40ncbi.nlm.nih.gov%7C123073164bd640013e1b08db0f7270d6%7C14b77578977342d > 58507251ca2dc2b06%7C0%7C0%7C638120756411216141%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDA > iLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EOWoOQyBbNc0QxaF1%2B > kcmgHHwHsPEEvuXTnzV1gdh34%3D&reserved=0 > Unsubscribe info: > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcygwin.com%2Fml%2F%23uns > ubscribe- > simple&data=05%7C01%7Clavr%40ncbi.nlm.nih.gov%7C123073164bd640013e1b08db0f7270d6%7C14b7757 > 8977342d58507251ca2dc2b06%7C0%7C0%7C638120756411216141%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4 > wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5lX8vOlyCMW6 > 4rxLXtdKPHs6thdr9sB5VlyRZw8MNKY%3D&reserved=0 > CAUTION: This email originated from outside of the organization. Do not click > links or > open attachments unless you recognize the sender and are confident the > content is safe. -- 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