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

Several Cores Crash When input_max_users Set < 5 #3843

Closed
Awakened0 opened this issue Oct 22, 2016 · 28 comments
Closed

Several Cores Crash When input_max_users Set < 5 #3843

Awakened0 opened this issue Oct 22, 2016 · 28 comments

Comments

@Awakened0
Copy link

I'm getting a crash with this core when loading content on today's nightly (10/22). It doesn't happen in the previous one available on the buildbot (10/20). A bt in gdb gives me:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f7789 in dinput_is_pressed (di=0x4f6f110, binds=0x0, port=2, id=7)
at input/drivers/dinput.c:282
282 input/drivers/dinput.c: No such file or directory.
(gdb) bt

0 0x00000000004f7789 in dinput_is_pressed (di=0x4f6f110, binds=0x0, port=2, id=7)

at input/drivers/dinput.c:282

1 0x00000000004f7e4e in dinput_input_state (data=0x4f6f110,

binds=0x96de80 <libretro_input_binds>, port=2, device=1, idx=0, id=7)
at input/drivers/dinput.c:489

2 0x000000000042a74e in input_state (port=2, device=1, idx=0, id=7) at input/input_driver.c:464

3 0x0000000000402443 in core_input_state_poll (port=2, device=1, idx=0, id=7) at core_impl.c:73

4 0x000000001224472a in inputGetKeys_default ()

from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll

5 0x0000000012244dc4 in egcvip_get_input ()

from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll

6 0x0000000012205315 in read_controller ()

from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll

7 0x0000000012205b8d in update_pif_read ()

from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll

8 0x0000000012205f25 in write_si_regs ()

from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll

9 0x0000000010678b7a in ?? ()

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@Awakened0 Awakened0 changed the title Glupen64 Crash (Windows) Glupen64 and Mupen64 Crash (Windows) Oct 24, 2016
@Awakened0
Copy link
Author

Found out this happens with the Mupen core too. I've found Banjo Kazooie works fine in both cores for some reason. Here's a backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f7ec9 in dinput_is_pressed (di=0x5ef8100, binds=0x0, port=2, id=7)
at input/drivers/dinput.c:282
282 input/drivers/dinput.c: No such file or directory.
(gdb) bt
#0 0x00000000004f7ec9 in dinput_is_pressed (di=0x5ef8100, binds=0x0, port=2, id=7)
at input/drivers/dinput.c:282
#1 0x00000000004f85a6 in dinput_input_state (data=0x5ef8100,
binds=0x96ef00 <libretro_input_binds>, port=2, device=1, idx=0, id=7)
at input/drivers/dinput.c:489
#2 0x000000000042a503 in input_state (port=2, device=1, idx=0, id=7) at input/input_driver.c:457
#3 0x0000000000402443 in core_input_state_poll (port=2, device=1, idx=0, id=7) at core_impl.c:73
#4 0x00000000179f596a in inputGetKeys_default (Control=2, Keys=0x14b16050)
at mupen64plus-core/src/plugin/emulate_game_controller_via_libretro.c:710
#5 0x00000000179f7814 in egcvip_get_input (opaque=)
at mupen64plus-core/src/plugin/emulate_game_controller_via_libretro.c:1040
#6 0x000000001799f53e in game_controller_get_input (cont=0x183e2c00 <g_si+384>)
at mupen64plus-core/src/si/game_controller.c:185
#7 read_controller_read_buttons (
cmd=0x183e2ab1 <g_si+49> "\001\004\001\377\377\377\377\377\001\004\001\377\377\377\377_",
cont=0x183e2c00 <g_si+384>) at mupen64plus-core/src/si/game_controller.c:58
#8 read_controller (cont=cont@entry=0x183e2c00 <g_si+384>,
cmd=cmd@entry=0x183e2ab1 <g_si+49> "\001\004\001\377\377\377\377\377\001\004\001\377\377\377\377_") at mupen64plus-core/src/si/game_controller.c:214
#9 0x000000001799ecca in update_pif_read (si=0x183e2a80 <g_si>)
at mupen64plus-core/src/si/pif.c:225
#10 0x00000000179b6675 in dma_si_read (si=0x183e2a80 <g_si>)
at mupen64plus-core/src/si/si_controller.c:68
#11 write_si_regs (opaque=0x183e2a80 <g_si>, address=, value=,
mask=) at mupen64plus-core/src/si/si_controller.c:122
#12 0x000000002354dccf in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@Awakened0
Copy link
Author

Awakened0 commented Oct 24, 2016

Ok, I should have tested multiple cores first. I just tested glupen not working and desmume working and thought it was something with glupen, but several cores are crashing.

Working cores: mGBA, mednafen-wonderswan, Desmume, gambatte, Picodrive, Genesis Plus GX, mednafen-saturn, mednafen-psx, mednafen-ngp, PPSSPP, BSNES-Mercury Balanced.
Non-working cores: Glupen64, Mupen64, MAME, mednafen-supergrafx, Nestopia.

Edit: Here are backtraces for the last three crashing cores:
http://hastebin.com/qevacuduso.swift
http://pastebin.com/ZY2zp496

@Awakened0 Awakened0 changed the title Glupen64 and Mupen64 Crash (Windows) Several Cores Crash (Dinput Related?) [Windows] Oct 24, 2016
@andres-asm
Copy link
Contributor

Have you tried to bisect RetroArch? Or at least tested with 1.3.6?

@andres-asm
Copy link
Contributor

I think it's happening in reicast too

@Awakened0
Copy link
Author

I don't have the stuff to bisect, but at least it seems to have started somewhere after a build from the 20th.

@andres-asm
Copy link
Contributor

andres-asm commented Oct 25, 2016

I just tested up-to-date mupen and RetroArch and I couldn't reproduce
Edit: ditto for Glupen64

Are you running insider builds?
I had some gamepad related breakage recently (steam crashing, xbone pad not connecting, etc)

@Awakened0
Copy link
Author

No, I'm on stable anniversary with all the latest cumulative updates. No problems with my controller or Steam.

@Awakened0
Copy link
Author

Ok, seems setting input_max_users to anything less than 5 results in a crash for certain cores.

@Awakened0 Awakened0 changed the title Several Cores Crash (Dinput Related?) [Windows] Several Cores Crash When input_max_users Set < 5 Oct 25, 2016
@hizzlekizzle
Copy link
Contributor

Someone reported this same issue on Vita a few days ago. I figured it was Vita-specific, but evidently not.

@inactive123
Copy link
Contributor

I was able to reproduce this -

8ce882c

From this point on, it no longer crashes for me on Linux with Mupen64plus when I set max users to 1.

Try to see if it fixes it on all other platforms as well.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

Confirmed! I apparently have this problem. I can't play a NES game (Nestopia) with anything below 4 on input-max_users... on Archlinux. I assume my config was awful. I had it at 1.

Not related. If you set input_max_users to 20~ or above, it'll crash.

Necessary 4 for Nestopia.
Necessary 5 for Mednafen SuperGrafx.
Necessary 2 for BSNES.

@inactive123
Copy link
Contributor

Instead of saying 'confirmed', at least test if it happens with the latest sources.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

Noted. This happened with the latest sources.

@inactive123
Copy link
Contributor

Which input driver/joypad driver are you using, and give me an exact scenario to reproduce this.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

lasers@z420 ~ $ retroarch --version
RetroArch: Frontend for libretro -- v1.3.6 -- 4ec356d --
Compiler: GCC (6.2.1) 64-bitBuilt: Oct 25 2016

I start with input_max_users = "1" before starting in a custom.cfg

I start with no retroarch.cfg.
retroarch --menu --verbose --appendconfig ~/.config/retroarch/config/retroarch.cfg.custom

I didn't explicitly set any input/joypad driver. It is... udev and udev

Navigate to start a random game or pick something from history. I picked something from history. If it didn't start, then that's it.

Repeat with a new higher number until the game eventually starts.

@inactive123
Copy link
Contributor

Which core do you get this crash with? Be specific. I can't reproduce these issues anymore on my end with udev/udev drivers.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

All cores came from Online Updaters.
Necessary max_input 4 for Nestopia.
Necessary max_input 5 for Mednafen SuperGrafx.
Necessary max_input 2 for BSNES.

I will try the cores that I recently got from ./libretro-install.sh right now.

@inactive123
Copy link
Contributor

Cannot reproduce with Nestopia anymore.

I think you don't have the latest nightly built from source, it simply cannot happen anymore after my recent commits.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

I install retroarch-git again from time to time. Compiling latest cores right now with libretro-super. Is this an issue with RetroArch or the cores? I can try and install RetroArch w/ libretro-super too if you prefer that instead.

@inactive123
Copy link
Contributor

It has nothing to do with the cores.

Look, you are not being specific here again. Are you compiling it directly from source or not? It's a very simple question really. You are only adding to the confusion here by not being directly specific here.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

I thought using retroarch-git was the latest source. It looks like it might not be. I tested it with aur/retroarch-git. I'm diving into libretro-super for first time... and am currently compiling the cores. I will compile RetroArch next... then I can tell you if it works fine now.

@inactive123
Copy link
Contributor

Your log above shows you were on an old build.

4ec356d

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

YES.

chris@z420 ~ $ pa -Ss retroarch-git
aur/retroarch-git 1.3.6.r1588.2c0d8e8-1 (73, 1.41) [installed: 1.3.6.r2186.4ec356d-1]
    Reference frontend for the libretro API (Git-latest)

NOW.

chris@z420 ~ $ pa -Ss retroarch-git
aur/retroarch-git 1.3.6.r1588.2c0d8e8-1 (73, 1.41) [installed: 1.3.6.r2234.07421c3-1]
    Reference frontend for the libretro API (Git-latest)

Necessary max_input 4 for Nestopia. // Works with 1 👍
Necessary max_input 5 for Mednafen SuperGrafx. // Works with 1 👍
Necessary max_input 2 for BSNES. // Works with 1 👍

PROBLEM SOLVED? 👍

I notice this different issue just now... Try typing 'x' in search prompt. It comes up x1.

@inactive123
Copy link
Contributor

The x/z issue is known for now. It will require several input code changes in order to fix that.

Anyway, that is a different issue, open a different issue for that if one doesn't already exist.

@lasers
Copy link
Contributor

lasers commented Oct 26, 2016

Sure! I will file it under the "z" issue I made. Sorry I never knew about x.

@Awakened0
Copy link
Author

On windows with the latest buildbot build (b1d1875) SuperGrafx and Nestopia now work with input_max_users = "2", but Glupen64 and MAME 2015 are still crashing.

MAME 2015 backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f5c57 in dinput_pressed_analog (di=0xd110680, binds=0x0, idx=0, id=0)
at input/drivers/dinput.c:303
303 input/drivers/dinput.c: No such file or directory.
(gdb) bt
#0 0x00000000004f5c57 in dinput_pressed_analog (di=0xd110680, binds=0x0, idx=0, id=0)
at input/drivers/dinput.c:303
#1 0x00000000004f62c1 in dinput_input_state (data=0xd110680,
binds=0x968f00 <libretro_input_binds>, port=2, device=5, idx=0, id=0)
at input/drivers/dinput.c:496
#2 0x000000000042afa3 in input_state (port=2, device=5, idx=0, id=0) at input/input_driver.c:457
#3 0x0000000000402443 in core_input_state_poll (port=2, device=5, idx=0, id=0) at core_impl.c:73
#4 0x0000000013162914 in retro_set_controller_port_device ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\mame_libretro.dll
#5 0x0000000013162ac3 in retro_run ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\mame_libretro.dll
#6 0x0000000000402c1f in core_run () at core_impl.c:406
#7 0x0000000000415891 in runloop_iterate (sleep_ms=0x2dafd90) at runloop.c:1234
#8 0x00000000004016e7 in rarch_main (argc=3, argv=0x3b51370, data=0x0) at frontend/frontend.c:127
#9 0x0000000000401755 in SDL_main (argc=3, argv=0x3b51370) at frontend/frontend.c:145
#10 0x00000000006492da in console_main ()
#11 0x0000000000649395 in WinMain ()
#12 0x00000000004013e8 in __tmainCRTStartup ()
at C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:332
#13 0x00000000004014eb in WinMainCRTStartup ()
at C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:184

Glupen64 backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f5c57 in dinput_pressed_analog (di=0x54b0570, binds=0x0, idx=1, id=0)
at input/drivers/dinput.c:303
303 input/drivers/dinput.c: No such file or directory.
(gdb) bt
#0 0x00000000004f5c57 in dinput_pressed_analog (di=0x54b0570, binds=0x0, idx=1, id=0)
at input/drivers/dinput.c:303
#1 0x00000000004f62c1 in dinput_input_state (data=0x54b0570,
binds=0x968f00 <libretro_input_binds>, port=2, device=5, idx=1, id=0)
at input/drivers/dinput.c:496
#2 0x000000000042afa3 in input_state (port=2, device=5, idx=1, id=0) at input/input_driver.c:457
#3 0x0000000000402443 in core_input_state_poll (port=2, device=5, idx=1, id=0) at core_impl.c:73
#4 0x000000001292494c in inputGetKeys_default ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll
#5 0x0000000012924e14 in egcvip_get_input ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll
#6 0x00000000128e5365 in read_controller ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll
#7 0x00000000128e5bdd in update_pif_read ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll
#8 0x00000000128e5f75 in write_si_regs ()
from F:\Blue\Emulation\Emulators\RetroArch\cores\glupen64_libretro.dll
#9 0x000000001bb8dccf in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

They will both work if I set max_users to at least 4 now.

@inactive123
Copy link
Contributor

Test if this fixes it -

26547be

@Awakened0
Copy link
Author

Everything works fine with it set to 2 or 1 now. Thanks!

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

No branches or pull requests

5 participants