pokepoke121 / valentine-hbl

Automatically exported from code.google.com/p/valentine-hbl
Other
0 stars 0 forks source link

(Since R93) Doom crashes when going back to the menu #269

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is a specific game error, but it appeared with R93 and I want to track 
this issue.
Basically what changed is that we now load the network libraries. When exiting 
Doom, I get a "memory leak" message, then the PSP turns off.

Haven't investigated fully yet.
This is doom 1.4 I believe, I can provide thehomebrew if needed

Original issue reported on code.google.com by wagic.the.homebrew@gmail.com on 5 Jul 2010 at 3:04

GoogleCodeExporter commented 8 years ago
Not doom only, DosBox too.

Original comment by battatona@gmail.com on 5 Jul 2010 at 5:56

GoogleCodeExporter commented 8 years ago

Original comment by ametric@gmail.com on 5 Jul 2010 at 6:51

GoogleCodeExporter commented 8 years ago

Original comment by ametric@gmail.com on 5 Jul 2010 at 6:52

GoogleCodeExporter commented 8 years ago
Doom doesn't shut down the net libraries. At the time when the utility modules 
are unloaded by HBL, there are still three networking threads running:
UID: 0x0492C64F - Name: SceNetCallout
UID: 0x0492405D - Name: SceNetNetintr
UID: 0x0435D871 - Name: SceNetApctl
I can provoke the same error in PSPdisp when initializing the network 
libraries, then exiting without uninitializing them.

DOOM 1.4 is open source and a quick browse through it shows no sign of 
pspSdkInetTerm() or sceNetTerm() or similar, too.

Original comment by jochen.s...@gmail.com on 7 Jul 2010 at 10:05

GoogleCodeExporter commented 8 years ago
We force shut down threads when exiting a game, how comes these ones refuse to 
exit?

Original comment by wagic.the.homebrew@gmail.com on 7 Jul 2010 at 11:17

GoogleCodeExporter commented 8 years ago
Aren't only threads created by the homebrew deleted? These threads are created 
by the net modules themselves, of which some run in kernel mode 
(sceNet_Service). Those are not known to hbl I guess.

Original comment by jochen.s...@gmail.com on 7 Jul 2010 at 11:28

GoogleCodeExporter commented 8 years ago
Yes, that's it JJS.

Original comment by ametric@gmail.com on 7 Jul 2010 at 12:11

GoogleCodeExporter commented 8 years ago
dosbox has never closed right with hbl idk why u have to just keep holding the 
power button until the light stops flashing

Original comment by cscash241 on 7 Jul 2010 at 2:00

GoogleCodeExporter commented 8 years ago
ok, so we have to hook the functions creating those threads, in order to track 
them...

Original comment by queffe...@gmail.com on 9 Jul 2010 at 2:01

GoogleCodeExporter commented 8 years ago
(sorry that was me above)

Original comment by wagic.the.homebrew@gmail.com on 9 Jul 2010 at 2:02

GoogleCodeExporter commented 8 years ago
I started working on this and pretty much have a solution. I'll be doing some 
tests on the PSPGo and submit in a few days.

Original comment by wagic.the.homebrew@gmail.com on 11 Jul 2010 at 8:24

GoogleCodeExporter commented 8 years ago
Hmm, not working as smooth as I want, I need to think a bit more

Original comment by wagic.the.homebrew@gmail.com on 11 Jul 2010 at 12:37

GoogleCodeExporter commented 8 years ago
Ok, fixed. I'll test other games to make sure I didn't break anything major, 
and I'll submit in the days to come

Original comment by wagic.the.homebrew@gmail.com on 11 Jul 2010 at 1:03

GoogleCodeExporter commented 8 years ago
I haven't looked into this enough to tell if there needs to be a distinction, 
but does the fix work for both infrastructure and adhoc?

Original comment by jochen.s...@gmail.com on 11 Jul 2010 at 5:06

GoogleCodeExporter commented 8 years ago
I'm basically calling the following functions when closing a homebrew:
sceNetApctlTerm();
sceNetResolverTerm();
sceNetInetTerm();
sceNetTerm();

I believe this would work in all cases.
Each function is called only if the appropriate library is loaded

Original comment by wagic.the.homebrew@gmail.com on 11 Jul 2010 at 9:07

GoogleCodeExporter commented 8 years ago
Not sure, for adhoc mode these (and there respective ...Term() functions) are 
not called:
sceNetApctlInit()
sceNetResolverInit()
sceNetInetInit()

but:
sceNetAdhocInit();
sceNetAdhocctlInit();

I am not too familiar with adhoc mode, but this is what I recall and gather 
based on this adhoc sample: http://forums.ps2dev.org/viewtopic.php?p=88548.

Original comment by jochen.s...@gmail.com on 11 Jul 2010 at 9:47

GoogleCodeExporter commented 8 years ago
Fixed in R94, let's add the adhoc ones if we find a game that uses them and has 
such an issue

Original comment by wagic.the.homebrew@gmail.com on 13 Jul 2010 at 11:07