[Scummvm-devel] Broken Sword 2.5 engine

Julien scummvm at templier.info
Wed Oct 13 05:55:59 CEST 2010


Hi everyone!

For people using Visual Studio, the patch set here ( http://sourceforge.net/tracker/?func=detail&atid=418822&aid=2946946&group_id=37116 ) has been updated with support for the sword25 engine.
If you're using mercurial, you can find my patch queue here: http://bitbucket.org/Littleboy/scummvm-jt (it has patches for adding the lastexpress and liath engines too, so be sure to pick only the TOOLS patches).

I will try to provide a patch for create_msvc sometime tomorrow, but I was under the impression that the create_project patch set could be merged relatively soon. 
In the meantime, if somebody with commit access wants to have fun with it, the pieces to change are visible in this changeset: http://bitbucket.org/Littleboy/scummvm-jt/changeset/f8d24f9520d4

Julien

> -----Original Message-----
> From: Sven Hesse [mailto:drmccoy at users.sourceforge.net]
> Sent: Tuesday, October 12, 2010 10:24 PM
> To: ScummVM devel
> Subject: Re: [Scummvm-devel] Broken Sword 2.5 engine
> 
> 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





More information about the Scummvm-devel mailing list