[Scummvm-tracker] [ScummVM] #6820: Crash to console collecting last stones under church
Colin Snover
trac at scummvm.org
Sat Nov 11 23:45:06 CET 2017
#6820: Crash to console collecting last stones under church
-------------------------------+------------------------------
Reporter: SF/r-alf-the-alf | Owner: csnover
Type: defect | Status: new
Priority: blocker | Component: Engine: Dreamweb
Resolution: | Keywords: has-save-game
Game: Dreamweb |
-------------------------------+------------------------------
Comment (by csnover):
> Later in the game, the green one found in Louis' flat got its inventory
graphics damaged.
Hm, this sounds like #6196 again…
----
After a bit more investigating, there are actually many free slots for ex
objects available, but not enough free memory left in the memory block
used for frame data.
The code currently hard-codes the amount of needed extra memory in the
frame data and text buffers when transferring an object to Ex memory, but
this is way more memory than is actually needed here (it requires 4000
bytes free, but the new items only need a couple hundred bytes). So I have
a patch to make this calculation accurate, which gets us past this
particular OOM crash, though may not truly solve the overall problem of
the game getting into a state where it cannot clear enough memory from the
frame buffer to avoid running out and crashing.
A second issue is that I can’t account for all of the memory used in the
frame buffer. When I calculate the expected size from the active Ex
objects in the save game, I come up with 25937 bytes, but the free pointer
is at 26342, so either I am misunderstanding something (very probable, I
am not familiar with this engine) or 405 bytes have leaked out somewhere,
which would be a problem if so since that’s 1.3% of the available memory
for ex object frames! The only way I can see that this would happen would
be if something is turning a kExObjectType DynObject into a different type
of DynObject without going through `deleteExObject` to clear away the Ex
frames data. I can also see that it is possible for DynObjects may get
stuck and retain memory forever if they aren’t reset to values that allow
`purgeAnItem` to purge them.
I guess the second issue doesn’t need to really be addressed right now, or
maybe even ever since I don’t know that there is any technical reason that
we really need to keep the entire game’s memory limited to 64k.
--
Ticket URL: <https://bugs.scummvm.org/ticket/6820#comment:7>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list