Skip to content
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

EXI: Don't kill Dolphin when receiving BBA_IOB #12574

Merged
merged 1 commit into from Feb 12, 2024

Conversation

sepalani
Copy link
Contributor

This PR prevents Dolphin from being killed when receiving BBA_IOB. Apparently, in some circumstances, the game might be in such situation and it might be non-fatal. For instance, when sending tons of UDP packet to an unbound port this situation can happen. This seems to only affect BBA TAP adapter.

I was able to replicate the issue on Windows 10 (OpenVPN 2.4.11's TAP Adapter V9) with Mario Kart: Double Dash and Kirby Air Ride. It happens during the matchmaking sequence, right after Dolphin's BBA acquired an IP address and announced it via ARP.

The following python script can be used to spam UDP packets to an unbound port (Wireshark can be used to find Dolphin's BBA IP using arp filter):

#! /usr/bin/env python
from random import randint
from socket import *


def send_loop(ip, port=26510, size=1024):
    print("Keep sending {}-bytes data to {}:{}".format(size, ip, port))
    data = bytearray((randint(0, 255) for _ in range(size)))
    try:
        s = socket(AF_INET, SOCK_DGRAM)
        while True:
            s.sendto(data, (ip, port))
    finally:
        s.close()


if __name__ == "__main__":
    # Example:
    # python send_udp.py 169.254.220.117
    from sys import argv
    send_loop(*argv[1:])

Games don't appear to crash when the error is occurring and I'd rather have these games crash than the emulator exiting silently without a panic alert.

Ready to be reviewed & merged.

According to @Kirbymimi it doesn't crash on real hardware.

Testing was done by sending many UDP packets to an unbound port.
Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. We should never be using exit() in core code like this.

@lioncash lioncash merged commit aa66842 into dolphin-emu:master Feb 12, 2024
11 checks passed
@sepalani sepalani deleted the exi-exit branch March 23, 2024 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants