Opened 4 months ago

Closed 3 months ago

Last modified 3 months ago

#12012 closed defect (fixed)

BACKENDS: AMIGAOS: Rewrote of encoder causes assertion on typing ALT+(WASDXC) key combos (AmigaOS4)

Reported by: raziel- Owned by: ccawley2011
Priority: normal Component: Common
Version: Keywords: regression, encoder, iconv
Cc: Game:

Description (last modified by raziel-)

Latest sources built locally

Since no one else seems to have this problem, i bisected it myself manually and found the culprit in this commit: https://github.com/scummvm/scummvm/commit/68a9136e4d43b424243e4ad33821138a7b659aa0
which was this FR: https://github.com/scummvm/scummvm/pull/2586

Unfortunately i don't know anything about the stuff in there, but would love to have this fixed on AmigaOS.

@phcoder
Could you take a look, please?

@BeWorld2018
Could you test on MorphOS as well, please?

Thanks a lot in advance

Change History (10)

comment:1 by athrxx, 4 months ago

Could you please be even more specific? Which exact versions (platform and language) of which exact games trigger which exact assert?

comment:2 by raziel-, 4 months ago

@athrxx

Truly sorry, i thought i linked to the thread which had the assertion mentioned.

It's always the same assertion:
assertion "_str && idx >= 0 && idx < (int)_size" failed: ".common/base-str.h", line 176

Every SCUMM-based game is affected.
It's crashing as soon as i press ALT+X (but it's not limited to that, just used it since every SCUMM game use that hotkey. It also asserts out when using f.e. ALT+W in Maniac Mansion/Monkey Island, i forgot if there were more in-game hotkeys, but it doesn't matter as it seems all of the combinations are affected)

I did test all of the games i own and all suffer from it.

LucasArts:
Full Throttle (Version A/English)
Indiana Jones and the Last Crusade (FM-TOWNS/English)
Indiana Jones and the Fate of Atlantis (CD/DOS/English)
Loom (VGA/DOS/English)
Maniac Mansion (V2/Amiga/English)
Maniac Mansion: Day of the Tentacle (CD/English)
Monkey Island 1: The Secret of Monkey Island (CD/DOS/English)
Monkey Island 2: LeChuck's Revenge (DOS/English)
Monkey Island 3: The Curse of Monkey Island (Windows/English)
Sam & Max Hit the Road (CD/English)
The Dig (english cd - it doesn't add any information to the game entry)
Zak McKracken and the Alien Mindbenders (FM-TOWNS/English)

Humongous Entertainment:
Fatty Bear's Birthday Surprise (Windows/English)
Freddi Fish 1: The Case of the Missing Kelp Seeds (Updated/English)
Freddi Fish 2: The Case of the Haunted Schoolhouse (Updated/Windows/English)
Freddi Fish 3: The Case of the Stolen Conch Shell (Windows)
Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Windows)
Freddi Fish 5: The Case of the Creature of Coral Cove (no more info added)
Pajama Sam 1: No Need to Hide When It's Dark Outside (Updated/English)
Pajama Sam 2: Thunder and Lightning Aren't so Frightening (Windows/English (US))
Pajama Sam 3: You Are What You Eat From Your Head to Your Feet (Windows/English (US))
Putt-Putt 1: Joins the Parade (Windows/English)
Putt-Putt 2: Goes to the Moon (Windows/English)
Putt-Putt 3: Saves the Zoo (Windows)
Putt-Putt 4: Travels Through Time (Windows/English (US))
Putt-Putt 5: Enters the Race (English (US))
Putt-Putt 6: Joins the Circus (English (US))
SPY Fox 1: Dry Cereal (Updated/English)
SPY Fox 2: Some Assembly Required (Windows)
SPY Fox 3: Operation Ozone (English (US))

comment:3 by raziel-, 4 months ago

and here is a somewhat more complete crashlog (i was able to get from ZakMacKracken)

Dump of context at 0xDF7537C0
Trap type: DSI exception
Machine State (raw): 0x1000000000009030
Machine State (verbose): [Hyper] [ExtInt on] [Super] [IAT on] [DAT on]
Instruction pointer: 0x7EBB24F4
Crashed process: SDL thread SDLTimer (0x4fa33580) (0x50526990)
DSI verbose error description: Access not found in hash or BAT (page fault)
Access was a load operation
 0: 7EC4EB7C 5BFFBEE0 00000000 4E516098 00000000 00000000 72A72000 000CA924
 8: 0000000D 4EAD0000 00000001 000CBEA4 000F4240 00000000 5D4EEDA4 4E884640
16: 02B30000 DF7E2550 02B30000 00000000 5D4EEDA0 00000000 000034FE 00000000
24: 00000000 502F96F4 00000000 4ED48CAC 4ED48C9C 4ED48C0C 502F94A0 0000000A
CR: 40822842   XER: 20000000  CTR: 7E897804  LR: 7E897834
DSISR: 40000000  DAR: 4E516098
HID0: 0x8000000000000000  HID1: 0x000000005CE993B1
HID4: 0x4400240000080180  HID5: 0x0000006600000080

Disassembly of crash site:
 7EBB24E4: 3D204EAD   lis               r9,20141
 7EBB24E8: 809F0000   lwz               r4,0(r31)
 7EBB24EC: 806950F8   lwz               r3,20728(r9)
 7EBB24F0: 83E1000C   lwz               r31,12(r1)
>7EBB24F4: 81230000   lwz               r9,0(r3)
 7EBB24F8: 812900FC   lwz               r9,252(r9)
 7EBB24FC: 38210010   addi              r1,r1,16
 7EBB2500: 7D2903A6   mtctr             r9
 7EBB2504: 4E800420   bctr
 7EBB2508: 90830000   stw               r4,0(r3)

Kernel command line: serial debuglevel=0

Registers pointing to code:
r0 : module ScummVM at 0x7EC4EB7C (section 5 @ 0x26D5B58)
r9 : module ScummVM at 0x4EAD0000 (section 4 @ 0x60FDC)
r10: module CURRDIR:PCI_SoundCardHornet.driver at 0x00000001 (section 0 @ 0xFFFFFFDC)
r16: native kernel module graphics.library.kmod+0x00860580
r18: native kernel module graphics.library.kmod+0x00860580
r27: module ScummVM at 0x4ED48CAC (section 4 @ 0x2D9C88)
r28: module ScummVM at 0x4ED48C9C (section 4 @ 0x2D9C78)
r29: module ScummVM at 0x4ED48C0C (section 4 @ 0x2D9BE8)
ip : module ScummVM at 0x7EBB24F4 (section 5 @ 0x26394D0)
lr : module ScummVM at 0x7E897834 (section 5 @ 0x231E810)
ctr: module ScummVM at 0x7E897804 (section 5 @ 0x231E7E0)

Stack trace:
(0x5BFFBEE0) module ScummVM at 0x7EBB24F4 (section 5 @ 0x26394D0)
(0x5BFFBEF0) module ScummVM at 0x7E897834 (section 5 @ 0x231E810)
(0x5BFFBF10) module ScummVM at 0x7EC4EB7C (section 5 @ 0x26D5B58)
(0x5BFFBF50) module ScummVM at 0x7EC4D20C (section 5 @ 0x26D41E8)
(0x5BFFBF70) module ScummVM at 0x7EC4E16C (section 5 @ 0x26D5148)
(0x5BFFBF90) native kernel module dos.library.kmod+0x000255c8
(0x5BFFBFC0) native kernel module kernel+0x000420ac
(0x5BFFBFD0) native kernel module kernel+0x000420f4

Disassembly of crash site:
 7EBB24E4: 3D204EAD   lis               r9,20141
 7EBB24E8: 809F0000   lwz               r4,0(r31)
 7EBB24EC: 806950F8   lwz               r3,20728(r9)
 7EBB24F0: 83E1000C   lwz               r31,12(r1)
>7EBB24F4: 81230000   lwz               r9,0(r3)
 7EBB24F8: 812900FC   lwz               r9,252(r9)
 7EBB24FC: 38210010   addi              r1,r1,16
 7EBB2500: 7D2903A6   mtctr             r9
 7EBB2504: 4E800420   bctr
 7EBB2508: 90830000   stw               r4,0(r3)
Stack pointer (0x5BFFBEE0) is inside bounds
Redzone is OK (4)

68k register dump
DATA: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ADDR: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Page information:
Page not found
Dump of context at 0xDF7533E0
Trap type: DSI exception
Machine State (raw): 0x100000000000B030
Machine State (verbose): [Hyper] [ExtInt on] [Super] [FPU on] [IAT on] [DAT on]
Instruction pointer: 0x7EBB24F4
Crashed process: SDL thread SDLAudioP1 (0x502f90a8) (0x50526810)
DSI verbose error description: Access not found in hash or BAT (page fault)
Access was a load operation
 0: 7EC17A80 5C1F3ED0 00000000 4E516098 502F9490 00000000 02A8824C 02A8826C
 8: 4F5A4200 4EAD0000 502F9490 02020298 22842444 00000000 5D4E9DA4 4E884550
16: 02B30000 DF7E2490 02B30000 00000000 5D4E9DA0 00000000 00008000 5D4FB828
24: 4FA37D48 5D4FB828 502F8600 00008000 502F85FC 502F93D8 4EA7FC7C 502F85C0
CR: 42842442   XER: 20000000  CTR: 7E8970FC  LR: 7EB0BBB4
DSISR: 40000000  DAR: 4E516098

FP0 : FFF8000082000000 FFF8000000000000 0202020202020202 0101010101010101
FP4 : 0202020202020202 0202020202020202 4048800000000000 4049000000000000
FP8 : FFD8D8D8FFD8D8D8 4330000080000022 433000008000023E 412E848000000000
FP12: 41E0000000000000 00001FFFFFFFFFFF 0000000000000000 0000000000000000
FP16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FP20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FP24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FP28: 0000000000000000 0000000000000000 0000000000000000 8000000000000000
FPSCR: 82000000
HID0: 0x8000000000000000  HID1: 0x000000005CE993B1
HID4: 0x4400240000080180  HID5: 0x0000006600000080

Disassembly of crash site:
 7EBB24E4: 3D204EAD   lis               r9,20141
 7EBB24E8: 809F0000   lwz               r4,0(r31)
 7EBB24EC: 806950F8   lwz               r3,20728(r9)
 7EBB24F0: 83E1000C   lwz               r31,12(r1)
>7EBB24F4: 81230000   lwz               r9,0(r3)
 7EBB24F8: 812900FC   lwz               r9,252(r9)
 7EBB24FC: 38210010   addi              r1,r1,16
 7EBB2500: 7D2903A6   mtctr             r9
 7EBB2504: 4E800420   bctr
 7EBB2508: 90830000   stw               r4,0(r3)

Kernel command line: serial debuglevel=0

Registers pointing to code:
r0 : module ScummVM at 0x7EC17A80 (section 5 @ 0x269EA5C)
r6 : native kernel module kernel+0x00a8824c
r7 : native kernel module kernel+0x00a8826c
r9 : module ScummVM at 0x4EAD0000 (section 4 @ 0x60FDC)
r11: native kernel module kernel+0x00020298
r16: native kernel module graphics.library.kmod+0x00860580
r18: native kernel module graphics.library.kmod+0x00860580
r30: module ScummVM at 0x4EA7FC7C (section 4 @ 0x10C58)
ip : module ScummVM at 0x7EBB24F4 (section 5 @ 0x26394D0)
lr : module ScummVM at 0x7EB0BBB4 (section 5 @ 0x2592B90)
ctr: module ScummVM at 0x7E8970FC (section 5 @ 0x231E0D8)

Stack trace:
(0x5C1F3ED0) module ScummVM at 0x7EBB24F4 (section 5 @ 0x26394D0)
(0x5C1F3EE0) module ScummVM at 0x7EB0BBB4 (section 5 @ 0x2592B90)
(0x5C1F3F20) module ScummVM at 0x7EC17A80 (section 5 @ 0x269EA5C)
(0x5C1F3F50) module ScummVM at 0x7EC4D20C (section 5 @ 0x26D41E8)
(0x5C1F3F70) module ScummVM at 0x7EC4E16C (section 5 @ 0x26D5148)
(0x5C1F3F90) native kernel module dos.library.kmod+0x000255c8
(0x5C1F3FC0) native kernel module kernel+0x000420ac
(0x5C1F3FD0) native kernel module kernel+0x000420f4

Disassembly of crash site:
 7EBB24E4: 3D204EAD   lis               r9,20141
 7EBB24E8: 809F0000   lwz               r4,0(r31)
 7EBB24EC: 806950F8   lwz               r3,20728(r9)
 7EBB24F0: 83E1000C   lwz               r31,12(r1)
>7EBB24F4: 81230000   lwz               r9,0(r3)
 7EBB24F8: 812900FC   lwz               r9,252(r9)
 7EBB24FC: 38210010   addi              r1,r1,16
 7EBB2500: 7D2903A6   mtctr             r9
 7EBB2504: 4E800420   bctr
 7EBB2508: 90830000   stw               r4,0(r3)
Stack pointer (0x5C1F3ED0) is inside bounds
Redzone is OK (4)

68k register dump
DATA: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ADDR: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Page information:
Page not found

comment:4 by raziel-, 4 months ago

Description: modified (diff)
Summary: COMMON: Rewrote of encoder causes assertion when using ALT+x in LA titles (AmigaOS4)COMMON: Rewrote of encoder causes assertion on typing ALT+? key combos (AmigaOS4)

Nevermind the games i tested.
I can make it crash as basic as the launcher.
When launcher is up, i just type a key combo (ALT+x and ALT+w confirmed) to make ScummVM assert.

It seems as if the new encoder is trying to do something that brings down my system.
Not sure if those key combos are part of a language
Alt+x is × on my system.
Alt+w is å on my system.

Help?

Version 0, edited 4 months ago by raziel- (next)

comment:5 by sev-, 4 months ago

Summary: COMMON: Rewrote of encoder causes assertion on typing ALT+? key combos (AmigaOS4)BACKENDS: AMIGAOS: Rewrote of encoder causes assertion on typing ALT+? key combos (AmigaOS4)

comment:6 by raziel-, 3 months ago

Summary: BACKENDS: AMIGAOS: Rewrote of encoder causes assertion on typing ALT+? key combos (AmigaOS4)BACKENDS: AMIGAOS: Rewrote of encoder causes assertion on typing ALT+(WASDXC) key combos (AmigaOS4)

I finally had time to check for all key combos and found that only the ones mentioned in the bug description are asserting.

ALT + W A S D X and C

W is ?
A is ?
S is taking a screenshot
D is ?
X is "quit game" in scumm engine games
C is ?

I suspect every one of those shortcuts have some kind of action bound to it.
Why it is assertion though, is beyond me.

If anyone got any ideas, please help

comment:7 by ccawley2011, 3 months ago

Could you try this patch and see if it works?

diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 292ab95691..7581078992 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -38,7 +38,11 @@
 #define GAMECONTROLLERDB_FILE "gamecontrollerdb.txt"

 static uint32 convUTF8ToUTF32(const char *src) {
+       if (!src || src[0] == 0)
+               return 0;
+
        Common::U32String u32(src);
+       assert(u32.size() > 0);
        return u32[0];
 }

If it does fix the issue, the root issue may be an SDL bug, since an empty string probably shouldn't be returned for SDL_TEXTINPUT events.

comment:8 by raziel-, 3 months ago

@ccawley2011

Oh goody, yes that fixed it, thank you

Since you pointed to gamecontrollerdb.txt with your fix...i don't have this file.
Is it mandatory?
Maybe that's why it's producing an empty string read for me?

I downloaded one and placed it right beside ScummVM's binary, but i still got the assertion (after removing your fix).
So where does this file need to go? extras dir? path?
And if that missing file was the culprit, why isn't there a check or warning if it's missing (inside ScummVM)?

Anyway, thanks a bunch for taking the time to look :-)

in reply to:  8 comment:9 by ccawley2011, 3 months ago

Owner: set to ccawley2011
Resolution: fixed
Status: newclosed

Cool. I've committed a fix for this, and I've also opened an issue for the AmigaOS 4 version of SDL2 so this can hopefully be fixed properly.

Replying to raziel-:

Since you pointed to gamecontrollerdb.txt with your fix...i don't have this file.
Is it mandatory?
Maybe that's why it's producing an empty string read for me?

This isn't actually related, it just happened to be nearby and therefore was included in the diff.

comment:10 by raziel-, 3 months ago

@ccawley2011

You're my new best person, don't you dare to go anywhere, need you for more bugs ;-) :-D

Note: See TracTickets for help on using tickets.