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: ctrl-c doesn't reliably kill ping


On 3/14/16, Frank Farance wrote:
> I have been having this problem with "ping".  If I "ping" a location that
> doesn't exist, then "ping" just hangs and cannot be killed via "kill -KILL
> [pid]".
> A little digression, so you understand the background ... The workstation I
> am
> doing this from is connected to a Verizon router to their FIOS network.  Now
> the
> reason I mention this is that the router's DNS (via DHCP to my workstation)
> is
>, which I presume is forwarded from the router upstream to
> Verizon's
> DNS caches.  So if I type the URL http://something.that.doesnt.exist in my
> browser, rather than getting a Hostname Not Found error (at the name
> resolution
> level), it actually loads up a page saying "something.that.doesnt.exist"
> isn't
> found and then I have a Yahoo set of search results on things matching the
> broken hostname.
> So all of this is normal ISP stuff: they actually resolve unknown addresses
> to
> their own website (which is

Right.  If you poke around on the Verizon site long enough you'll find
where they list the resolvers that return NXDOMAIN instead of the
address of their ad site.   & sorry, no, I didn't save the url, but
try changing the last octet of the resolver addresses on your fios
router to .14 & see if that works.

> Ok, ending the digression ....
> Back to the problem, so when I type
> $ ping
> according to "ping", the hostname resolves to (as per the
> explanation above), but I cannot kill "ping".  I tried "ping" with a limited
> packet size and count so, in theory, "ping" would die on its own after 10
> packets, such as:
> $ ping 50 10
> but it still hangs rather than timing out.  If I ping to some actual IP
> address
> that is unresponsive (route-able to the last subnet, but dies on the floor
> at
> the end), then I can kill via ctrl-c.  My only solution to the hanging
> "ping" is
> to kill the terminal window.
> Any suggestions on:
> - Why "ping" behaves this way?
> - How to avoid this problem?

The last time I tried the cygwin ping program it didn't return a
failure status - ie
ping whatever
and $? was always 0 -- so it's basically useless.   I'd suggest you
use the windows version of ping:

$ which ping

$ ping

Pinging [] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

$ echo $?

$ ping
Ping request could not find host Please
check the name and try again.

$ echo $?

$ ping

Pinging [] with 32 bytes of data:
Reply from bytes=32 time=19ms TTL=45
Reply from bytes=32 time=21ms TTL=45
Reply from bytes=32 time=23ms TTL=45
Reply from bytes=32 time=22ms TTL=45

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 19ms, Maximum = 23ms, Average = 21ms

$ echo $?


Problem reports:
Unsubscribe info:

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