Opened 3 months ago

Closed 8 weeks ago

Last modified 8 weeks ago

#16610 closed defect (fixed)

COMMON: Leak of memory allocated in gzio.cpp

Reported by: tunnelsociety Owned by: lephilousophe
Priority: normal Component: Common
Version: Keywords:
Cc: Game:

Description

Run ScummVM configured with --disable-zlib and load a save game (probably any engine; I tested PhoenixVR and Nancy) which is compressed.

Attaching ASan reports for sample Nancy and PhoenixVR cases.

Head of every leaked alloc bt is:

#0 in calloc (scummvm+0xee2cdd) (BuildId: 9363591178c51873f07dcaf031d3ee64dc39193c)
#1 in Common::huft_build(unsigned int*, unsigned int, unsigned int, unsigned short const*, unsigned short const*, Common::huft**, int*) common/compression/gzio.cpp:481:28
#2 in Common::GzioReadStream::init_dynamic_block() common/compression/gzio.cpp:927:7
#3 in Common::GzioReadStream::inflate_window() common/compression/gzio.cpp:1044:4
#4 in Common::GzioReadStream::readAtOffset(long, unsigned char*, unsigned int) common/compression/gzio.cpp:1261:4
#5 in Common::GzioReadStream::read(void*, unsigned int) common/compression/gzio.cpp:1289:21

For now I will reconfigure with --enable-zlib and carry on! Ah, incidentally, loading nancy3 is significantly faster now, even though I was building --disable-zlib with -O3.

Attachments (2)

asan-lochness.txt (28.2 KB ) - added by tunnelsociety 3 months ago.
asan-nancy3.txt (7.0 KB ) - added by tunnelsociety 3 months ago.

Download all attachments as: .zip

Change History (4)

by tunnelsociety, 3 months ago

Attachment: asan-lochness.txt added

by tunnelsociety, 3 months ago

Attachment: asan-nancy3.txt added

comment:1 by Le Philousophe <lephilousophe@…>, 8 weeks ago

Owner: set to Le Philousophe <lephilousophe@…>
Resolution: fixed
Status: newclosed

In b94b31d6:

COMMON: Free huffmann tables when deleting the stream

Fix #16610

comment:2 by lephilousophe, 8 weeks ago

Owner: changed from Le Philousophe <lephilousophe@…> to lephilousophe

Yes, GZio is really slow and should not be used when possible.
Please proceed with zlib.
But thanks for testing this code path though.

Note: See TracTickets for help on using tickets.