[mapserver-dev] Crash on Windows: fontcache.c

Even Rouault even.rouault at spatialys.com
Sun Oct 19 12:30:41 PDT 2014


Le dimanche 19 octobre 2014 21:14:33, Jeff McKenna a écrit :
> Hi devs,
> 
> With git/master on Windows, I trigger a crash of
> mapserv.exe/mapserver.dll any time I call mapserv.exe in CGI mode.  (no
> issue with MapServer 6.4.1)
> 
> - The good news is that I can reproduce this at the commandline with
> 'mapserv -nh'.
> 
>    C:\ms4w> mapserv -nh
> 
>      This script can only be used to decode form results and
>      should be initiated as a CGI process via a httpd server.
>      For other options please try using the --help switch.
> 
>      (then a crash occurs, with this info below)
> 
>        ***
>        Problem signature:
>          Problem Event Name:	APPCRASH
>          Application Name:	mapserv.exe
>          Application Version:	0.0.0.0
>          Application Timestamp:	54440643
>          Fault Module Name:	mapserver.dll
>          Fault Module Version:	0.0.0.0
>          Fault Module Timestamp:	54440640
>          Exception Code:	c0000005
>          Exception Offset:	00274c8b
>          OS Version:	6.0.6002.2.2.0.768.2
>       ***
> 
> - I compiled mapserv in Debug mode (Visual Studio 2008)
> 
> - in the Visual Studio 2008 debugger this message appears:
> 
>           message: Unhandled exception at 0x10274c8b (mapserver.dll) in
>           mapserv.exe:
>           0xC0000005: Access violation reading location 0xdddddddd.
> 
> - the debugger stops at:
> 
>           fontcache.c
> 
>                line 92: FT_Done_FreeType(c->library);
> 
> - the call stack at that point is:
> 
>          ***
>          mapserver.dll!_FT_Done_Library()  + 0x7b bytes
>   	mapserver.dll!_FT_Done_FreeType()  + 0x11 bytes
> 	mapserver.dll!msFreeFontCache(ft_cache * c=0x104bf560)  Line 92 + 0xb
> bytes
>   	mapserver.dll!msFontCacheCleanup()  Line 164 + 0x9 bytes
>   	mapserver.dll!msCleanup(int signal=1)  Line 1967
>   	mapserv.exe!msCleanupOnExit()  Line 74 + 0x7 bytes
>   	msvcr90d.dll!doexit(int code=0, int quick=0, int retcaller=0)  Line
> 591	C msvcr90d.dll!exit(int code=0)  Line 412 + 0xd bytes
>   	mapserv.exe!main(int argc=2, char * * argv=0x0453da10)  Line 315 +
> 0xa bytes
>   	mapserv.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes
>   	mapserv.exe!mainCRTStartup()  Line 403
>   	kernel32.dll!75f3d3c9()
>   	[Frames below may be incorrect and/or missing, no symbols loaded
> for kernel32.dll]
>   	ntdll.dll!77871603()
>   	ntdll.dll!778715d6()
>   	libeay32.dll!cms_SignedData_init_bio(CMS_ContentInfo_st * cms=)  Line
> 817 + 0xe bytes
>          ***
> 
> I'm wondering if anyone has any ideas of what I can try, or if you need
> more information.  I am pretty stuck.  Thanks everyone,

Jeff,

Not tested, but by code review, I believe the issue is that msCleanup() must 
be called twice on Windows.

Once by msCleanup(0) at line 308 of mapserv.c

And twiche by the code at line 237 of mapserv.c

#ifdef WIN32
  atexit( msCleanupOnExit );
#endif

I'd recommand you trying to remove those 3 lines. I can't see any reason for a 
win32 specific code path.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the mapserver-dev mailing list