Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08139 Core Major Always Nov 23, 2021, 21:53 Nov 26, 2021, 12:02
Tester hap View Status Public Platform MAME (Official Binary)
Assigned To galibert Resolution Fixed OS Windows 10/11 (64-bit)
Status [?] Resolved Driver
Version 0.237 Fixed in Version 0.239 Build 64-bit
Fixed in Git Commit a7e18d4 Github Pull Request #
Summary 08139: emumem: Memory leak after MAME hard reset
Description There's a big memory leak after doing a hard reset (Shift F3)
Steps To Reproduce - open Windows taskmanager to have a look at MAME's memory usage
- start a machine that allocates a lot of memory, for example:
mame.exe sun4_110 -window -ui_active

- look at memory usage and see it increase after each time you press Shift+F3
- eventually (after multiple GB total allocated), may get a crash:
Caught unhandled St9bad_alloc exception: std::bad_alloc

The crash is more likely to happen with a 32bit build.

Note, which machine/game you start, does not matter.
mame.exe pacman also leaks memory (much less since it doesn't allocate a lot), do Shift+F3 20 times and memory usage has doubled in pacman's case

The memory leak also happens if you restart the machine from MAME's internal UI, so:
mame.exe -> select sun4_110 -> exit back to UI -> select sun4_110 -> exit back to UI -> ...
Additional Information
Github Commit
Flags
Regression Version 0.200
Affected Sets / Systems emumem
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
5
User avatar
No.19475
Tafoid
Administrator
Nov 24, 2021, 00:58
In my testing, regression points to the day of the great memory rewrite (emumem) from June 29, 2018:
https://github.com/mamedev/mame/commit/a704ed7b1b121c3bcff52d49bff8372360fe907c
User avatar
No.19476
cuavas
Administrator
Nov 24, 2021, 03:33
Does the leak happen with all machines, or only machines using specific features? Is something holding on to the memory, or is it losing hold of the memory entirely? I‘ve checked running simple systems with valgrind and they’ve come up clean.
User avatar
No.19478
cuavas
Administrator
Nov 24, 2021, 07:50
Suspicious-looking valgrind output from hard-resetting intlc440 a couple of times:

==2197== 48 bytes in 2 blocks are possibly lost in loss record 2,026 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x771163C: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 80 bytes in 2 blocks are possibly lost in loss record 2,630 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x77143A0: address_space_specific<0, 0, 0, (util::endianness)0>::install_ram_generic(unsigned int, unsigned int, unsigned int, read_or_write, void*) (in mamed)
==2197==    by 0x76B317F: address_space::populate_from_map(address_map*) (in mamed)
==2197==    by 0x769E3EF: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 144 bytes in 1 blocks are possibly lost in loss record 3,016 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7723B89: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_helper<0, emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()> const&) (in mamed)
==2197==    by 0x7723901: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_impl<emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()>&) (in mamed)
==2197==    by 0x7713FF6: address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, emu::device_delegate<unsigned char ()>, unsigned long, int) (in mamed)
==2197==    by 0x56E12B5: (anonymous namespace)::imm4_90_device::device_start() (in mamed)
==2197==    by 0x762F916: device_t::start() (in mamed)
==2197==    by 0x89B1331: running_machine::start_all_devices() (in mamed)
==2197==    by 0x89B0589: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)

==2197== 144 bytes in 1 blocks are possibly lost in loss record 3,017 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7723B89: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_helper<0, emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()> const&) (in mamed)
==2197==    by 0x7723901: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_impl<emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()>&) (in mamed)
==2197==    by 0x7713FF6: address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, emu::device_delegate<unsigned char ()>, unsigned long, int) (in mamed)
==2197==    by 0x56E13BB: (anonymous namespace)::imm4_90_device::device_start() (in mamed)
==2197==    by 0x762F916: device_t::start() (in mamed)
==2197==    by 0x89B1331: running_machine::start_all_devices() (in mamed)
==2197==    by 0x89B0589: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)

==2197== 144 bytes in 1 blocks are possibly lost in loss record 3,018 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7723B89: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_helper<0, emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()> const&) (in mamed)
==2197==    by 0x7723901: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_impl<emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()>&) (in mamed)
==2197==    by 0x7713FF6: address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, emu::device_delegate<unsigned char ()>, unsigned long, int) (in mamed)
==2197==    by 0x56E14C1: (anonymous namespace)::imm4_90_device::device_start() (in mamed)
==2197==    by 0x762F916: device_t::start() (in mamed)
==2197==    by 0x89B1331: running_machine::start_all_devices() (in mamed)
==2197==    by 0x89B0589: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)

==2197== 720 bytes in 5 blocks are possibly lost in loss record 3,894 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7723B89: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_helper<0, emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()> const&) (in mamed)
==2197==    by 0x7723901: void address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler_impl<emu::device_delegate<unsigned char ()> >(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, int, emu::device_delegate<unsigned char ()>&) (in mamed)
==2197==    by 0x7713FF6: address_space_specific<0, 0, 0, (util::endianness)0>::install_read_handler(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, emu::device_delegate<unsigned char ()>, unsigned long, int) (in mamed)
==2197==    by 0x76A3A00: address_space_installer::populate_map_entry(address_map_entry const&, read_or_write) (in mamed)
==2197==    by 0x76B317F: address_space::populate_from_map(address_map*) (in mamed)
==2197==    by 0x769E3EF: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)

==2197== 1,944 (336 direct, 1,608 indirect) bytes in 3 blocks are definitely lost in loss record 4,110 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x771186E: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 2,808 (336 direct, 2,472 indirect) bytes in 3 blocks are definitely lost in loss record 4,212 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711895: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 25,104 (336 direct, 24,768 indirect) bytes in 3 blocks are definitely lost in loss record 4,495 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711BA7: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 25,104 (336 direct, 24,768 indirect) bytes in 3 blocks are definitely lost in loss record 4,496 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711BCE: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 49,992 (336 direct, 49,656 indirect) bytes in 3 blocks are definitely lost in loss record 4,515 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x77118B9: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 49,992 (336 direct, 49,656 indirect) bytes in 3 blocks are definitely lost in loss record 4,516 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x77118E0: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 98,832 (336 direct, 98,496 indirect) bytes in 3 blocks are definitely lost in loss record 4,536 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711BF2: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 98,832 (336 direct, 98,496 indirect) bytes in 3 blocks are definitely lost in loss record 4,537 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711C19: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 197,448 (336 direct, 197,112 indirect) bytes in 3 blocks are definitely lost in loss record 4,563 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711904: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 197,448 (336 direct, 197,112 indirect) bytes in 3 blocks are definitely lost in loss record 4,564 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x771192B: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 262,144 bytes in 2 blocks are possibly lost in loss record 4,574 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7E56625: std::__1::vector<handler_entry_read_dispatch<14, 0, 0>::handler_array, std::__1::allocator<handler_entry_read_dispatch<14, 0, 0>::handler_array> >::__append(unsigned long) (in mamed)
==2197==    by 0x7D6F318: handler_entry_read_dispatch<14, 0, 0>::handler_entry_read_dispatch(address_space*, handler_entry::range const&, handler_entry_read<0, 0>*) (in mamed)
==2197==    by 0x7711C52: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)

==2197== 264,400 (312 direct, 264,088 indirect) bytes in 1 blocks are definitely lost in loss record 4,575 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x4E41C08: std::__1::shared_ptr<sdl_window_info> std::__1::shared_ptr<sdl_window_info>::make_shared<running_machine&, int&, std::__1::shared_ptr<osd_monitor_info>, osd_window_config*>(running_machine&, int&, std::__1::shared_ptr<osd_monitor_info>&&, osd_window_config*&&) (in mamed)
==2197==    by 0x4E40271: sdl_osd_interface::video_init() (in mamed)
==2197==    by 0x4E47C34: osd_common_t::init_subsystems() (in mamed)
==2197==    by 0x4E3F89C: sdl_osd_interface::init(running_machine&) (in mamed)
==2197==    by 0x89AFEBD: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 264,400 (120 direct, 264,280 indirect) bytes in 1 blocks are definitely lost in loss record 4,576 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x4E4C9D6: osd_renderer::make_for_type(int, std::__1::shared_ptr<osd_window>, int) (in mamed)
==2197==    by 0x4E4345A: sdl_window_info::window_init() (in mamed)
==2197==    by 0x4E402A9: sdl_osd_interface::video_init() (in mamed)
==2197==    by 0x4E47C34: osd_common_t::init_subsystems() (in mamed)
==2197==    by 0x4E3F89C: sdl_osd_interface::init(running_machine&) (in mamed)
==2197==    by 0x89AFEBD: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)

==2197== 394,056 (336 direct, 393,720 indirect) bytes in 3 blocks are definitely lost in loss record 4,577 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x771194F: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 394,056 (336 direct, 393,720 indirect) bytes in 3 blocks are definitely lost in loss record 4,578 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711976: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 1,313,952 (672 direct, 1,313,280 indirect) bytes in 6 blocks are definitely lost in loss record 4,588 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711C3D: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

==2197== 1,576,704 (672 direct, 1,576,032 indirect) bytes in 6 blocks are definitely lost in loss record 4,589 of 4,600
==2197==    at 0x117DC4B6: operator new(unsigned long) (vg_replace_malloc.c:344)
==2197==    by 0x7711C64: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (in mamed)
==2197==    by 0x76B3ACB: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (in mamed)
==2197==    by 0x76B2227: memory_manager::allocate(device_memory_interface&) (in mamed)
==2197==    by 0x769E2F5: memory_manager::initialize() (in mamed)
==2197==    by 0x89B0192: running_machine::start() (in mamed)
==2197==    by 0x89B181D: running_machine::run(bool) (in mamed)
==2197==    by 0x4F0AA33: mame_machine_manager::execute() (in mamed)
==2197==    by 0x4F98088: 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> > > > const&) (in mamed)
==2197==    by 0x4F99B5E: 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> > > >&) (in mamed)
==2197==    by 0x4F0B60B: 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> > > >&) (in mamed)
==2197==    by 0x4E3DFCF: main (in mamed)

Looks like handlers aren’t being cleaned up properly.
User avatar
No.19495
galibert
Developer
Nov 26, 2021, 08:54
edited on: Nov 26, 2021, 08:54
If you go OPTIMIZE=0 SYMBOLS=1 SYMLEVEL=3 you have the pleasure of getting entries like:
==417344== 8,368 (112 direct, 8,256 indirect) bytes in 1 blocks are definitely lost in loss record 2,492 of 2,529
==417344==    at 0x5755F3F: operator new(unsigned long) (vg_replace_malloc.c:417)
==417344==    by 0x2C40785: address_space_specific<0, 0, 0, (util::endianness)0>::address_space_specific(memory_manager&, device_memory_interface&, int, int) (emumem_aspace.cpp:319)
==417344==    by 0x2C3FD37: std::_MakeUniq<address_space_specific<0, 0, 0, (util::endianness)0> >::__single_object std::make_unique<address_space_specific<0, 0, 0, (util::endianness)0>, memory_manager&, device_memory_interface&, int&, int>(memory_manager&, device_memory_interface&, 
int&, int&&) (unique_ptr.h:962)
==417344==    by 0x2BDE5C9: void device_memory_interface::allocate<address_space_specific<0, 0, 0, (util::endianness)0> >(memory_manager&, int) (dimemory.h:100)
==417344==    by 0x2BDC6FC: memory_manager::allocate(device_memory_interface&) (emumem_aspace.cpp:672)
==417344==    by 0x2BAC977: memory_manager::initialize() (emumem.cpp:288)
==417344==    by 0x47202F3: running_machine::start() (machine.cpp:235)
==417344==    by 0x47219BA: running_machine::run(bool) (machine.cpp:333)
==417344==    by 0x197CF3B: mame_machine_manager::execute() (mame.cpp:269)
==417344==    by 0x2554B4D: cli_frontend::start_execution(mame_machine_manager*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) (c
lifront.cpp:272)
==417344==    by 0x2555C17: cli_frontend::execute(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) (clifront.cpp:288)
==417344==    by 0x197DD32: emulator_info::start_frontend(emu_options&, osd_interface&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) (
mame.cpp:400)

So yeah, that's std::make_unique allocated memory, that's not supposed to be leakable unless the object with the unique_ptr objects is itself leaked. But I don't find it in the leak log, so I'm a little at a loss there. printf debugging, here we come...
User avatar
No.19498
galibert
Developer
Nov 26, 2021, 11:55
Am dumb, fixed a7e18d43556f6adb79effd214e67840ea0aee366