Skip to content

Crash: controller input on horizontal skill selection dialog movement

Original issue description opened by Brian Degenhardt which was apparently deleted after a fallacious GitLab ban:

Crash: controller input on fortify/drain skill spellmaking When Spellmaking with a game controller, traversing the selection dialog of skills makes the game crash. It works for abilities, but for stuff like 'Drain alchemy' it crashes on any horizontal movement. Selecting with the mouse works fine.

Is the problem OpenMW specific or does it also happen in vanilla Morrowind?

OpenMW specific. Specifically it's the new controller input commit.

What is your operating system?

Rocknix aarch64 on a retroid pocket flip2 running Portmaster

What version of OpenMW are you using? If you used a bleeding edge build, state the exact revision used.

Rocknix aarch64 on a retroid pocket flip2 running Portmaster

What version of Morrowind are you using (i.e. retail CD or Steam)? What addons (Tribunal, Bloodmoon) do you have installed?

GOG version goty What language is your Morrowind install?

english

Do you use any mods? If so, does the problem also occur in a clean vanilla install without any mods?

momw starter pack

What are the exact steps to reproduce the problem?

Once you acquire a Drain Skill spell, find a spellmaker and try to craft a spell to drain a skill. When presented with the selection dialog for which skill to drain (Alchemy, long blade, sneak, etc) use the controller to move horizontally through the list.

What did you expect to happen? What happened instead?

Segfault

Are there any error messages in your openmw.log file? If you're not an OpenMW team member, it's best to upload it.

Yeah, there's a crash dump but I don't have debug symbols so the stack trace isn't helpful. This should be easy to reproduce, and if not I can upload the log.

What settings do you use? If you're not an OpenMW team member, it's best to upload your settings.cfg.

[GUI]

controller menus = true

controller tooltips = true

Where is the in-game location this problem can be observed? Avoid vague statements such as "west of town X". Instead, open the console (` key by default, the key above Tab), click on the problematic object, then use the betacomment (bc) instruction to get useful information about the object that you can copy and paste into the bugreport:

I did this in the Ebonhart mages guild since that's the first time I saw these spells.

Confirmed (see attached dump) openmw.exe.11076.7z.001 openmw.exe.11076.7z.002

This also happens if you move horizontally with the Gamepad when selecting skills during Character Creation with a custom class and I think the spell creation dialog for selecting skills for Drain/Fortify effects just reuse that menu.

mControllerFocus and mNumSkillsPerSpecialization viewed in the dump's local variables show garbage values (see screenshot):

image

The crash happens on line 1123 in class.cpp:

mSkillButtons[mControllerFocus]->setStateSelected(true);

It appears the crash occurs because SelectSkillDialog leaves mControllerFocus uninitialized to the intended initial value of 0, leading to garbage values when handling controller navigation.

At least initializing mControllerFocus = 0; should prevent this in both character creation and spell effect skill selection. Maybe not a bad idea to initialize NumSkillsPerSpecialization too?

Brian had a draft Merge Request here before the silly GitLab ban: https://github.com/kloptops/openmw/pull/2/files

Edited by Greendogo