Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1798 closed defect (fixed)

Java MapScript crash while setting the webObj

Reported by: mapserver@… Owned by: unicoletti
Priority: high Milestone:
Component: MapScript-Java Version: 4.8
Severity: normal Keywords:
Cc:

Description

t try to to construct a map from the scratch and build all object by hand.
Sadly mapscript crashes outside the VM when i set the web Object.
When i do the same thing using a map-file everything is fine.
I attached to files (wms_client.map and wms_client_part.java) which
shows my problem using a WMS layer.

Attachments (2)

wms_client.map (937 bytes ) - added by mapserver@… 18 years ago.
MapFile wms_client.map (works)
wms_client_part.java (2.1 KB ) - added by mapserver@… 18 years ago.
Java Class wms_client_part.java (shows the crash)

Download all attachments as: .zip

Change History (4)

by mapserver@…, 18 years ago

Attachment: wms_client.map added

MapFile wms_client.map (works)

by mapserver@…, 18 years ago

Attachment: wms_client_part.java added

Java Class wms_client_part.java (shows the crash)

comment:1 by unicoletti, 18 years ago

Resolution: fixed
Status: newclosed
The problem is that the webObj has only the default constructor created by swig
which does not call initWeb.
Added web.i with constructor and destructor.

comment:2 by szekerest, 18 years ago

I think this is not the only problem. setWeb will copy the webObj structure
itself to the mapObj member but the subsequent objects are not duplicated. Both
mapObj and webObj will own same memory segments and both of them will call free
on it.
As a resolution the entire object tree should be cloned, or the original webObj
should be "disowned".

For more details visit:

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1803

Tamas
Note: See TracTickets for help on using tickets.