Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
01846 Cheat System Critical (emulator) Always May 29, 2008, 23:03 Jun 5, 2008, 09:56
Tester Tafoid View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Fixed OS Windows 2000
Status [?] Resolved Driver
Version 0.125u3 Fixed in Version 0.125u4 Build Athlon
Fixed in Git Commit Github Pull Request #
Summary 01846: -CHEAT trigger causes MAME crash with PSX-type CPU drivers
Description In all tested games in driver, MAME exits with a message - even if there is no cheat.dat present. The error is similar to:
cheat: [search region] memory allocation error
        ----- 00800000-1EFFFFFF CUSTOM -----
        first                   = 08AF0020
        last                    = 27300020
        status                  = 00000000
        backup_last             = 00000000
        backup_status   = 00000000

Drivers include:

konamigq.c
konamigv.c
ksys573.c
namcos10.c
namcos11.c
namcos12.c
zn.c
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version 0.125u3
Affected Sets / Systems
Attached Files
 
Relationships
has duplicate 01860Resolved  revx: -CHEAT trigger causes MAME crash 
Notes
4
User avatar
No.01140
ShimaPong
Tester
May 30, 2008, 16:14
1st of all, this is deep update (and now in the making) so that many bugs/problems will be included.

Search Region is a buffer of value in searching.
So it's not really relevant to database.

These statuses are UINT8 so cheat system attemps to get memory about "(sizeof(UINT8) * (0x1EFFFFFF - 0x800000)) * 5 [statuses]".
It seems too gigantic...

In old code, if fails to allocate memory for search region, free these statuses WITHOUT any message.
But I doubt why neglects this serious problem so change to fatal error.
As a results, it works negatively though...
I think it's potential bug in old system but it treats in silent so have remained unreported.
Previous system is "ancient" so that it may be out of the scope of the assumption in those days.

I don't know MAME coding allows to ignore memory allocation error.
But cheat system needs to reserve "huge" memory to search in several cases.

Anyway, I tries to lock the region included "gigantic" range before memory allocation and output a message.
(I don't know what memory allocation function is used in this case...)
User avatar
No.01146
aaron
Developer
May 30, 2008, 19:08
You should modify your code to fail nicely in this case (don't fatalerror). Maybe display an error message to the user.
User avatar
No.01156
ShimaPong
Tester
May 31, 2008, 16:03
I lock search region and display message if memory allocation error then continue to allocation other regions.
But I'm afraid of side-effect. Is it no problem?
User avatar
No.01193
aaron
Developer
Jun 5, 2008, 09:56
Fixed by ShimaPong