This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange issue with IPv6 and mmap in Windows XP


On Jan 23 01:38, jdzstz - gmail dot com wrote:
> I have detected a strange issue with IPv6 and mmap in Windows XP.
> 
> I want to execute varnish program from windows cmd.exe, launching a BAT file.
> If IPv6 is deactivated (default in windows xp) all works OK.
> 
> But if I activate IPV6 with following comand:
> 
> C:\WINDOWS>netsh
> netsh>interface
> netsh interface>ipv6
> netsh interface ipv6>install
> 
> (and reboot)
> 
> Varnish stats to fail only if it is launched from windows cmd.exe, the
> error is on fork:
> [...]
>    77 18973532 [main] varnishd 9212 fixup_mmaps_after_fork: fd -1, h
> 0x678, address 0x60FA1000, len 0xF000, prot: 0x4000003, flags: 0x31,
>  offset 0
>   149 18973681 [main] varnishd 9212 MapView: 0x60FA1000 (status 0x0) =
> NtMapViewOfSection (h:678, addr:60FA1000, len:61440, off:0, protec
> t:40, type:0)
>    98 18973779 [main] varnishd 9212 fixup_mmaps_after_fork: fd 4, h
> 0x674, address 0x5BF90000, len 0x5010470, prot: 0x3, flags: 0x1, offs
> et 0
>   105 18973884 [main] varnishd 9212 build_fh_pc: fh 0x6124289C
>    68 18973952 [main] varnishd 9212 MapView: 0x0 (status 0xC0000018) =
> NtMapViewOfSection (h:674, addr:5BF90000, len:83952752, off:0, pro
> tect:40, type:0)
> 18974019 [main] varnishd 9212
> fhandler_disk_file::fixup_mmap_after_fork: requested 0x5BF90000 != 0x0
> mem alloc base 0x0, state 0x10000, s
> ize 12451840, Win32 error 487
>    67 18974019 [main] varnishd 9212
> fhandler_disk_file::fixup_mmap_after_fork: requested 0x5BF90000 != 0x0
> mem alloc base 0x0, state 0x10
> 000, size 12451840, Win32 error 487
> 18974448 [main] varnishd 9212 C:\apps\varnish 2.1.4\bin\varnishd.exe:
> *** fatal error - recreate_mmaps_after_fork_failed
> [...]
> If I execute varnish from bash, it works fine.
> 
> It seems that the problem is produced in "NtMapViewOfSection" windows function.
> Somebody has the clue why it only fails when it is launched outside
> bash and with IPv6 activated???

It's a rebase problem.  The layout of the DLLs changes due to loading
the IPv6 stuff into memory and after fork the system loader uses
different load addresses in the forked process, which breaks fork since
it can't reproduce the former memory layout in the forked child.

Why this only happens when started from cmd, I don't know, but maybe the
bash process already initialized the IPv6 stuff and this auto-heals
subsequent DLL loading.

You could try to rebaseall, but it's not a safe bet.  Other than that,
just don't use cmd.exe.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]