Comments (17)
can you narrow down what error resulted in this panic?
from libnx.
I am not certain; for nx-hbmenu, the issue was introduced with the UI update; it seems that anything with "complex" graphics is more liable to cause this crash. Also potentially notable is, if you manage to launch an NRO from nx-hbmenu before it crashes, the application itself will eventually crash with the same 2345-0021 error that the hbmenu itself usually does, whereas it would not have crashed if loaded directly.
from libnx.
Are you able to modify libnx gfx.c to determine the error trigger? "loaded directly" ?
from libnx.
I've not been successful at pinpointing the exact problem, but upon further testing I noticed that the 1.0 version of nx-hbmenu is not subject to these crashes. As for "loaded directly", I meant loading an NSP directly with nspwn.
from libnx.
"Are you able to modify libnx gfx.c to determine the error trigger?"
(Just write to a file with stdio)
from libnx.
Sorry for the slow replies. It seems Swiftloke beat me to doing this; here's a log of the #switchdev conversation for posterity:
<Swiftloke> I've done a little bit of digging with my 1.0.0 Switch, and managed to backtrace to the BadGfxDequeueError and where it occurs.
<Swiftloke> The error is LibnxNvidiaError_InsufficientMemory.
<yellows8> what returns that?
<Swiftloke> The error originally sprouts up here:
<Swiftloke> https://github.com/switchbrew/libnx/blob/1e04b22bae5eb3fd89783b6bd5b3cbf1c08a9365/nx/source/gfx/nvgfx.c#L426
<Swiftloke> Then it's carried down here:
<Swiftloke> https://github.com/switchbrew/libnx/blob/3a8a9d7c2695294845464a1eea68800005425e7a/nx/source/gfx/gfx.c#L142
<Swiftloke> Then to here:
<Swiftloke> https://github.com/switchbrew/libnx/blob/3a8a9d7c2695294845464a1eea68800005425e7a/nx/source/gfx/gfx.c#L517
<yellows8> ok :/
from libnx.
Try with: 726f8ad
from libnx.
Several tests with this commit yield success- hbmenu 2.0 no longer crashes on startup. I'll be trying more various homebrew and reporting back.
from libnx.
Yeah, likewise here. As I mentioned in #switchdev, seems the issue is resolved, at least with nx-hbmenu.
from libnx.
Posting this for historical reasons. As an update to my earlier debugging, it turns out that the error was due to improper handling of the LibnxNvidiaError_Timeout error, and not something running out of memory, see below:
Swiftloke 15:37:19
Well, it works on 1.0.0. It was a failure to handle the timeout error correctly, then?
@yellows8 15:38:23
yeah
Swiftloke 15:38:41
So why did it end up throwing InsufficientMemory then...?
Huh.
@yellows8 15:39:15
was it *really* InsufficientMemory?
Swiftloke 15:39:47
OK...
So... The error actually shown in fatal was off by one in the corresponding result.h error. I figured this out about halfway through debugging, after I had decided what the error was.
So it was Timeout.
from libnx.
I am using the suggested commit fix at 726f8ad but I still get a libnx crash with the same error.
More specifically, nvgfxEventWait is returning 0xF5C, which is LibnxNvidiaError_InsufficientMemory if I am reading this correctly. Any ideas how this can happen?
(FWIW, also only seems to happen on 1.0.0)
from libnx.
Can you try with libnx 1.2.1?
from libnx.
Still same error on libnx 1.2.1.
I fixed it by adding this:
Result nvgfxEventWait(u32 syncpt_id, u32 threshold, s32 timeout) {
Result rc=0;
Result timeout_rc = MAKERESULT(Module_LibnxNvidia, LibnxNvidiaError_Timeout);
Result insufficientmemory_rc = MAKERESULT(Module_LibnxNvidia, LibnxNvidiaError_InsufficientMemory);
if (R_SUCCEEDED(rc)) {
do {
rc = nvioctlNvhostCtrl_EventWait(g_nvgfx_fd_nvhostctrl, syncpt_id, threshold, timeout, 0, &g_nvgfx_nvhostctrl_eventres);
} while(rc==timeout_rc || rc == insufficientmemory_rc);
}
The insufficient memory error does not seem to be fatal as just retrying seems to make it go away.
from libnx.
What code did you use to obtain that 0xF5C error, and are you sure it's correct?
from libnx.
I used UART to print the errorcodes that are not timeout_rc and not 0. Only the 0xF5C error popped up once in a while. It happens very rarely and only very early on application start, but if it happened, it was fatal.
from libnx.
Hi,
My latest version of pfba does have the same error randomly (after loading multiple times a rom). I guess it could be a problem on my side. I'm using latest libnx sources, and i'm on 5.1 since a few days. Not sure what causing the problem (libnx, some pfba changes, the 5.1 update..).
I'm going to take a closer look to see where it really crash.
from libnx.
Hi,
For information, i fixed my crash with this commit : Cpasjuste/libcross2dui@b347921#diff-c9a7f53fde38976bb82d1b09304cc1b5
from libnx.
Related Issues (20)
- Bug in sessionmgr attach/detach logic can cause deadlocks HOT 2
- inet_pton() failure for 0.0.0.0
- Can't open file sys/lock.h HOT 1
- Linking errors with nwindowGetDefault() HOT 8
- Rotated/Normalized controller layouts using the pad abstraction API HOT 2
- Question: Home button HOT 3
- SL/SR buttons usage on hiddbg HOT 6
- Linear framebuffer crashes on certain dimensions HOT 2
- hidScanInput() was not declared in this scope HOT 6
- When i try to compile a .nro in devkitpro, i get this error: HOT 3
- web applet fails to connect to local server running on the switch HOT 17
- Question: Video HW Decoder HOT 9
- Nintendo HOT 1
- make a relase/how to compile it HOT 2
- ASCII Usage of "\" HOT 2
- Problem to print special chars in console mode HOT 4
- bool to pointer
- Wrong Github (sorry)
- Support: How to get a list of installed DLCs? HOT 2
- devkitPro on NixOS? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libnx.