Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06575 Debugger Critical (emulator) Always May 3, 2017, 01:05 May 28, 2017, 08:37
Tester Pasky View Status Public Platform MAME (Official Binary)
Assigned To Bletch Resolution Fixed OS Windows Vista/7/8 (64-bit)
Status [?] Resolved Driver
Version 0.185 Fixed in Version 0.186 Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 06575: DEBUGGER: MAME crashes when given the 'symlist' command in the debugger.
Description MAME crashes when given the 'symlist' command in the debugger. Appears to affect all drivers as I've tested it in PGM and random games.
Steps To Reproduce Run MAME with debugger option.
Execute a 'symlist' command in the debugger window.
Additional Information
Github Commit
Flags
Regression Version 0.184
Affected Sets / Systems DEBUGGER
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
4
User avatar
No.13816
cuavas
Administrator
May 3, 2017, 01:32
Program received signal SIGSEGV, Segmentation fault.
0x0000000104a938a3 in debugger_commands::execute_symlist(int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) ()
(gdb) where
#0 0x0000000104a938a3 in debugger_commands::execute_symlist(int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) ()
#1 0x0000000104a998ba in debugger_console::internal_execute_command(bool, int, char**) ()
#2 0x0000000104a99cac in debugger_console::internal_parse_command(char const*, bool) ()
#3 0x0000000104a9a059 in debugger_console::execute_command(char const*, bool) ()
#4 0x0000000103089df3 in -[MAMEDebugConsole doCommand:] ()
#5 0x00007fff84dfdeda in -[NSApplication sendAction:to:from:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#6 0x00007fff84dfde39 in -[NSControl sendAction:to:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#7 0x00007fff84e2d6ea in -[NSTextField textDidEndEditing:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#8 0x00007fff89cd5ad5 in _nsnote_callback () from /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
#9 0x00007fff8657ffd0 in OBJC_IVAR_$_CAFilter._cache () from /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
#10 0x00007fff8656c548 in OBJC_IVAR_$_CISourceOverCompositing.inputBackgroundImage () from /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
#11 0x00007fff89ccca36 in -[NSNotificationCenter postNotificationName:object:userInfo:] () from /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
#12 0x00007fff84e3e3b5 in -[NSTextView(NSPrivate) _giveUpFirstResponder:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#13 0x00007fff84e83b6c in -[NSTextView(NSKeyBindingCommands) insertNewline:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#14 0x00007fff84e3dc7d in -[NSTextView doCommandBySelector:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#15 0x00007fff84e3246b in -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#16 0x00007fff84e3197c in -[NSTextInputContext handleEvent:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#17 0x00007fff84e31631 in -[NSView interpretKeyEvents:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#18 0x00007fff84e3140a in -[NSTextView keyDown:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#19 0x00007fff84da30c7 in -[NSWindow sendEvent:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#20 0x00007fff84cd7afa in -[NSApplication sendEvent:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#21 0x0000000103087df2 in debugger_osx::wait_for_debugger(device_t&, bool) ()
#22 0x0000000104aa117a in device_debug::instruction_hook(unsigned int) ()
#23 0x0000000103f046c0 in m68000_base_device::cpu_execute() ()
#24 0x0000000104c2b34e in device_scheduler::timeslice() ()

#25 0x0000000104be89d8 in running_machine::run(bool) ()
#26 0x0000000103235ad6 in mame_machine_manager::execute() ()
#27 0x000000010311faff in cli_frontend::start_execution(mame_machine_manager*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) ()
#28 0x0000000103120850 in cli_frontend::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) ()
#29 0x0000000103236361 in emulator_info::start_frontend(emu_options&, osd_interface&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) ()
#30 0x000000010310ce39 in main ()

(gdb) disassemble
Dump of assembler code for function _ZN17debugger_commands15execute_symlistEiRKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
   0x0000000104a93870 <+0>: push %rbp
   0x0000000104a93871 <+1>: mov %rsp,%rbp
   0x0000000104a93874 <+4>: push %r15
   0x0000000104a93876 <+6>: push %r14
   0x0000000104a93878 <+8>: push %r13
   0x0000000104a9387a <+10>: push %r12
   0x0000000104a9387c <+12>: push %rbx
   0x0000000104a9387d <+13>: sub $0x2008,%rsp
   0x0000000104a93884 <+20>: mov %rdi,%r12
   0x0000000104a93887 <+23>: mov 0x308dae2(%rip),%rax # 0x107b21370
   0x0000000104a9388e <+30>: mov (%rax),%rax
   0x0000000104a93891 <+33>: mov %rax,-0x30(%rbp)
   0x0000000104a93895 <+37>: movq $0x0,-0x1f80(%rbp)
   0x0000000104a938a0 <+48>: mov (%rdx),%rsi
=> 0x0000000104a938a3 <+51>: movzbl (%rsi),%ecx
   0x0000000104a938a6 <+54>: mov %ecx,%eax
   0x0000000104a938a8 <+56>: and $0x1,%al
   0x0000000104a938aa <+58>: jne 0x104a938b1 <_ZN17debugger_commands15execute_symlistEiRKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE+65>
   0x0000000104a938ac <+60>: shr %rcx
   0x0000000104a938af <+63>: jmp 0x104a938b5 <_ZN17debugger_commands15execute_symlistEiRKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE+69>
   0x0000000104a938b1 <+65>: mov 0x8(%rsi),%rcx
   0x0000000104a938b5 <+69>: test %rcx,%rcx
   0x0000000104a938b8 <+72>: je 0x104a938c3 <_ZN17debugger_commands15execute_symlistEiRKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE+83>
   0x0000000104a938ba <+74>: test %al,%al
   0x0000000104a938bc <+76>: jne 0x104a93933 <_ZN17debugger_commands15execute_symlistEiRKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE+195>
User avatar
No.13817
cuavas
Administrator
May 3, 2017, 01:42
OK, what's crashing is this line near the beginning of debugger_commands::execute_symlist

   if (!params[0].empty())

This is caused by careless refactoring. Change the line to

   if (!params.empty())

and it should work.
User avatar
No.13818
Bletch
Developer
May 3, 2017, 13:07
https://github.com/mamedev/mame/pull/2272
User avatar
No.13819
Robbbert
Senior Tester
May 3, 2017, 14:40
Patch applied. Symlist command now shows "Global Symbols".