[Scummvm-devel] Broken Sword 2.5 engine

Sven Hesse drmccoy at users.sourceforge.net
Wed Oct 13 04:23:43 CEST 2010


Hej hej!

A few more things:

1.
On my system at least, the code that's currently in the trunk fails to
compile with an error:
| ./engines/sword25/kernel/bs_stdint.h:50: error: conflicting declaration ‘typedef long long int int64_t’
| /usr/include/sys/types.h:198: error: ‘int64_t’ has a previous declaration as ‘typedef long int int64_t’

Removing the that line fixes it for me, but the proper way would
probably be extending the configure script to also search for a 4 byte
type (and disabling sword25 if none found) + and appropriate #ifdef'd
typedef in scummsys.h.

2.
| engines/sword25/kernel/outputpersistenceblock.cpp:111: error: call of overloaded ‘write(size_t&)’ is ambiguous
Casting the size_t to an int fixes it, but I wasn't sure whether sev
was actually finished commiting or if git-svn just stopped (he's not
answering ATM, so I guess he went to sleep) 

3.
There's some more memory corruption going on normal play:
==16488== Invalid write of size 8
==16488==    at 0x5BBA5A4: png_get_IHDR (in /lib/libpng12.so.0.44.0)
==16488==    by 0xD575F0: Sword25::PNGLoader::DoImageProperties(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS&, int&, int&) (pngloader.cpp:245)
==16488==    by 0xD576A1: Sword25::PNGLoader::ImageProperties(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS&, int&, int&) (pngloader.cpp:263)
==16488==    by 0xD5682E: Sword25::ImageLoader::ExtractImageProperties(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS&, int&, int&) (imageloader.cpp:86)
==16488==    by 0xD2EEDE: Sword25::SWImage::SWImage(Common::String const&, bool&) (swimage.cpp:72)
==16488==    by 0xD1E591: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==  Address 0x11a27514 is 20 bytes inside a block of size 24 alloc'd
==16488==    at 0x4C24DFA: operator new(unsigned long) (vg_replace_malloc.c:261)
==16488==    by 0xD1E570: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFE3B3: luaD_rawrunprotected (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF6B3: lua_resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B69A: auxresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B77F: luaB_coresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)

==16488== Invalid write of size 8
==16488==    at 0x5BBA5A4: png_get_IHDR (in /lib/libpng12.so.0.44.0)
==16488==    by 0xD570A6: Sword25::PNGLoader::DoDecodeImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS, unsigned char*&, int&, int&, int&) (pngloader.cpp:106)
==16488==    by 0xD574CF: Sword25::PNGLoader::DecodeImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS, unsigned char*&, int&, int&, int&) (pngloader.cpp:213)
==16488==    by 0xD567A1: Sword25::ImageLoader::LoadImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLOR_FORMATS, unsigned char*&, int&, int&, int&) (imageloader.cpp:65)
==16488==    by 0xD2EF48: Sword25::SWImage::SWImage(Common::String const&, bool&) (swimage.cpp:79)
==16488==    by 0xD1E591: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==  Address 0x11a27514 is 20 bytes inside a block of size 24 alloc'd
==16488==    at 0x4C24DFA: operator new(unsigned long) (vg_replace_malloc.c:261)
==16488==    by 0xD1E570: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFE3B3: luaD_rawrunprotected (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF6B3: lua_resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B69A: auxresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B77F: luaB_coresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)

==16488== Invalid write of size 8
==16488==    at 0x5BBA5A4: png_get_IHDR (in /lib/libpng12.so.0.44.0)
==16488==    by 0xD57201: Sword25::PNGLoader::DoDecodeImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::CLOR_FORMATS, unsigned char*&, int&, int&, int&) (pngloader.cpp:138)
==16488==    by 0xD574CF: Sword25::PNGLoader::DecodeImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLR_FORMATS, unsigned char*&, int&, int&, int&) (pngloader.cpp:213)
==16488==    by 0xD567A1: Sword25::ImageLoader::LoadImage(unsigned char const*, unsigned int, Sword25::GraphicEngine::COLR_FORMATS, unsigned char*&, int&, int&, int&) (imageloader.cpp:65)
==16488==    by 0xD2EF48: Sword25::SWImage::SWImage(Common::String const&, bool&) (swimage.cpp:79)
==16488==    by 0xD1E591: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==  Address 0x11a27514 is 20 bytes inside a block of size 24 alloc'd
==16488==    at 0x4C24DFA: operator new(unsigned long) (vg_replace_malloc.c:261)
==16488==    by 0xD1E570: Sword25::GraphicEngine::loadResource(Common::String const&) (graphicengine.cpp:266)
==16488==    by 0xCE56BA: Sword25::ResourceManager::loadResource(Common::String const&) (resmanager.cpp:233)
==16488==    by 0xCE5563: Sword25::ResourceManager::PrecacheResource(Common::String const&, bool) (resmanager.cpp:197)
==16488==    by 0xCE1607: Sword25::PrecacheResource(Lua::lua_State*) (kernel_script.cpp:527)
==16488==    by 0xCFF160: luaD_precall (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD14176: luaV_execute (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF53A: resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFE3B3: luaD_rawrunprotected (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xCFF6B3: lua_resume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B69A: auxresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)
==16488==    by 0xD3B77F: luaB_coresume (in /home/drmccoy/projects/scummvm/scummvm/scummvm)

Probably related to that (valgrind doesn't show any separate issues),
the game then crashly badly while quitting, with glibc detecting an
invalid pointer on free().

4.
Just starting the game, going through the intro and then quitting
makes valgrind show at least 7.7MB in leaked memory.


Cheers
	Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20101013/fa118402/attachment.sig>


More information about the Scummvm-devel mailing list