spacemeowx2 / ldn_mitm

Play local wireless supported games online
GNU General Public License v2.0
702 stars 98 forks source link

ldn_mitm crash 0x4a8 when just opening and closing Pokemon Sw&Sh #43

Closed Koi-3088 closed 4 years ago

Koi-3088 commented 4 years ago

Firmware 10.1, Atmosphere 11, 11.1 and 12, ldn_mitm 1.3.4

Issue: Opening and closing Pokemon Sword and Shield a certain number of times with ldn_mitm enabled will cause an Atmosphere crash 2168-0002(0x4a8).

Steps to reproduce: Just open and close the game repeatedly. Highest I could go was 50 resets, but happens sooner more often than not. Issue is expedited when running bots or scripts (SysBot, for example).

Tests I've done: With ldn_mitm and sys-botbase running (crash after 37 resets). Without sys-botbase and just ldn_mitm (crash also after around 37 resets). Without sys-botbase or ldn_mitm (no crashes after more than 100 resets).

Attaching the latest crash log from the second test (no SysBot, ldn_mitm enabled, manually opening and closing game) 01420896844_4200000000000010.log

Koi-3088 commented 4 years ago

I will edit my original post because I wrote "SysBot" instead of sys-botbase.

I will try it just to see, but these crashes happen with sys-botbase completely removed from the Switch and with just ldn_mitm installed.

Manually closing the game without sys-botbase, and with just ldn_mitm still results in a crash after 30-40 times.

Real96 commented 4 years ago

I will edit my original post because I wrote "SysBot" instead of sys-botbase.

I will try it just to see, but these crashes happen with sys-botbase completely removed from the Switch and with just ldn_mitm installed.

Manually closing the game without sys-botbase, and with just ldn_mitm still results in a crash after 30-40 times.

Sorry i deleted the comment because i just got the same error using the new sysbot-base + ldn_mitm. So both have the same problem. You have to use this version + wifi patch to not let the wifi being disabled. I arrived at 150 resets without problems, before testing it with ldn_mitm and getting the crash error

Koi-3088 commented 4 years ago

What kind of a wifi patch?

Real96 commented 4 years ago

What kind of a wifi patch?

You have to use ipswitch Instructions here

@nsobid-9D2DB721A98940759841D760A759AFD57889A2DA
# Pokemon Sword 1.1.1
@flag offset_shift 0x100

// no ldn
@enabled
017FD650 00008012C0035FD6
@nsobid-B44ABD65A6A2FE82361164D5B2306617F8B479C3
# Pokemon Shield 1.1.1
@flag offset_shift 0x100

// no ldn
@enabled
017FD6F0 00008012C0035FD6
Koi-3088 commented 4 years ago

Hmm, thanks, I'll take a look.

Real96 commented 4 years ago

250 resets and still no crash. So the problem is surely in ldn_mitm

spacemeowx2 commented 4 years ago

There might be a memory leak

Bappsack commented 4 years ago

There might be a memory leak

still crashing same behavior

spacemeowx2 commented 4 years ago

I think the thread object is leaked since 1.3.4. Try to use this build to see if it is fixed: https://github.com/spacemeowx2/ldn_mitm/runs/655680706

Real96 commented 4 years ago

I think the thread object is leaked since 1.3.4. Try to use this build to see if it is fixed: https://github.com/spacemeowx2/ldn_mitm/runs/655680706

Tested, got 150 resets without any crash. Great job!

Koi-3088 commented 4 years ago

Been running the linked build for the entire day, seems to be stable and hasn't crashed yet. Thank you, Space! Closing.