Opened 17 years ago

Closed 15 years ago

#2184 closed defect (worksforme)

make test for mapscript_csharp fails in 64-bit

Reported by: mgleahy Owned by: tamas
Priority: normal Milestone: 5.4 release
Component: MapScript-C# Version: 5.0
Severity: normal Keywords: csharp mapscript make test
Cc:

Description (last modified by dmorissette)

After mapserver/mapscript_csharp have been compiled on a 64-bit platform (F7-x86_64), the 'make test' for mapscript_csharp fails. However, it works fine when used with other applications (at least for basic operations like generating map images from PostGIS data sources).

The error from make test is below. The process does not terminate on its own, requiring ctrl+c to exit:

LC_ALL=C mono ./shpdump.exe ../../tests/point.shp
*** glibc detected *** mono: free(): invalid pointer: 0x00002aaaaad00fc8 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3b8b070412]
/lib64/libc.so.6(cfree+0x8c)[0x3b8b073b1c]
/usr/lib64/libmapscript.so(CSharp_delete_shapefileObj+0x11)[0x2aaaab57ad91]
[0x4001fa0c]
======= Memory map: ========
00400000-005ca000 r-xp 00000000 08:12 4020235                            /usr/bin/mono
007ca000-007cd000 rw-p 001ca000 08:12 4020235                            /usr/bin/mono
007cd000-007e6000 rw-p 007cd000 00:00 0
009cc000-009d3000 rw-p 001cc000 08:12 4020235                            /usr/bin/mono
009d3000-00ac5000 rw-p 009d3000 00:00 0                                  [heap]
40000000-40010000 rwxp 40000000 00:00 0
40010000-40011000 ---p 40010000 00:00 0
40011000-40014000 rw-p 40011000 00:00 0
40014000-40024000 rwxp 40014000 00:00 0
40024000-40025000 ---p 40024000 00:00 0
40025000-40225000 rw-p 40025000 00:00 0
3b8ac00000-3b8ac1a000 r-xp 00000000 08:12 978548                         /lib64/ld-2.6.so
3b8ae1a000-3b8ae1b000 r--p 0001a000 08:12 978548                         /lib64/ld-2.6.so
3b8ae1b000-3b8ae1c000 rw-p 0001b000 08:12 978548                         /lib64/ld-2.6.so
3b8b000000-3b8b147000 r-xp 00000000 08:12 978578                         /lib64/libc-2.6.so
3b8b147000-3b8b347000 ---p 00147000 08:12 978578                         /lib64/libc-2.6.so
3b8b347000-3b8b34b000 r--p 00147000 08:12 978578                         /lib64/libc-2.6.so
3b8b34b000-3b8b34c000 rw-p 0014b000 08:12 978578                         /lib64/libc-2.6.so
3b8b34c000-3b8b351000 rw-p 3b8b34c000 00:00 0
3b8b400000-3b8b482000 r-xp 00000000 08:12 978613                         /lib64/libm-2.6.so
3b8b482000-3b8b681000 ---p 00082000 08:12 978613                         /lib64/libm-2.6.so
3b8b681000-3b8b682000 r--p 00081000 08:12 978613                         /lib64/libm-2.6.so
3b8b682000-3b8b683000 rw-p 00082000 08:12 978613                         /lib64/libm-2.6.so
3b8b800000-3b8b802000 r-xp 00000000 08:12 978692                         /lib64/libdl-2.6.so
3b8b802000-3b8ba02000 ---p 00002000 08:12 978692                         /lib64/libdl-2.6.so
3b8ba02000-3b8ba03000 r--p 00002000 08:12 978692                         /lib64/libdl-2.6.so
3b8ba03000-3b8ba04000 rw-p 00003000 08:12 978692                         /lib64/libdl-2.6.so
3b8bc00000-3b8bc15000 r-xp 00000000 08:12 978694                         /lib64/libpthread-2.6.so
3b8bc15000-3b8be14000 ---p 00015000 08:12 978694                         /lib64/libpthread-2.6.so
3b8be14000-3b8be15000 r--p 00014000 08:12 978694                         /lib64/libpthread-2.6.so
3b8be15000-3b8be16000 rw-p 00015000 08:12 978694                         /lib64/libpthread-2.6.so
3b8be16000-3b8be1a000 rw-p 3b8be16000 00:00 0
3b8c000000-3b8c014000 r-xp 00000000 08:12 978646                         /lib64/libz.so.1.2.3
3b8c014000-3b8c213000 ---p 00014000 08:12 978646                         /lib64/libz.so.1.2.3
3b8c213000-3b8c214000 rw-p 00013000 08:12 978646                         /lib64/libz.so.1.2.3
3b8c400000-3b8c504000 r-xp 00000000 08:12 4040089                        /usr/lib64/libX11.so.6.2.0
3b8c504000-3b8c704000 ---p 00104000 08:12 4040089                        /usr/lib64/libX11.so.6.2.0
3b8c704000-3b8c70b000 rw-p 00104000 08:12 4040089                        /usr/lib64/libX11.so.6.2.0
3b8c800000-3b8c802000 r-xp 00000000 08:12 4040087                        /usr/lib64/libXau.so.6.0.0
3b8c802000-3b8ca01000 ---p 00002000 08:12 4040087                        /usr/lib64/libXau.so.6.0.0
3b8ca01000-3b8ca02000 rw-p 00001000 08:12 4040087                        /usr/lib64/libXau.so.6.0.0
3b8cc00000-3b8cc05000 r-xp 00000000 08:12 4040088                        /usr/lib64/libXdmcp.so.6.0.0
3b8cc05000-3b8ce04000 ---p 00005000 08:12 4040088                        /usr/lib64/libXdmcp.so.6.0.0
3b8ce04000-3b8ce05000 rw-p 00004000 08:12 4040088                        /usr/lib64/libXdmcp.so.6.0.0
3b8d000000-3b8d021000 r-xp 00000000 08:12 4040761                        /usr/lib64/libgd.so.2.0.0
3b8d021000-3b8d220000 ---p 00021000 08:12 4040761                        /usr/lib64/libgd.so.2.0.0
3b8d220000-3b8d241000 rw-p 00020000 08:12 4040761                        /usr/lib64/libgd.so.2.0.0
3b8d241000-3b8d255000 rw-p 3b8d241000 00:00 0
3b8d400000-3b8d409000 r-xp 00000000 08:12 4040161                        /usr/lib64/libSM.so.6.0.0
3b8d409000-3b8d609000 ---p 00009000 08:12 4040161                        /usr/lib64/libSM.so.6.0.0
3b8d609000-3b8d60a000 rw-p 00009000 08:12 4040161                        /usr/lib64/libSM.so.6.0.0
3b8d800000-3b8d817000 r-xp 00000000 08:12 4040101                        /usr/lib64/libICE.so.6.3.0
3b8d817000-3b8da16000 ---p 00017000 08:12 4040101                        /usr/lib64/libICE.so.6.3.0
3b8da16000-3b8da18000 rw-p 00016000 08:12 4040101                        /usr/lib64/libICE.so.6.3.0
3b8da18000-3b8da1b000 rw-p 3b8da18000 00:00 0
3b8dc00000-3b8dc0d000 r-xp 00000000 08:12 978695                         /lib64/libgcc_s-4.1.2-20070503.so.1
3b8dc0d000-3b8de0d000 ---p 0000d000 08:12 978695                         /lib64/libgcc_s-4.1.2-20070503.so.1
3b8de0d000-3b8de0e000 rw-p 0000d000 08:12 978695                         /lib64/libgcc_s-4.1.2-20070503.so.1
3b8e000000-3b8e023000 r-xp 00000000 08:12 4040086                        /usr/lib64/libpng12.so.0.16.0
3b8e023000-3b8e223000 ---p 00023000 08:12 4040086                        /usr/lib64/libpng12.so.0.16.0
3b8e223000-3b8e224000 rw-p 00023000 08:12 4040086                        /usr/lib64/libpng12.so.0.16.0
3b8e400000-3b8e488000 r-xp 00000000 08:12 4040098                        /usr/lib64/libfreetype.so.6.3.15
3b8e488000-3b8e687000 ---p 00088000 08:12 4040098                        /usr/lib64/libfreetype.so.6.3.15
3b8e687000-3b8e68d000 rw-p 00087000 08:12 4040098                        /usr/lib64/libfreetype.so.6.3.15
3b8e800000-3b8e820000 r-xp 00000000 08:12 978693                         /lib64/libexpat.so.0.5.0
3b8e820000-3b8ea1f000 ---p 00020000 08:12 978693                         /lib64/libexpat.so.0.5.0
3b8ea1f000-3b8ea22000 rw-p 0001f000 08:12 978693                         /lib64/libexpat.so.0.5.0
3b8ec00000-3b8ec2a000 r-xp 00000000 08:12 4040099                        /usr/lib64/libfontconfig.so.1.2.0
3b8ec2a000-3b8ee29000 ---p 0002a000 08:12 4040099                        /usr/lib64/libfontconfig.so.1.2.0
3b8ee29000-3b8ee34000 rw-p 00029000 08:12 4040099                        /usr/lib64/libfontconfig.so.1.2.0
3b90000000-3b900e5000 r-xp 00000000 08:12 4040162                        /usr/lib64/libstdc++.so.6.0.8
3b900e5000-3b902e5000 ---p 000e5000 08:12 4040162                        /usr/lib64/libstdc++.so.6.0.8
3b902e5000-3b902eb000 r--p 000e5000 08:12 4040162                        /usr/lib64/libstdc++.so.6.0.8
3b902eb000-3b902ee000 rw-p 000eb000 08:12 4040162                        /usr/lib64/libstdc++.so.6.0.8
3b902ee000-3b90300000 rw-p 3b902ee000 00:00 0
3b90c00000-3b90c10000 r-xp 00000000 08:12 4040190                        /usr/lib64/libXpm.so.4.11.0
3b90c10000-3b90e10000 ---p 00010000 08:12 4040190                        /usr/lib64/libXpm.so.4.11.0
3b90e10000-3b90e11000 rw-p 00010000 08:12 4040190                        /usr/lib64/libXpm.so.4.11.0
3b91400000-3b9149d000 r-xp 00000000 08:12 978705                         /lib64/libglib-2.0.so.0.1200.11
3b9149d000-3b9169c000Stacktrace:

  at (wrapper managed-to-native) OSGeo.MapServer.mapscriptPINVOKE.delete_shapefileObj (System.Runtime.InteropServices.HandleRef) <0x00012>
  at (wrapper managed-to-native) OSGeo.MapServer.mapscriptPINVOKE.delete_shapefileObj (System.Runtime.InteropServices.HandleRef) <0xffffffff>
  at OSGeo.MapServer.shapefileObj.Dispose () <0x00067>
  at OSGeo.MapServer.shapefileObj.Finalize () <0x00018>
  at (wrapper runtime-invoke) System.Object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono [0x517025]
        /lib64/libpthread.so.0 [0x3b8bc0de00]
        /lib64/libc.so.6(gsignal+0x35) [0x3b8b0305c5]
        /lib64/libc.so.6(abort+0x110) [0x3b8b032070]
        /lib64/libc.so.6 [0x3b8b068d0b]
        /lib64/libc.so.6 [0x3b8b070412]
        /lib64/libc.so.6(cfree+0x8c) [0x3b8b073b1c]
        /usr/lib64/libmapscript.so(CSharp_delete_shapefileObj+0x11) [0x2aaaab57ad91]
        [0x4001fa0c]
make: *** [test] Interrupt

Attachments (2)

mapscript-csharp-test.txt (59.4 KB ) - added by mgleahy 16 years ago.
output from mono --trace
valgrind.txt (162.7 KB ) - added by mgleahy 16 years ago.
valgrind output

Download all attachments as: .zip

Change History (10)

comment:1 by dmorissette, 17 years ago

Description: modified (diff)
Milestone: 5.0 release

comment:2 by tamas, 17 years ago

Milestone: 5.0 release5.2 release

comment:3 by tamas, 16 years ago

Milestone: 5.2 release5.4 release

comment:4 by mgleahy, 16 years ago

I tested this the other day with beta2 (and just now with beta3), and it seems to be fine on an F8-x86_64 system I have running, though I still get pretty much the same result on F7-x86_64. Perhaps the problem is to do with the versions of mono (1.2.5.1-3.fc8 vs 1.2.3-5.fc7), or some other unknown factor on my F7 setup...?

comment:5 by tamas, 16 years ago

I've tried both 5.0 and the development version with mono 1.2.2.1 and was working fine (Debian 2.6.18-5-amd64). However versions after 1.2.2.1 may suffer from this issue, but I don't think it's mapscript related. Maybe a test with the mono trace option and a valgrind test would be able to show up something. I hope I'll have a couple of days in the future to deal with this.

by mgleahy, 16 years ago

Attachment: mapscript-csharp-test.txt added

output from mono --trace

by mgleahy, 16 years ago

Attachment: valgrind.txt added

valgrind output

comment:6 by mgleahy, 16 years ago

I ran the mono --trace option, as well as valgrind (see attached files). I don't know the first thing about valgrind, so I hope this is what you're looking for.

Since the later mono version on my F8 system is (1.2.5.1) works fine, I guess that's not the issue. If I'm the only one that's run into this problem, and it's only on the one F7 setup, then my guess is it's a problem with something else on my F7 system.

comment:7 by mgleahy, 16 years ago

Sorry - here's some extra output from valgrind that didn't go into the log file:

Stacktrace:

at (wrapper managed-to-native) OSGeo.MapServer.mapscriptPINVOKE.delete_shapeObj (System.Runtime.InteropServices.HandleRef) <0x00012> at (wrapper managed-to-native) OSGeo.MapServer.mapscriptPINVOKE.delete_shapeObj (System.Runtime.InteropServices.HandleRef) <0xffffffff> at OSGeo.MapServer.shapeObj.Dispose () <0x00067> at OSGeo.MapServer.shapeObj.Finalize () <0x00018> at (wrapper runtime-invoke) System.Object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

mono [0x51b115] mono [0x4e208d] /lib64/libpthread.so.0 [0x3b8bc0de00] /usr/lib64/libmapscript.so(msFreeShape+0x1e) [0x5bc5bce] /usr/lib64/libmapscript.so(CSharp_delete_shapeObj+0x9) [0x5b88e39] [0x4f6b674]

Debug info from gdb:

Using host libthread_db library "/lib64/libthread_db.so.1". vgModuleLocal_do_syscall_for_client_WRK ()

at m_syswrap/syscall-amd64-linux.S:145

in m_syswrap/syscall-amd64-linux.S

Current language: auto; currently asm

================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================

Killed

comment:8 by tamas, 15 years ago

Resolution: worksforme
Status: newclosed

I think there have been a couple of changes in the C# interface which could help to prevent from such memory related issues like this. I close this ticket now since I couldn't reproduce this behaviour. It may be reopened if someone can find this issue to exist.

Note: See TracTickets for help on using tickets.