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

build compiled today is causing crashes for uwp Xbox One #7934

Closed
dominater01 opened this issue Jan 8, 2019 · 11 comments
Closed

build compiled today is causing crashes for uwp Xbox One #7934

dominater01 opened this issue Jan 8, 2019 · 11 comments

Comments

@dominater01
Copy link

Description

when loading a game with any core on xbox one with todays build crashes back to the dashboard
also when you switch menu icon theme it crashes as well

Expected behavior

to work again as it did on January second

Actual behavior

its crashing to the dashboard

Steps to reproduce the bug

compile today's build and try to load a rom with like bsnes balanced for example and it'll crash like i said

Bisect Results

when i tried to compile the latest build this started happening

Version/Commit

v1.7.5

Environment information

Xbox One

@dominater01
Copy link
Author

this isnt a core issue tho its whenever retroarch tries to load something it freezes just fyi

@orbea
Copy link
Contributor

orbea commented Jan 8, 2019

Can you please find the first bad commit?

@dominater01
Copy link
Author

idk how to do that

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

Can confirm the issue

ac8d3d7a51f8b567921810b52cc68530b48da2ff is the first bad commit
commit ac8d3d7a51f8b567921810b52cc68530b48da2ff
Author: alfrix <alfredomonclus@gmail.com>
Date:   Thu Jan 3 13:49:59 2019 -0300

    Simplify the icon search and handle incomplete themes better

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

To be more exact, it's this part of the code. It stops crashing if you remove it.
ac8d3d7#diff-1e9b0a301545e8dec64757c9583ea418R4922 (ping @alfrix)

The cause of the crash is the d3d11 driver not being able to initialize properly (does menu_display_reset_textures_list do something weird with driver initialization??)

Exception reported in location 0x00007FFCC0315299 in RetroArch-msvc2017-UWP.exe: Microsoft C++ language exception: _com_error in memory location 0x000000E95F8FC620.
[Video]: Cannot open video driver ... Exiting ...
Fatal error received in: "init_video()"
failed_to_start_audio_driver
Exception reported in location 0x00007FF63722E0ED in RetroArch-msvc2017-UWP.exe: 0xC0000005: Access violation reading location 0x0000000000000020.
**d3d11** was nullptr.

(nothing really check if it did initialize or not and it just tries to run d3d11_gfx_frame anyway resulting in a crash, I noticed this when working on some things earlier)

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

I also noticed these messages in the logs:

[XMB] Asset missing: C:\Users\krzys\AppData\Local\Packages\1e4cf179-f3c2-404f-b9f3-cb2070a5aad8_t9k5fqjen2nz4\LocalState\assets\xmb\monochrome\png\input_ADC.png
[XMB] Asset missing: C:\Users\krzys\AppData\Local\Packages\1e4cf179-f3c2-404f-b9f3-cb2070a5aad8_t9k5fqjen2nz4\LocalState\assets\xmb\monochrome\png\input_BIND_ALL.png
[XMB] Asset missing: C:\Users\krzys\AppData\Local\Packages\1e4cf179-f3c2-404f-b9f3-cb2070a5aad8_t9k5fqjen2nz4\LocalState\assets\xmb\monochrome\png\input_MOUSE.png
[XMB] Asset missing: C:\Users\krzys\AppData\Local\Packages\1e4cf179-f3c2-404f-b9f3-cb2070a5aad8_t9k5fqjen2nz4\LocalState\assets\xmb\monochrome\png\input_LGUN.png
[XMB] Asset missing: C:\Users\krzys\AppData\Local\Packages\1e4cf179-f3c2-404f-b9f3-cb2070a5aad8_t9k5fqjen2nz4\LocalState\assets\xmb\monochrome\png\input_TURBO.png

Updating assets fixes the issue (did something change recently?), but it probably shouldn't crash when loading fails...

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

The reason this happens is that there is a leak of textures that are never freed. This causes Release(d3d11->device) to fail with an error. On normal Windows this does not crash since the window is completely destroyed and then recreated (but the old device probably still stays somewhere in memory). On UWP, it tries to create a new device in the same window and the operation fails because the old context still exists and you obviously can't have two devices on one window.

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

@alfrix Here is a proper (but very ugly) way to achieve what you were trying to do:

diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c
index e57d94c20d..7f450ce532 100644
--- a/menu/drivers/xmb.c
+++ b/menu/drivers/xmb.c
@@ -4925,6 +4925,8 @@ static void xmb_context_reset_textures(
             /* Draw Setting icon if the entry has submenus, (aesthetic improvement for incomplete themes) */
             if (xmb->depth > 0)
             {
+               /* At this point, the _SUBSETTING texture is already loaded. Free it first. */
+               video_driver_texture_unload(&xmb->textures.list[i]);
                if (
                      !menu_display_reset_textures_list(xmb_texture_path(XMB_TEXTURE_SETTING), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR)
                   )

@inactive123
Copy link
Contributor

I really don't like how the XMB menu driver is getting more and more messy with all these conditionals, now leading to issues like this.

And yes you're right @krzys-h, it should never crash just because it's missing some assets. That is absolutely unacceptable.

@inactive123
Copy link
Contributor

I merged this, does this solve the issue?

#7939

@krzys-h
Copy link
Contributor

krzys-h commented Jan 8, 2019

Yeah, it does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants