loading symbols on the fly causes unhandled exception

Tamas Szekeres szekeres.tamas at FREEMAIL.HU
Mon Oct 31 19:02:06 EST 2005


Frank,

Thanks for the suggestions!
The easiest way to fix this problem is to replace gdImageCreateFromXXX to
the corresponding gdImageCreateFromXXXCtx in the mapserver code. I have
posted a bug as a reminder for it to

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1513

I have compiled mapserver and the related libraries using Visual Studio 7
and I don't think it is a good idea to back out to VS6 as to eliminate the
need to recompile the GD library. However to create a working nmake
makefile for MSVC seems to be a great adventure so I would be pleased if
anyone had a suitable solution and shared it with me.


Tamas Szekeres



On Sun, 30 Oct 2005 23:19:46 -0500, Frank Warmerdam <warmerdam at POBOX.COM>
wrote:

>On 10/30/05, Tamas Szekeres <szekeres.tamas at freemail.hu> wrote:
>> Hi list,
>>
>> When placing the file name of the image symbol (gif or png) into the map
>> file instead of the symbol definition file an unhandled exception occurs
>> in mapsymbol.c, line 517
>...
>>   bgd.dll!gdImageCreateFromPng at 4()  + 0x27
>> > libmap.dll!msAddImageSymbol(symbolSetObj * symbolset=0x00cfa188,
>> char * filename=0x003ffc18)  Line 517 + 0xd C
>...
>> Could anyone help me to fix this issue?
>
>Tamas,
>
>msAddImageSymbol() calls fopen() and then passes that
>file handle to gdImageCreateFromPng().  The gd function is
>in a different DLL and if either bgd.dll or libmap.lib are built
>with the default C library on windows, it will be unable to utilize
>the file descriptor opened in mapsymbol.c.
>
>Normally I avoid this by ensuring I build with the C runtime library
>which can be accomplished by using /MD.  You also have to
>ensure that bgd.dll is built with a compatible runtime library.
>I think the normal bgd.dll is built with VC6 so you would need to
>use VC6 for mapserver as well.
>
>I actually thought we had restructured mapserver to avoid passing
>file handles to the GD png (and gif, and jpeg) functions to avoid
>this issue, but apparently it exists in at least this function.  I would
>encourage you to file a bug report on it, and someone can fix it.
>In case that someone might end up being me, please include
>a minimal map file that will demonstrate the problem as I don't
>imagine I normally go through this function.
>
>Best regards,
>--
>---------------------------------------+----------------------------------
----
>I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list