Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#235 closed defect (invalid)

MapServer crashing against GEOS trunk

Reported by: tomkralidis Owned by: pramsey
Priority: major Milestone: 3.1.0
Component: C API Version: main
Severity: Unassigned Keywords:
Cc: pramsey, cthibert

Description

When running MapServer built against svn trunk, we get:

*** glibc detected *** /home/tkralidi/foss4g/mapserver/trunk/mapserver/mapserv: double free or corruption (!prev): 0x081c0fe8 ***
[New Thread 0xb7fdd770 (LWP 9644)]
======= Backtrace: =========
/lib/libc.so.6[0x1e453a4]
/lib/libc.so.6(cfree+0x96)[0x1e47356]
/usr/local/lib/libgeos_c.so.1(finishGEOS_r+0x21)[0x43aaf1]
/usr/local/lib/libgeos_c.so.1(finishGEOS+0x22)[0x4358a2]
/home/tkralidi/foss4g/mapserver/trunk/mapserver/mapserv(msGEOSCleanup+0x17)[0x812e4b7]
/home/tkralidi/foss4g/mapserver/trunk/mapserver/mapserv(msCleanup+0x5d)[0x808bf6d]
/home/tkralidi/foss4g/mapserver/trunk/mapserver/mapserv(main+0xa32)[0x80677b2]
/lib/libc.so.6(__libc_start_main+0xe5)[0x1dec6e5]
/home/tkralidi/foss4g/mapserver/trunk/mapserver/mapserv[0x8063d21]
======= Memory map: ========
00101000-0010e000 r-xp 00000000 68:03 10977499   /lib/libgcc_s-4.3.2-20081105.so.1
0010e000-0010f000 rw-p 0000c000 68:03 10977499   /lib/libgcc_s-4.3.2-20081105.so.1
00111000-00121000 r-xp 00000000 68:11 4194341    /usr/lib/libXpm.so.4.11.0
00121000-00122000 rw-p 0000f000 68:11 4194341    /usr/lib/libXpm.so.4.11.0
00122000-00155000 r-xp 00000000 68:11 4194420    /usr/lib/libagg.so.2.0.4
00155000-00158000 rw-p 00032000 68:11 4194420    /usr/lib/libagg.so.2.0.4
00158000-00270000 r-xp 00000000 68:11 20250998   /usr/local/lib/libpdf.so.6.0.0
00270000-00297000 rw-p 00118000 68:11 20250998   /usr/local/lib/libpdf.so.6.0.0
00297000-002ad000 r-xp 00000000 68:03 10977559   /lib/libnsl-2.9.so
002ad000-002ae000 r--p 00016000 68:03 10977559   /lib/libnsl-2.9.so
002ae000-002af000 rw-p 00017000 68:03 10977559   /lib/libnsl-2.9.so
002af000-002b1000 rw-p 002af000 00:00 0 
002b1000-002b8000 r-xp 00000000 68:11 4194684    /usr/lib/libSM.so.6.0.0
002b8000-002b9000 rw-p 00006000 68:11 4194684    /usr/lib/libSM.so.6.0.0
002b9000-002bb000 r-xp 00000000 68:03 10977384   /lib/libcom_err.so.2.1
002bb000-002bc000 rw-p 00001000 68:03 10977384   /lib/libcom_err.so.2.1
002bc000-00325000 r-xp 00000000 68:11 4194951    /usr/lib/libsqlite3.so.0.8.6
00325000-00327000 rw-p 00068000 68:11 4194951    /usr/lib/libsqlite3.so.0.8.6
00327000-00373000 r-xp 00000000 68:11 4194842    /usr/lib/libcurl.so.4.1.1
00373000-00375000 rw-p 0004b000 68:11 4194842    /usr/lib/libcurl.so.4.1.1
00375000-0039c000 r-xp 00000000 68:03 10977373   /lib/libm-2.9.so
0039c000-0039d000 r--p 00026000 68:03 10977373   /lib/libm-2.9.so
0039d000-0039e000 rw-p 00027000 68:03 10977373   /lib/libm-2.9.so
0039e000-003e5000 r-xp 00000000 68:03 10977316   /lib/libssl.so.0.9.8g
003e5000-003e9000 rw-p 00046000 68:03 10977316   /lib/libssl.so.0.9.8g
003e9000-0042a000 r-xp 00000000 68:11 20250716   /usr/local/lib/libming.so.0.3.0beta2
0042a000-0042c000 rw-p 00041000 68:11 20250716   /usr/local/lib/libming.so.0.3.0beta2
0042c000-0042e000 rw-p 0042c000 00:00 0 
0042e000-00441000 r-xp 00000000 68:11 20250696   /usr/local/lib/libgeos_c.so.1.5.0
00441000-00442000 rw-p 00012000 68:11 20250696   /usr/local/lib/libgeos_c.so.1.5.0
00442000-00470000 r-xp 00000000 68:11 4195156    /usr/lib/libfontconfig.so.1.3.0
00470000-00471000 rw-p 0002e000 68:11 4195156    /usr/lib/libfontconfig.so.1.3.0
00471000-00488000 r-xp 00000000 68:11 4195079    /usr/lib/libICE.so.6.3.0
00488000-00489000 rw-p 00016000 68:11 4195079    /usr/lib/libICE.so.6.3.0
00489000-0048b000 rw-p 00489000 00:00 0 
0048b000-0048e000 r-xp 00000000 68:03 10977335   /lib/libplds4.so
0048e
Program received signal SIGABRT, Aborted.
0x004a2416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install agg-2.5-6.fc9.i386 cyrus-sasl-lib-2.1.22-19.fc10.i386 e2fsprogs-libs-1.41.4-1.fc10.i386 expat-2.0.1-5.i386 fontconfig-2.6.0-3.fc10.i386 gd-2.0.35-6.fc10.i386 glibc-2.9-3.i686 keyutils-libs-1.2-3.fc9.i386 krb5-libs-1.6.3-16.fc10.i386 libICE-1.0.4-4.fc10.i386 libSM-1.1.0-2.fc10.i386 libX11-1.1.4-6.fc10.i386 libXau-1.0.4-1.fc10.i386 libXdmcp-1.0.2-6.fc10.i386 libXpm-3.5.7-4.fc9.i386 libcurl-7.19.4-1.fc10.i386 libgcc-4.3.2-7.i386 libidn-0.6.14-8.i386 libjpeg-6b-43.fc10.i386 libpng-1.2.35-1.fc10.i386 libselinux-2.0.73-1.fc10.i386 libssh2-0.18-7.fc9.i386 libstdc++-4.3.2-7.i386 libxcb-1.1.91-5.fc10.i386 libxml2-2.7.3-1.fc10.i386 mysql-libs-5.0.67-2.fc10.i386 nspr-4.7.3-2.fc10.i386 nss-3.12.2.0-4.fc10.i386 openldap-2.4.12-1.fc10.i386 openssl-0.9.8g-12.fc10.i686 postgresql-libs-8.3.6-1.fc10.i386 sqlite-3.5.9-4.fc10.i386 xerces-c-2.8.0-2.fc10.i386 zlib-1.2.3-18.fc9.i386
(gdb) bt
#0  0x004a2416 in __kernel_vsyscall ()
#1  0x01e01460 in raise () from /lib/libc.so.6
#2  0x01e02e28 in abort () from /lib/libc.so.6
#3  0x01e3efed in __libc_message () from /lib/libc.so.6
#4  0x01e453a4 in malloc_printerr () from /lib/libc.so.6
#5  0x01e47356 in free () from /lib/libc.so.6
#6  0x0043aaf1 in finishGEOS_r (extHandle=0x0) at geos_ts_c.cpp:151
#7  0x004358a2 in finishGEOS () at geos_c.cpp:85
#8  0x0812e4b7 in msGEOSCleanup () at mapgeos.c:65
#9  0x0808bf6d in msCleanup () at maputil.c:1700
#10 0x080677b2 in main (argc=2, argv=0xbffff534) at mapserv.c:1817
(gdb) 


Note that when built against 3.0.3, MapServer runs fine.

Digging deeper, we use initGEOS() and finishGEOS(). Between 3.0.3 and svn trunk, the thread safety work was introduced. Note that finishGEOS() was an empty function in 3.0.3.

In discussing with pramsey, there is something going on when free'ing the handle that is created throughout the process.

I hope I have explained this clearly enough. Let me know if you need further info or testing.

Change History (2)

comment:1 by tomkralidis, 15 years ago

Resolution: invalid
Status: newclosed

Marking as invalid. There are issues in the way MapServer inits and cleans up GEOS (subsequent ticket opened at http://trac.osgeo.org/mapserver/ticket/2929). Sorry for the noise.

comment:2 by pramsey, 15 years ago

Milestone: 3.1.0
Note: See TracTickets for help on using tickets.