Ticket #1854 (closed defect: fixed)
|Reported by:||brage@…||Owned by:||jmckenna@…|
I have been experiencing the exact same bug as described in bug #1269, with mapscript terminating in saveimage() while writing to sdout. The httpd process give the warning "httpd in free(): error: modified (page-) pointer" and exits. After some debugging, i found that the problematic call is the call to gdFree() in saveImage(). My setup has php loading both gd.so and php_mapscript.so at startup in php/extensions.ini. The problem seems to be a mismatch of gd versions. The php gd module compiles its own version of libgd, and if the gd library is loaded before the mapscript library, mapscript will use the php-spesific version. This should not be a problem, except that the php version of gd.so doesn't export gdFree(). In the php version of libgd, gdFree() is defined as a macro to efree(). The gdFree() called by mapscript then belongs to the gd linked to mapscript and the alloc-code used by msSaveImageBufferGD() and gdFree() does not match. A workaround is to load the php_mapscript module before the gd module.
Note: See TracTickets for help on using tickets.