Procedure for cherry-picking

2024-09-11 Thread Ken Brown
I've been away from Cygwin development for a while, and I've forgotten (or never knew) the conventional way of cherry-picking a commit from the main branch to the cygwin-3_5 branch. Here's the context: Last February it was discovered that a build of Cygwin with -Og failed because of some gcc

Re: Procedure for cherry-picking

2024-09-12 Thread Ken Brown
On 9/12/2024 9:20 AM, Jon Turney wrote: On 12/09/2024 00:08, Ken Brown wrote: I've been away from Cygwin development for a while, and I've forgotten (or never knew) the conventional way of cherry-picking a commit from the main branch to the cygwin-3_5 branch.  Here's the

Re: mmap_is_attached_or_noreserve

2024-12-26 Thread Ken Brown
On 12/25/2024 6:06 PM, Ken Brown wrote: On 12/25/2024 1:08 PM, Ken Brown wrote: Hi Corinna, I know you're on vacation, but I'm writing this now while it's fresh in my mind.  We can discuss it when you return. This is a follow-up to    https://cygwin.com/pipermail/cygwin-

A few quick mmap questions

2024-12-19 Thread Ken Brown
Hi Corinna, I plan to keep working on mmap issues while you're on vacation. A few questions have come up while I've been looking at the code. 1. The function is_mmapped_region() doesn't seem to be used anywhere. Is it OK to remove it? 2. I can't find any uses of filler pages, in spite of t

Re: A few quick mmap questions

2024-12-20 Thread Ken Brown
On 12/20/2024 8:13 AM, Corinna Vinschen wrote: On Dec 19 18:36, Ken Brown wrote: I think I'm seeing a similar confusion in mmap_is_attached_or_noreserve().  I'm tired now and am having trouble sorting out exactly what that function is doing. noreserve() pages are MAP_RESERVE pages.

Re: A few quick mmap questions

2024-12-20 Thread Ken Brown
On 12/20/2024 10:37 AM, Corinna Vinschen wrote: No worries. The expression size_t commit_len = u_len - (start_addr - u_addr); may be right, but it's not generally intelligible. If you'd like to take a stab of changing the code to be more clear, I'm happy. I'll give it a try. By the way, t

Re: Unnecessary limitation on munmap?

2024-12-21 Thread Ken Brown
Hi Mark, On 12/21/2024 5:15 PM, Mark Geisert wrote: Hi Ken, On 12/21/2024 1:42 PM, Ken Brown wrote: I'm wondering why munmap insists on operating with chunks of size 64k instead of pages of size 4k.  In other words, what would go wrong if we did the following: --- a/winsup/cygw

Unnecessary limitation on munmap?

2024-12-21 Thread Ken Brown
I'm wondering why munmap insists on operating with chunks of size 64k instead of pages of size 4k. In other words, what would go wrong if we did the following: --- a/winsup/cygwin/mm/mmap.cc +++ b/winsup/cygwin/mm/mmap.cc @@ -1143,7 +1143,7 @@ munmap (void *addr, size_t len) set_errno (

Re: Unnecessary limitation on munmap?

2024-12-22 Thread Ken Brown
On 12/22/2024 4:17 AM, Corinna Vinschen wrote: The point was that a pagesize of 4K is wrong from the POSIX point of view. I was pretty stubborn in understanding this myself, and it took quite some time until I caved in and produced the aforementioned patch back in 2005. The reason (or rather, o

Question about mprotect

2025-01-18 Thread Ken Brown
Hi Corinna, I'm puzzled by the code at mmap.cc:1294 starting with if (!in_mapped). If we get there and in_mapped is false, then the pages in the mprotect call don't meet any mmap_record. Why do we continue after that? Is there some case where a user program would expect mprotect to succeed o

Re: mmap_is_attached_or_noreserve

2024-12-25 Thread Ken Brown
On 12/25/2024 1:08 PM, Ken Brown wrote: Hi Corinna, I know you're on vacation, but I'm writing this now while it's fresh in my mind.  We can discuss it when you return. This is a follow-up to   https://cygwin.com/pipermail/cygwin-developers/2024-December/012715.html but I&#

mmap_is_attached_or_noreserve

2024-12-25 Thread Ken Brown
t;); exit (1); } if (read (fd, mem1, 2 * pagesize) == -1) { perror ("read"); exit (1); } printf ("The region starting at mem1 contains %s\n", (char *) mem1); if (read (fd, mem2, pagesize) == -1) { perror ("read"); exit (1);