mmap failure [was: cygrunsrv + sshd + rsync = 20 times too slow -- throttled?]

Ken Brown kbrown@cornell.edu
Sat Sep 4 22:54:02 GMT 2021


On 9/4/2021 6:37 PM, Ken Brown via Cygwin wrote:
> I've reduced the procps failure to the following test case:
> 
> $ cat mmap_test.c
> #include <unistd.h>
> #include <stdio.h>
> #include <sys/mman.h>
> 
> int
> main ()
> {
>    void *addr;
>    int page_size = getpagesize ();
> 
>    addr = mmap (0, page_size, PROT_READ | PROT_WRITE,
>                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
>    if (addr == MAP_FAILED)
>      perror ("mmap");
> }
> 
> $ gcc mmap_test.c
> 
> $ ./a
> mmap: Invalid argument
> 
> This happens if I use cygwin1.dll built from the current git master.  But it 
> also happens if I build from cygwin-3_2_0-release with the recent patches 
> applied that make Cygwin build without error:
> 
> 0e12b4939 Cygwin: C++17: register keyword is deprecated
> a7340e0c0 Cygwin: dumper: fix up GCC pragma for g++ 11.2
> 2a212c086 Cygwin: workaround a g++ 11.2 initialization bug
> 9e3f1737e Cygwin: loader script: add DWARF 5 sections
> bdfd2b004 Cygwin: testsuite: avoid "conflicting types" gcc warning
> 6fc498e2e strstr: avoid warnings
> 26da270b2 ldexp/ldexpf: avoid assembler warning
> edce2a557 Cygwin: fix declaration of RtlInitEmptyUnicodeString

Sorry, those commit ids are wrong.  They're what I got after rebasing the master 
branch so that those commits come first.

> So there appears to be something wrong with cygwin1.dll built with the current 
> build tools (gcc 11.2.0, binutils 2.37, not sure what else is relevant).
> 
> Ken
> 


More information about the Cygwin mailing list