loading symbols on the fly causes unhandled exception

Frank Warmerdam warmerdam at POBOX.COM
Sun Oct 30 23:19:46 EST 2005


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