Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
02763 Crash/Freeze Critical (emulator) Always Dec 23, 2008, 21:56 Dec 24, 2008, 23:41
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Phil Bennett Resolution Fixed OS Windows XP/Vista 64-bit
Status [?] Resolved Driver
Version 0.128u7 Fixed in Version 0.129 Build Debug
Fixed in Git Commit Github Pull Request #
Summary 02763: some leland.c sets: Access Violation
Description Affects (too much for the "Affected Sets" field):
alleymas
basebal2
cerberus
dangerz
dblplay
mayhem
powrplay
strkzone
upyoural
wseries

-----------------------------------------------------
Exception at EIP=004B16D9 (machine_reset_leland+0x0281): ACCESS VIOLATION
While attempting to read memory at 00000024
-----------------------------------------------------
EAX=00000000 EBX=08151F08 ECX=00000003 EDX=110A1FFC
ESI=00000000 EDI=00000000 EBP=0022FD98 ESP=0022FD88

Program received signal SIGSEGV, Segmentation fault.
0x004a1477 in cpu_get_type (device=0x0) at src/emu/cpuexec.h:303
303             const cpu_config *config = device->inline_config;
(gdb) bt full
#0  0x004a1477 in cpu_get_type (device=0x0) at src/emu/cpuexec.h:303
        config = (const cpu_config *) 0x0
#1  0x004a13db in machine_reset_leland (machine=0xad31efc)
    at src/mame/machine/leland.c:413
        space = (const address_space *) 0x12291750
#2  0x009c92fa in soft_reset (machine=0xad31efc, ptr=0x0, param=0)
    at src/emu/mame.c:1606
        mame = (mame_private *) 0xad41f68
        cb = (callback_item *) 0x0
#3  0x009c762f in mame_execute (options=0x8041e58) at src/emu/mame.c:350
        settingsloaded = 0
        driver = (const game_driver *) 0x148d800
        machine = (running_machine *) 0xad31efc
        mame = (mame_private *) 0xad41f68
        cb = (callback_item *) 0x8041e58
        gamename = (astring *) 0xad31f00
        exit_pending = 0
        error = 0
        firstgame = 0
        firstrun = 0
#4  0x00bdb66c in cli_execute (argc=5, argv=0x7fb1fec, osd_options=0x21ae990)
    at src/emu/clifront.c:171
        options = (core_options *) 0x8041e58
        gamename = (astring *) 0x8021f00
        exename = (astring *) 0x8031f00
        gamename_option = 0x8071f08 "alleymas"
        driver = (const game_driver *) 0x148d800
        result = -1
#5  0x009618b8 in utf8_main (argc=5, argv=0x7fb1fec)
    at src/osd/windows/winmain.c:257
        ext = 0x28e86b8 ".map"
#6  0x0123f599 in main (argc=5, a_argv=0x6452898) at src/osd/windows/main.c:72
        i = 5
        rc = 2293624
        utf8_argv = (char **) 0x7fb1fec
        argv = (TCHAR **) 0x6452908
        wenviron = (WCHAR **) 0x6455110
        startupinfo = -1
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version 0.128u7
Affected Sets / Systems some leland.c sets
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
1
User avatar
No.03389
Atari Ace
Senior Tester
Dec 24, 2008, 22:58
It's not safe to call cpu_get_type with a NULL pointer. This fixes it

diff -Nru zzs1/src/mame/machine/leland.c 1hack/src/mame/machine/leland.c
--- zzs1/src/mame/machine/leland.c	2008-12-18 07:35:40.062500000 -0800
+++ 1hack/src/mame/machine/leland.c	2008-12-24 14:56:53.875000000 -0800
@@ -410,7 +410,7 @@
 		memory_set_bankptr(machine, 3, &slave_base[0x10000]);
 
 	/* if we have an I80186 CPU, reset it */
-	if (cpu_get_type(machine->cpu[2]) == CPU_I80186)
+	if (machine->cpu[2] != NULL && cpu_get_type(machine->cpu[2]) == CPU_I80186)
 		leland_80186_sound_init();
 }