public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>,
	w6b7rk5yu4mt25v3 <w6b7rk5yu4mt25v3@protonmail.com>
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Subject: RE: [EXTERNAL] Re: Fw: Re: Fw: Re: Why do these mprotect always fail?
Date: Wed, 15 Feb 2023 17:20:24 +0000	[thread overview]
Message-ID: <DM8PR09MB7095571636E9EB68362971F5A5A39@DM8PR09MB7095.namprd09.prod.outlook.com> (raw)
In-Reply-To: <Y+0JTyNpVqvpZvW0@calimero.vinschen.de>

> 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.gov@cygwin.com> On Behalf Of Corinna
> Vinschen via Cygwin
> Sent: Wednesday, February 15, 2023 11:33 AM
> To: w6b7rk5yu4mt25v3 <w6b7rk5yu4mt25v3@protonmail.com>
> Cc: Corinna Vinschen <corinna-cygwin@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.


  reply	other threads:[~2023-02-15 17:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  9:38 w6b7rk5yu4mt25v3
2023-02-15  9:43 ` w6b7rk5yu4mt25v3
2023-02-15 10:32   ` Corinna Vinschen
2023-02-15 11:14     ` Fw: " w6b7rk5yu4mt25v3
2023-02-15 12:13       ` Corinna Vinschen
2023-02-15 12:40         ` w6b7rk5yu4mt25v3
2023-02-15 13:02           ` Oskar Skog
2023-02-15 15:31             ` Fw: " w6b7rk5yu4mt25v3
2023-02-15 16:33               ` Corinna Vinschen
2023-02-15 17:20                 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] [this message]
2023-02-19 13:08                 ` w6b7rk5yu4mt25v3
2023-02-19 15:40                   ` Fw: " w6b7rk5yu4mt25v3
2023-02-15 13:41           ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8PR09MB7095571636E9EB68362971F5A5A39@DM8PR09MB7095.namprd09.prod.outlook.com \
    --to=lavr@ncbi.nlm.nih.gov \
    --cc=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    --cc=w6b7rk5yu4mt25v3@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).