New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket: Abort pending operations on shutdown #8758
Conversation
|
I updated the error code based on this hardware test (still based on a connect call to a ubisoft server). Some important points to mention:
|
|
Very early WIP hwtest, I'll post a draft PR on the hwtest repository soon: Here are the results, I'll adjust this PR accordingly: Regarding the result value:
|
Test 1/2I did some fine-tuning on the previous hwtest to fix some inconsistent behaviours:
The results:
Test 2/2The other part of the test where I check return values of network functions after a shutdown call. The results: |
dd2947f
to
ff2915f
Compare
|
@leoetlino This PR fixes Just Dance games: https://bugs.dolphin-emu.org/issues/11910 This PR should be thoroughly tested before being merged to be sure there is no network regression. |
|
I added hwtests results for the ASUS RoG Phone II and Linux (Parrot). |
|
I moved up the Still ready to be reviewed. |
|
Rebased on latest master. I tested it on some online games such as Super Smash Bros. Brawl, Mario Strikers Charged Football, DJHero and some Just Dance games and I didn't find any issue. Ready to be reviewed & merged. Depends on #8796. |
820d525
to
c63ac38
Compare
|
Still ready to be reviewed & merged. This PR fixes https://bugs.dolphin-emu.org/issues/11910 As a side note, Nintendo have changed their server infrastructure and previously working games don't work anymore and that isn't related to this PR. Many Wii games send duplicate HTTP Host headers (that's a well-known issue). But the current servers are stricter and don't accept them anymore resulting in Error Code 23400 (aka "HTTP 400 - Bad request"). |
|
So I have a mac so I can do the macOS testing for you. Can you walk me through it? |
|
@MayImilae Sure. You'll need to grab this build of dolphin and the first and second hardware test. Then, make sure your computer has Internet and run the ELF files with the build of Dolphin you downloaded. There are two methods to grab the result. You can pick one of them or use them both. Method 1You can grab the result at the end of the test by connecting to your local IP address and the prompted port (it should be port 16784). I usually use the # My local IP address was 192.168.1.7
# My output file was dolphin_hwtest_shutdown_v2rogII.txt
nc 192.168.1.7 16784 | tee dolphin_hwtest_shutdown_v2rogII.txtMethod 2With this method the output of the test should appear in Dolphin log file:
These tests can take quite some time to run, by the way. |
|
That PR build you pointed to has been merged, so... I'll just use latest master (5.0-12595). Also I'll just use Dolphin's logs since I'm familiar with them. System specs: Ok so, log settings are verbosity Info, write to file, and OSReport and OSHLE. Dolphin settings are more or less normal. Things of note are OpenGL, 1x native, Scaled EFB Copy ON, Skip Presenting Duplicate Frames OFF. Ok so, first test (wii-shutdown-v2) completed successfully. Logs:
The second test (wii-shutdown-v2p2) did not complete. I tried it 4 times and it crashed each time, always late in the run. Verbosity info was exactly the same as the above v2 run that succeeded, so I enabled logging everything and let it run. This is the last line in that log.
Nothing before that is unusual. Here's the full log. So um, yea. Let me know if you want me to try anything. |
|
9/10 is an A-, so I think it's good to go. |
|
@MayImilae My bad, it seems the OSREPORT log is missing. You'll need to enable Dolphin debugging interface under I'll try on my end the second test to see if something has changed or if it's related to the Dolphin build. It can also be an OSX specific issue. |
|
Ok! Here is some proper logs, this time dumped from terminal since the crashed run doesn't dump any logs. wii-shutdown-v2 (successful): https://hastebin.com/eketabapac wii-shutdown-v2p2 (crashed): https://hastebin.com/zaraganudo |
|
@MayImilae Thank you for the log and the files, there were quite useful. After digging into the log, this is what I found so far:
I'll try to see if I can fix the |
|
Let me know if there is anything else you'd like me to try on my mac! If I don't catch you posting here I'm always around on Dolphin's IRC. |
|
@sepalani I tested this PR on macOS 11 Big Sur. The debugger tells me that the process exited with signal 13 (SIGPIPE). Apple's documentation (under "Use POSIX sockets efficiently") says a SIGPIPE will be issued if the connection is closed by default, and the application will be quit if it isn't handled or ignored. I don't really have any experience in POSIX sockets, so sorry if this is wrong or not of any help. |
|
Does this need to be rebased so that the crash fix is in? Would like to get this finally sorted out. |
|
@JMC47 I should but it won't fix the default network interface not being detected properly on macOS and Android. I'd like to sort these two things out, otherwise, these tests are meaningless for those platforms. |
|
I updated the Android results based on this PR: #9191 |
|
So the only thing left is figuring out macOS now? |
|
@JMC47 Yes, indeed. I suspect there is something odd in the Linux part of the code. Part of the hardware test for both Linux and Mac shows a |
|
@JMC47 @OatmealDome @MayImilae You'll need to:
|
|
@OatmealDome @leoetlino @JMC47 |


This PR will need a hardware test (similar #8389) to confirm this behaviour.PR goal
This PR tries to fix inconsistencies regarding
shutdownimplementation (on a socket) and be as close as possible to what the Wii does (not sure about the GC behaviour).What it fixes
It fixes crashes/hangs in some Just Dance games : https://dolp.in/i11910
What it doesn't fix
Hardware test
I created 2 hardware tests:
shutdownon blocking operationsshutdownwas calledHow-to run
Options > Config > Interfacethen tickShow Debugging UIInfoorDebug(On top of that, you can also grab the result using netcat on your local IP address and the result port displayed at the end of the test)
Hardware tests results
Dolphin results are based on
this build #8796latest master and #9191 for Android.Results of the first hwtest
Results of the second hwtest
Analysis
Result value
errno.h)Code changes
The code was changed based on the wanted Wii results, my reasoning was done as follow:
The Wii does nothing and returns 0 for IP_PROTO_UDPAdjust pending operationsB/BIND/LISTEN/ACCEPT#define EINVAL 22 /* Invalid argument */B/CONNECT#define ENETUNREACH 114 /* Network is unreachable */B/CONNECT/RECV,B/BIND/LISTEN/ACCEPT'D/RECVB/BIND/LISTEN/ACCEPT'D/SHUT/RECV,B/CONNECT/SHUT/RECV#define ENOTCONN 128 /* Socket is not connected */B/BIND/LISTEN/ACCEPT'D/SHUT/SEND,B/CONNECT/SHUT/SEND#define ENOTCONN 128 /* Socket is not connected */Ready to be reviewed & merged.