I had a look at MACH3 today, but I understand that the problem is common to other laserdisc games.
There's an allocation using "coretmpl.h" included by "lib\util\chd.c" (it's the fourth call to expand_internal()), but it's using malloc() instead of the tracked allocation. This might be the actual bug. This block is later attempted to be freed by "coretmpl.h" (same file, different instance) included by "emu\machine\laserdsc.c" (there's only one such free attempt). Or maybe the bug is here. It is expecting the block to be tracked, and fails because it's not.
For some reason, I see the issue only in MinGW builds, and only with optimisation level=3 (I'm using a 32-bit build). If I disable optimisations, the problem goes away. If I use VisualC to enable source-level debugging to see the exact place of the problem, then the coretmpl.h is apparently unused. So I can't progress further with it, but maybe someone else can now.
|