Bug 8554 - System.Net.NetworkInformation.Ping - SendPingAsync operation fails
Summary: System.Net.NetworkInformation.Ping - SendPingAsync operation fails
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-22 09:55 UTC by Stian E
Modified: 2016-07-04 11:35 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
SendPingAsync testcase (366 bytes, application/octet-stream)
2012-11-22 09:55 UTC, Stian E
Details
SendPingAsync testcase (366 bytes, text/plain)
2012-11-22 10:00 UTC, Stian E
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Stian E 2012-11-22 09:55:08 UTC
Created attachment 2998 [details]
SendPingAsync testcase

The following simple testcase works fine using .NET, but fails using Mono.

var result = new Ping().SendPingAsync(IPAddress.Loopback);
result.Wait();
Console.WriteLine(result.Result.Status);

Expected Result:
Success

Actual result:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout, System.Byte[] buffer, System.Net.NetworkInformation.PingOptions options) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout, System.Byte[] buffer) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address) [0x00000] in <filename unknown>:0 
  at AsyncPing.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout, System.Byte[] buffer, System.Net.NetworkInformation.PingOptions options) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout, System.Byte[] buffer) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address, Int32 timeout) [0x00000] in <filename unknown>:0 
  at System.Net.NetworkInformation.Ping.SendPingAsync (System.Net.IPAddress address) [0x00000] in <filename unknown>:0 
  at AsyncPing.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Platforms tested:
OS X (Lion) - Mono JIT compiler version 3.0.1 (master/301b6c6 Mon Nov  5 14:45:52 EST 2012)
Linux (Debian), ARM - Mono JIT compiler version 3.0.1 (tarball Sat Nov 10 00:44:18 PHT 2012)
Comment 1 Stian E 2012-11-22 10:00:43 UTC
Created attachment 2999 [details]
SendPingAsync testcase
Comment 2 chesedprather 2015-01-18 05:10:18 UTC
Still repros as of Mono Debian 3.2.8+dfsg-4ubuntu1 on LinuxMint 17.1
Comment 3 Rupert Rawnsley 2015-02-10 09:20:39 UTC
This is also a problem on Xamarin.Android Version: 4.20.0.28 (Indie Edition)
Comment 4 Adrian McCague 2016-05-11 11:36:48 UTC
I have made a pull request https://github.com/mono/mono/pull/2984 that should resolve this issue with the Task Based API operations.
Comment 5 Alexander Köplinger [MSFT] 2016-07-04 11:35:02 UTC
Adrian's pull request was merged, closing this as fixed. Thanks!