http://bugs.winehq.org/show_bug.cgi?id=24357
Summary: Pokerstars Network Status (ICMP, ping) doesn't work. Product: Wine Version: 1.3.2 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: 415fox@gmail.com
Pokerstars mostly works, but the Network Status feature always says Bad 0%. What it seems to do is ping a bunch of servers and although all of PokerStars' other networking stuff works great now, this one doesn't seem to.
There are no error messages on the terminal. Other programs can use ping successfully. For example WinPcap seems to have no problems.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #1 from GyB gyebro69@gmail.com 2010-09-13 11:13:17 CDT --- Created an attachment (id=30729) --> (http://bugs.winehq.org/attachment.cgi?id=30729) console log when Network Status selected
This is the console log after I started the application and clicked on Help >> Network Status... The connection to the servers shows 0% and all icmp packages are shown as lost.
In the log the repeated winediag:ICMPCreateFile Failed... messages indicate a permission issue.
Looks similar to bug #8332 and bug #22786.
Tested with the current git (wine-1.3.2-157-g2c4b081) on Fedora 13.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #2 from michael 415fox@gmail.com 2010-09-13 15:19:12 CDT --- (In reply to comment #1)
Created an attachment (id=30729)
--> (http://bugs.winehq.org/attachment.cgi?id=30729) [details]
console log when Network Status selected
This is the console log after I started the application and clicked on Help >> Network Status... The connection to the servers shows 0% and all icmp packages are shown as lost.
In the log the repeated winediag:ICMPCreateFile Failed... messages indicate a permission issue.
Looks similar to bug #8332 and bug #22786.
Tested with the current git (wine-1.3.2-157-g2c4b081) on Fedora 13.
I was thinking permissions or capabilities as the issue, but usually the way you can confirm this is by running it as root. That is the case in bug 22786. However, in this case, when I run as root, the problem persists.
As for bug 8332 -- it may be the same, but it's been around since 2007 which is not a good sign.
I'll try an strace and report back.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #3 from michael 415fox@gmail.com 2010-09-13 16:27:55 CDT --- (In reply to comment #2)
(In reply to comment #1)
Created an attachment (id=30729)
--> (http://bugs.winehq.org/attachment.cgi?id=30729) [details] [details]
console log when Network Status selected
This is the console log after I started the application and clicked on Help >> Network Status... The connection to the servers shows 0% and all icmp packages are shown as lost.
In the log the repeated winediag:ICMPCreateFile Failed... messages indicate a permission issue.
Looks similar to bug #8332 and bug #22786.
Tested with the current git (wine-1.3.2-157-g2c4b081) on Fedora 13.
I was thinking permissions or capabilities as the issue, but usually the way you can confirm this is by running it as root. That is the case in bug 22786. However, in this case, when I run as root, the problem persists.
As for bug 8332 -- it may be the same, but it's been around since 2007 which is not a good sign.
I'll try an strace and report back.
Here's what I learned from strace:
The Network Status is it's own program called PokerStars/Tracer.exe so it's easier to debug just running "wine Tracer.exe" from the PokerStars directory.
There are no permissions problems (at least, not while running as root).
Tracer.exe uses ICMP.DLL
Tracer.exe (or ICMP.DLL) creates a bunch of threads. Each thread opens an ICMP socket with: [pid 14388] socket(PF_INET, SOCK_RAW, IPPROTO_ICMP <unfinished ...> [pid 14388] <... socket resumed> ) = 23
The socket is opened successfully. Each process probably corresponds to one ping operation.
Later the socket is shutdown but now there's an error: [pid 14404] shutdown(23, 2 /* send and receive */) = -1 ENOTCONN (Transport endpoint is not connected)
I figure that ICMP.DLL (ICMPCreateFile) must work sometimes or we'd have more bug reports about this. Maybe the issue is that it doesn't work within a thread?
I'm not a windows programmer so I don't really know how threads or sockets work under windows. It would be nice if we could get a windows programmer to create a test case which:
1. Use ICMPCreateFile to do a ping in the main process. 2. Do an exec (or the windows equivalent) 3. Try ICMPCreateFile in the child process 2. Do a fork (or whatever windows equivalent) 3. Try ICMPCreateFile in the thread.
If my theory is right then ICMPCreateFile will succeed in the main process and succeed in the child process but fail in the child thread.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #4 from michael 415fox@gmail.com 2010-09-13 18:11:16 CDT --- I'd like to point out that there are two separate bugs here:
1. Special permission bug. 2. IcmpSendEcho doesn't work in a thread.
The first bug is the cause of many problems. Another bug I'm working on is caused by ptrace requiring a special capability, CAP_SYS_PTRACE. For this bug, wineserver (and maybe wine-preloader) needs the capability CAP_NET_RAW.
Either way, if you run as root, or give the necessary capabilities to wine, you won't see the permissions problem reported by GyB.
However, even running as root or with capabilities, there is still this second bug. You can see it in the relay output like:
001f:Ret KERNEL32.GetCurrentThreadId() retval=0000001f ret=004029f9 001f:Call iphlpapi.IcmpSendEcho(0013c268,fdfe4150,00000000,00000000,00a4e9a0,00a4e9a8,0000001c,000007d0) ret=00402f61 001f:Ret iphlpapi.IcmpSendEcho() retval=00000000 ret=00402f61
This is the IcmpSendEcho call running inside of a thread. retval=0 means that it didn't get any replies after a timeout of 2000ms (2 seconds).
At this point the MSDN documentation says you should call GetLastError to see what went wrong. Unfortunately, whoever wrote Tracer.exe didn't bother to do that one so there's no way to see in the +relay dump why it thinks it didn't work out.
One other thing I thought was weird was the address: fdfe4150. This comes from an earlier call to:
0009:Call ws2_32.inet_addr(004367b0 "80.65.254.253") ret=00403b0b 0009:Ret ws2_32.inet_addr() retval=fdfe4150 ret=00403b0b
So it converted the string "80.65.254.253" to the hex value 0xfdfe4150. I would think that the hex value should be 0x5041fefd since 0x50 = 80 0x41 = 65 0xfe = 254 0xfd = 253 But maybe this is just my lack of understanding of windows. Maybe it just represents the addresses backwards from what's normal. I couldn't find any clear documentation on this. All I found was:
http://msdn.microsoft.com/en-us/library/aa366055(v=VS.85).aspx
Which defines the binary representation as: typedef struct { union { struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; struct { u_short s_w1,s_w2; } S_un_w; u_long S_addr; } S_un; } IPAddr;
Another thought I had was that the timers used to implement the timeout don't work right inside of a thread. For example I ran the program for exactly 10 seconds and found that it pinged a give address 17 times. At 2 seconds per ping it should have only been 5 times.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #5 from michael 415fox@gmail.com 2010-09-13 18:32:33 CDT --- I think I could solve it if I could figure out how to get trace to work.
In the code at: http://source.winehq.org/source/dlls/iphlpapi/icmp.c
There are several TRACE calls in the function IcmpSendEcho
However, when I run with:
WINEDEBUG=trace+all ./Tracer.exe
Although I get tons of debug messages I don't seem to get any of the ones defined in that function.
I'm trying to figure out: Is it necessary to build from source to get traces from icmp? Or am I selecting the debug channel wrong?
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #6 from Juan Lang juan_lang@yahoo.com 2010-09-13 22:21:22 CDT --- (In reply to comment #4)
One other thing I thought was weird was the address: fdfe4150. This comes from an earlier call to:
0009:Call ws2_32.inet_addr(004367b0 "80.65.254.253") ret=00403b0b 0009:Ret ws2_32.inet_addr() retval=fdfe4150 ret=00403b0b
So it converted the string "80.65.254.253" to the hex value 0xfdfe4150. I would think that the hex value should be 0x5041fefd since 0x50 = 80 0x41 = 65 0xfe = 254 0xfd = 253 But maybe this is just my lack of understanding of windows.
IP addresses are transmitted in "network order", which is big-endian. Intel CPUs are little-endian. Thus, the representation looks "backwards" on an Intel CPU. The address is correct as it is.
http://bugs.winehq.org/show_bug.cgi?id=24357
--- Comment #7 from Juan Lang juan_lang@yahoo.com 2010-09-13 22:22:29 CDT --- (In reply to comment #5)
I think I could solve it if I could figure out how to get trace to work.
You want: WINEDEBUG=+icmp wine ... That'll turn on all debug messages, including trace, for the icmp channel, which is what dlls/iphlpapi/icmp.c uses.
http://bugs.winehq.org/show_bug.cgi?id=24357
jUrner@arcor.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jUrner@arcor.de
--- Comment #8 from jUrner@arcor.de 2010-09-14 02:02:01 CDT --- see
https://bugs.launchpad.net/ubuntu/+source/wine1.2/+bug/636278 http://bugs.winehq.org/show_bug.cgi?id=24193
sudo gedit /etc/sysctl.d/10-ptrace.conf
kernel.yama.ptrace_scope = 0
+ reboot works for now.
http://bugs.winehq.org/show_bug.cgi?id=24357
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #9 from Jerome Leclanche adys.wh@gmail.com 2010-09-14 08:22:10 CDT --- (In reply to comment #8)
see
https://bugs.launchpad.net/ubuntu/+source/wine1.2/+bug/636278 http://bugs.winehq.org/show_bug.cgi?id=24193
sudo gedit /etc/sysctl.d/10-ptrace.conf
kernel.yama.ptrace_scope = 0
- reboot works for now.
So dupe of bug 24193?
http://bugs.winehq.org/show_bug.cgi?id=24357
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #10 from Bruno Jesus 00cpxxx@gmail.com 2012-05-05 16:44:06 CDT --- Is this still an issue in wine 1.5.3?
http://bugs.winehq.org/show_bug.cgi?id=24357
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |ABANDONED
--- Comment #11 from Austin English austinenglish@gmail.com --- No reply in 2 years, abandoned.
http://bugs.winehq.org/show_bug.cgi?id=24357
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Austin English austinenglish@gmail.com --- Closing.