[mapserver-users] Mapserv problems on Fedora

Frank Warmerdam warmerdam at pobox.com
Mon Apr 14 13:18:27 PDT 2008


Stephen Woodbridge wrote:
> ==32351== Invalid write of size 1
> ==32351==    at 0x32FAA03144: rx_bzero (in /usr/lib64/librx.so.0.0.0)
> ==32351==    by 0x32FAA08786: regncomp (in /usr/lib64/librx.so.0.0.0)
> ==32351==    by 0x421BF2: msEvalRegex (mapfile.c:84)
> ==32351==    by 0x42500E: msLoadMap (mapfile.c:4529)
> ==32351==    by 0x40BD6B: loadMap (mapserv.c:201)
> ==32351==    by 0x40D8FD: main (mapserv.c:1132)
> ==32351==  Address 0x57A8820 is 0 bytes after a block of size 64 alloc'd
> ==32351==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
> ==32351==    by 0x4A9E44: ms_regcomp (mapregex.c:58)
> ==32351==    by 0x421BF2: msEvalRegex (mapfile.c:84)
> ==32351==    by 0x42500E: msLoadMap (mapfile.c:4529)
> ==32351==    by 0x40BD6B: loadMap (mapserv.c:201)
> ==32351==    by 0x40D8FD: main (mapserv.c:1132)

Steve,

Ugly! I don't know why it would be needed, but you could try changing this:

   regex_t* sys_regex = (regex_t*) malloc(sizeof(regex_t));

to:

   regex_t* sys_regex = (regex_t*) malloc(sizeof(regex_t)+1000);

in mapregex.c.

I suspect there is a mixup between the regex include files being
used and the library being used or possibly structures aren't being
sized properly due to some sort of type size issue.

Interestingly in my mapfile.c from the 5.0 branch line 84 of
mapfile.c is:

   if(ms_regcomp(&re, e, MS_REG_EXTENDED|MS_REG_NOSUB) != 0) {

rather than calling regncomp() directly.  Perhaps there has been
a fix since 5.0.2?

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    | President OSGeo, http://osgeo.org




More information about the MapServer-users mailing list