I discovered the problems why the program I'm trying to port crashed

w6b7rk5yu4mt25v3 w6b7rk5yu4mt25v3@protonmail.com
Sun Feb 19 16:56:15 GMT 2023

Quoted from https://cygwin.com/pipermail/cygwin-cvs/2020q3/014516.html:

"The file mapping will be only a single page, 4K, and since 64 bit systems don't support the AT_ROUND_TO_PAGE flag, the remainder of the 64K slot will result in a SEGV when accessed."

"The justification is that there's very likely no application actually utilizing the map beyond EOF, and we know that all bytes beyond EOF are set to 0 anyway."

Unfortunately, the application I'm trying to port do exactly that. If you set JIT_PAGE_SIZE to 64k (same as PAGE_SIZE) to satisfy mprotect then it will expect the whole 64k to be accessible. On other systems, no problems. On Cygwin, crashed with segmentation fault. I was right. Not the application's bug, but Cygwin's quirk (I called it as a quirk but not a bug, because it's a limitation of the platform).

Goodbye. It's better to use WSL directly than messing with Cygwin nowadays.

Sent with Proton Mail secure email.

More information about the Cygwin mailing list