Subject: Re: ioctl() on socket fd's take 3 seconds on 1.7.7
From: Jason Curl <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sat, 20 Nov 2010 18:25:03 +0100
List-Id: <cygwin.cygwin.com>

On 15/11/2010 17:22, Corinna Vinschen wrote:
> On Nov  9 09:20, Jason Curl wrote:
>>    166   65418 [main] ipcheck 5580 ioctl: fd 3, cmd 80087364
>> --- Process 5580, exception C0000005 at 610C8C86
>
> Crash in Cygwin, but the address doesn't help much, unfortunately.
>
>> Interestingly enough, the program works. That is, it finds all
>> interfaces and returns correct values (except interface names are
>> UUIDs instead of something more friendly like "eth0" that existed in
>> 1.5.26).
 >>
>> It will be a little later when I'm able to generate a working test case.
>
> T'would be nice.  Please make it short and simple and, if possible, in
> plain C.

I've generated a relatively simple test case that I can compile using 
cygwin1-20101102.dll.

compile using
  $ gcc --version
  gcc (GCC) 4.3.4 20090804 (release) 1
  $ gcc ifconf.c
  $ ./a.exe

The output looks something like:

DEBUG 1290273446.193553 main 50: SIOCGIFCONF start
DEBUG 1290273449.318553 main 52: SIOCGIFCONF end
Interface: {4ED54D4E-1024-4BDF-A926-67D2895D2DC4}
DEBUG 1290273449.320553 main 59: SIOCGIFADDR start
DEBUG 1290273452.442553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: a9fe0202
DEBUG 1290273452.444553 main 72: SIOCGIFNETMASK start
DEBUG 1290273455.567553 main 74: SIOCGIFNETMASK end
   Mask: ffffff00
DEBUG 1290273455.571553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273458.694553 main 79: SIOCGIFBRDADDR end
   Broadcast: a9fe02ff
DEBUG 1290273458.695553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273461.817553 main 84: SIOCGIFDSTADDR end
   Dest: a9fe0202
Interface: {A045DC0F-A979-49B3-954C-D0678365FF26}
DEBUG 1290273461.819553 main 59: SIOCGIFADDR start
DEBUG 1290273464.943553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: a9feb7d4
DEBUG 1290273464.945553 main 72: SIOCGIFNETMASK start
DEBUG 1290273468.067553 main 74: SIOCGIFNETMASK end
   Mask: ffff0000
DEBUG 1290273468.068553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273471.190553 main 79: SIOCGIFBRDADDR end
   Broadcast: a9feffff
DEBUG 1290273471.191553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273474.313553 main 84: SIOCGIFDSTADDR end
   Dest: a9feb7d4
Interface: {4EB69B61-C791-434A-8FCE-8F4859EA8DFC}
DEBUG 1290273474.315553 main 59: SIOCGIFADDR start
DEBUG 1290273477.437553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: a9fe0202
DEBUG 1290273477.439553 main 72: SIOCGIFNETMASK start
DEBUG 1290273480.561553 main 74: SIOCGIFNETMASK end
   Mask: ffffff00
DEBUG 1290273480.562553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273483.685553 main 79: SIOCGIFBRDADDR end
   Broadcast: a9fe02ff
DEBUG 1290273483.686553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273486.808553 main 84: SIOCGIFDSTADDR end
   Dest: a9fe0202
Interface: {85C2CEC7-A2B9-47D4-9A50-D63E9F9ED007}
DEBUG 1290273486.810553 main 59: SIOCGIFADDR start
DEBUG 1290273489.931553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: 00000000
DEBUG 1290273489.934553 main 72: SIOCGIFNETMASK start
DEBUG 1290273493.055553 main 74: SIOCGIFNETMASK end
   Mask: ff000000
DEBUG 1290273493.056553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273496.178553 main 79: SIOCGIFBRDADDR end
   Broadcast: 00ffffff
DEBUG 1290273496.179553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273499.303553 main 84: SIOCGIFDSTADDR end
   Dest: 00000000
Interface: {56D2E68A-4173-4117-A719-65123B973C65}
DEBUG 1290273499.305553 main 59: SIOCGIFADDR start
DEBUG 1290273502.427553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: c0a80119
DEBUG 1290273502.429553 main 72: SIOCGIFNETMASK start
DEBUG 1290273505.550553 main 74: SIOCGIFNETMASK end
   Mask: ffffff00
DEBUG 1290273505.551553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273508.674553 main 79: SIOCGIFBRDADDR end
   Broadcast: c0a801ff
DEBUG 1290273508.675553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273511.798553 main 84: SIOCGIFDSTADDR end
   Dest: c0a80119
Interface: {7E5203E8-97DE-4822-9A2E-380BD258D97E}
DEBUG 1290273511.800553 main 59: SIOCGIFADDR start
DEBUG 1290273514.921553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: a9fed3c1
DEBUG 1290273514.923553 main 72: SIOCGIFNETMASK start
DEBUG 1290273518.045553 main 74: SIOCGIFNETMASK end
   Mask: ffff0000
DEBUG 1290273518.046553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273521.168553 main 79: SIOCGIFBRDADDR end
   Broadcast: a9feffff
DEBUG 1290273521.170553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273524.292553 main 84: SIOCGIFDSTADDR end
   Dest: a9fed3c1
Interface: {8424F604-4FAE-4541-9D8E-7B0A583A0956}
DEBUG 1290273524.294553 main 59: SIOCGIFADDR start
DEBUG 1290273527.416553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: c0a8df01
DEBUG 1290273527.418553 main 72: SIOCGIFNETMASK start
DEBUG 1290273530.540553 main 74: SIOCGIFNETMASK end
   Mask: ffffff00
DEBUG 1290273530.541553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273533.665553 main 79: SIOCGIFBRDADDR end
   Broadcast: c0a8dfff
DEBUG 1290273533.666553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273536.788553 main 84: SIOCGIFDSTADDR end
   Dest: c0a8df01
Interface: {846EE342-7039-11DE-9D20-806E6F6E6963}
DEBUG 1290273536.790553 main 59: SIOCGIFADDR start
DEBUG 1290273539.911553 main 61: SIOCGIFADDR end
   Family: AF_INET
   Address: 7f000001
DEBUG 1290273539.913553 main 72: SIOCGIFNETMASK start
DEBUG 1290273543.035553 main 74: SIOCGIFNETMASK end
   Mask: ff000000
DEBUG 1290273543.036553 main 77: SIOCGIFBRDADDR start
DEBUG 1290273546.158553 main 79: SIOCGIFBRDADDR end
   Broadcast: 7fffffff
DEBUG 1290273546.159553 main 82: SIOCGIFDSTADDR start
DEBUG 1290273549.280553 main 84: SIOCGIFDSTADDR end
   Dest: 7f000001

Best Regards,
Jason.
--
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