public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: w6b7rk5yu4mt25v3 <w6b7rk5yu4mt25v3@protonmail.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Fw: Re: Fw: Re: Fw: Re: Why do these mprotect always fail?
Date: Sun, 19 Feb 2023 15:40:40 +0000	[thread overview]
Message-ID: <Mw5ZwraP57eZm8KVow8mO9_G9MUG1HxM76CHotK7rmIPG5Hn_uXu9AK77O7MXKd4Tw25hJSzdSFu8WKR6hiA-HtogekHAlJLixJFtRGytPY=@protonmail.com> (raw)
In-Reply-To: <2sLxaK-alDruU1hBajs4HCL82MYIxVHQqam2ogOcvGixLJ8yhI1avBVKiKANKAL-nLPBqLdkttsufxIpZ9cupOz3tPgT8heQSbIp0XmVT4s=@protonmail.com>

Please have a look at the strace result. I still think it's Cygwin's bug.

Sent with Proton Mail secure email.

------- Forwarded Message -------
From: w6b7rk5yu4mt25v3 <w6b7rk5yu4mt25v3@protonmail.com>
Date: On Sunday, February 19th, 2023 at 20:08
Subject: Re: Fw: Re: Fw: Re: Why do these mprotect always fail?
To: cygwin@cygwin.com <cygwin@cygwin.com>


> See strace:
> 
> 544091 601347 [main] obr 1831 mprotect: mprotect (addr: 0xA00100000, len 65536, prot 0x7)
> 59 601406 [main] obr 1831 mprotect: 0 = mprotect ()
> 166 601572 [main] obr 1831 mmap: addr 0x0, len 327680, prot 0x3, flags 0x22, fd -1, off 0x0
> 123 601695 [main] obr 1831 mmap: 0x6FFFFFFB0000 = mmap()
> 95 601790 [main] obr 1831 mprotect: mprotect (addr: 0x6FFFFFFC0000, len 196608, prot 0x7)
> 88 601878 [main] obr 1831 mprotect: 0 = mprotect ()
> 255 602133 [main] obr 1831 mmap: addr 0x0, len 393216, prot 0x3, flags 0x22, fd -1, off 0x0
> 102 602235 [main] obr 1831 mmap: 0x6FFFFFF50000 = mmap()
> 108 602343 [main] obr 1831 mprotect: mprotect (addr: 0x6FFFFFF60000, len 262144, prot 0x7)
> 47 602390 [main] obr 1831 mprotect: 0 = mprotect ()
> 245 602635 [main] obr 1831 mmap: addr 0x0, len 458752, prot 0x3, flags 0x22, fd -1, off 0x0
> 44 602679 [main] obr 1831 mmap: 0x6FFFFFEE0000 = mmap()
> 46 602725 [main] obr 1831 mprotect: mprotect (addr: 0x6FFFFFEF0000, len 327680, prot 0x7)
> 39 602764 [main] obr 1831 mprotect: 0 = mprotect ()
> --- Process 3796 (pid: 1831), exception c0000005 at 0000000a00100061
> --- Process 3796 (pid: 1831) thread 2928 exited with status 0xc0000005
> --- Process 3796 (pid: 1831) exited with status 0xc0000005
> Segmentation fault
> 
> I still think it's Cygwin's bug.
> 
> Sent with Proton Mail secure email.
> 
> 
> ------- Original Message -------
> On Wednesday, February 15th, 2023 at 23:33, Corinna Vinschen corinna-cygwin@cygwin.com wrote:
> 
> 
> 
> > 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

  reply	other threads:[~2023-02-20 10:29 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                 ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-02-19 13:08                 ` w6b7rk5yu4mt25v3
2023-02-19 15:40                   ` w6b7rk5yu4mt25v3 [this message]
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='Mw5ZwraP57eZm8KVow8mO9_G9MUG1HxM76CHotK7rmIPG5Hn_uXu9AK77O7MXKd4Tw25hJSzdSFu8WKR6hiA-HtogekHAlJLixJFtRGytPY=@protonmail.com' \
    --to=w6b7rk5yu4mt25v3@protonmail.com \
    --cc=cygwin@cygwin.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).