https://bugs.winehq.org/show_bug.cgi?id=38062
Bug ID: 38062 Summary: .NET 2.0/3.x/4.x applications and games using System.Net.NetworkInformation NetworkAddressChangedEventHandler crash on startup Product: Wine Version: 1.7.36 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
split off from bug 33862
Examples: Sonos DesktopController 5.11, Aeria Ignite (Aeria Games), PlayOn ...
Relevant part of trace log from one app:
--- snip --- ... 002b:Call ws2_32.WSASocketW(00000002,00000002,00000000,00000000,00000000,00000001) ret=05a1ed6b 002b:trace:winsock:WSASocketW af=2 type=2 protocol=0 protocol_info=(nil) group=0 flags=0x1 002b: create_socket( access=c0100000, attributes=00000002, family=2, type=2, protocol=0, flags=00000001 ) socket(2,2,0)=167 sock_reselect(0x1a16a80): new mask 0 002b: create_socket() = 0 { handle=02c0 } 002b:trace:winsock:WSASocketW created 02c0 002b:Ret ws2_32.WSASocketW() retval=000002c0 ret=05a1ed6b ... 002b:Call ws2_32.ioctlsocket(000002c0,8004667e,03b3c4e8) ret=05a061e7 002b:trace:winsock:WSAIoctl 02c0, _IOW('f', 126, 4), 0x3b3c4e8, 4, 0x3b3c4e8, 4, 0x3b3c40c, (nil), (nil) 002b:trace:winsock:WSAIoctl -> FIONBIO (ffffffff) 002b: get_socket_event( handle=02c0, service=0, c_event=0000 ) 002b: get_socket_event() = 0 { mask=00000000, pmask=00000000, state=00000003, errors={} } 002b: enable_socket_event( handle=02c0, mask=00000000, sstate=20000000, cstate=00000000 ) sock_reselect(0x1a16a80): new mask 0 002b: enable_socket_event() = 0 002b:Ret ws2_32.ioctlsocket() retval=00000000 ret=05a061e7 ... 002b:Call ws2_32.WSAIoctl(000002c0,28000017,00000000,00000000,00000000,00000000,03b3c4e4,00000000,00000000) ret=05a063d1 002b:trace:winsock:WSAIoctl 02c0, _WSAIO(IOC_WS2, 23), (nil), 0, (nil), 0, 0x3b3c4e4, (nil), (nil) 002b:Call ntdll.RtlAllocateHeap(00110000,00000000,0000003c) ret=7dbc0b92 002b:Ret ntdll.RtlAllocateHeap() retval=001933b0 ret=7dbc0b92 002b:Call ntdll.NtDeviceIoControlFile(000002c0,00000000,7dbbbffa,001933b0,001933c0,28000017,00000000,00000000,00000000,00000000) ret=7dbc0c23 002b: ioctl( code=28000017, async={handle=02c0,event=0000,callback=7bc47747,iosb=001933c0,arg=001933f8,cvalue=00000000}, blocking=0, in_data={} ) 002b: ioctl() = PENDING { wait=0000, options=00000000, out_data={} } 002b:Ret ntdll.NtDeviceIoControlFile() retval=00000103 ret=7dbc0c23 002b:trace:winsock:WSAIoctl -> _WSAIO(IOC_WS2, 23) request 002b:Ret ws2_32.WSAIoctl() retval=ffffffff ret=05a063d1 002b:Call KERNEL32.GetLastError() ret=79162510 002b:Ret KERNEL32.GetLastError() retval=000003e5 ret=79162510 ... --- snip ---
Managed backtrace:
--- snip --- ... Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sonos.Controller.Desktop.Utilities.BugsenseWrappedException: Rethrown exception. See innerexception for details. ---> System.Net.NetworkInformation.NetworkInformationException: Overlapped I/O pending at System.Net.NetworkInformation.NetworkChange.AddressChangeListener.StartHelper(NetworkAddressChangedEventHandler caller, Boolean captureContext, StartIPOptions startIPOptions) at System.Net.NetworkInformation.NetworkChange.add_NetworkAddressChanged(NetworkAddressChangedEventHandler value) at Sonos.Controller.Desktop.Utilities.NetworkMonitor.StartMonitoring() at Sonos.Controller.Desktop.SCLib.Listener.Startup() at Sonos.Controller.Desktop.App.<OnStartup>b__5() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) ... --- snip ---
Yes, they also need FD_ADDRESS_LIST_CHANGE support in the end to really make use of this feature which could be split into another bug.
I found this small .NET example app with source code which exhibits the same crash: http://www.codeproject.com/Articles/64975/Detect-Internet-Network-Availabili...
$ sha1sum NetworkStatus_Demo.zip 6f64a8b7d781d2c84359de7bcad95b9ffc60dc30 NetworkStatus_Demo.zip
$ du -sh NetworkStatus_Demo.zip 8.0K NetworkStatus_Demo.zip
$ wine --version wine-1.7.36-28-ga679cae
Regards
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dotnet, download, source URL| |http://www.codeproject.com/ | |Articles/64975/Detect-Inter | |net-Network-Availability
https://bugs.winehq.org/show_bug.cgi?id=38062
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |erich.e.hoover@gmail.com, | |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=38062
--- Comment #1 from Erich Hoover erich.e.hoover@gmail.com --- Created attachment 50813 --> https://bugs.winehq.org/attachment.cgi?id=50813 server: Return STATUS_CANT_WAIT/WSAEWOULDBLOCK for non-overlapped SIO_ADDRESS_LIST_CHANGE requests on non-blocking sockets.
Hi AF, sorry for the delay in getting to this - been a bit busy. I tested with that CodeProject program and this seems to fix the problem (though, clearly, doesn't implement everything yet). The CodeProject program fails on something else though, so would you mind giving this a try?
https://bugs.winehq.org/show_bug.cgi?id=38062
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello Erich,
yes, the patch makes all apps listed here to work - as expected ;-)
Regards
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|winsock |wineserver
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, still present.
Patch is maintained in Wine-Staging here: https://github.com/wine-compholio/wine-staging/blob/master/patches/server-Ad...
$ wine --version wine-1.7.40-29-gc1c108f
Regards
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |baseballplyr1300@gmail.com
--- Comment #4 from Anastasius Focht focht@gmx.net --- *** Bug 38887 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38062
--- Comment #5 from Tyler Montney baseballplyr1300@gmail.com --- (In reply to Anastasius Focht from comment #4)
*** Bug 38887 has been marked as a duplicate of this bug. ***
I did find this bug, although I thought it would simply be fixed in a future build. I wasn't aware I had to actually patch it myself.
https://bugs.winehq.org/show_bug.cgi?id=38062
tom+bugs.winehq.org@falkensweb.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tom+bugs.winehq.org@falkens | |web.com
--- Comment #6 from tom+bugs.winehq.org@falkensweb.com --- Ack. The Sonos Controller crashes at startup with this stack trace, and using Wine Staging instead makes it work. There are graphical glitches to my primary monitor (ie other windows) sometimes when it starts, probably unrelated.
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |andrei.reiand@gmail.com
--- Comment #7 from Anastasius Focht focht@gmx.net --- *** Bug 38618 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |julius.schwartzenberg@gmail | |.com
--- Comment #8 from Anastasius Focht focht@gmx.net --- *** Bug 39177 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38062
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |michael@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/server-Address | |_List_Change
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37095
https://bugs.winehq.org/show_bug.cgi?id=38062
--- Comment #9 from Sebastian Lackner sebastian@fds-team.de --- Should be fixed with http://source.winehq.org/git/wine.git/patch/dfa73ca62678787400a27eb0d858a402..., please retest.
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Resolution|--- |FIXED
--- Comment #10 from Anastasius Focht focht@gmx.net --- Hello folks,
this is now fixed by commit https://source.winehq.org/git/wine.git/commitdiff/dfa73ca62678787400a27eb0d8...
Thanks Erich
Regards
https://bugs.winehq.org/show_bug.cgi?id=38062
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |dfa73ca62678787400a27eb0d85 | |8a402aae37c47
https://bugs.winehq.org/show_bug.cgi?id=38062
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.53.
https://bugs.winehq.org/show_bug.cgi?id=38062
--- Comment #12 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive for documentation.
https://archive.org/details/codeproject_article_64975_example
https://archive.org/download/codeproject_article_64975_example/NetworkStatus...
$ sha1sum NetworkStatus_Demo.zip 6f64a8b7d781d2c84359de7bcad95b9ffc60dc30 NetworkStatus_Demo.zip
$ du -sh NetworkStatus_Demo.zip 8.0K NetworkStatus_Demo.zip
Regards
https://bugs.winehq.org/show_bug.cgi?id=38062
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.codeproject.com/ |https://archive.org/downloa |Articles/64975/Detect-Inter |d/codeproject_article_64975 |net-Network-Availability |_example/NetworkStatus_Demo | |.zip