Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#1736 closed defect (fixed)

WMS getFeatureInfo with OracleSpatial layer crashes

Reported by: arovira@… Owned by: fsimon@…
Priority: high Milestone: 5.0 release
Component: Input - Native Oracle Spatial Support Version: unspecified
Severity: major Keywords:
Cc: umn-ms@…

Description (last modified by dmorissette)

Hi,

I've made some tests of WMS getFeatureInfo with VML output and I get some 
crashes when I was using OracleSpatial layers.

After some debug I found there is an error in function 
msOracleSpatialLayerGetShape. This function creates a 1 position array.
An then access more positions of this array. the lines involved are:

2069: OCIDefine *adtp = NULL, *items[QUERY_SIZE] = { NULL };

and

2151: success = TRY( hand, OCIDefineByPos( dthand->stmthp, &items[i], hand-
>errhp, (ub4)i+1, (dvoid *)layerinfo->items_query[i], (sb4)TEXT_SIZE, SQLT_STR, 
(sb2 *)&nullind[i], (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT ) );

I modified last line to:

success = TRY( hand, OCIDefineByPos( dthand->stmthp, &items[0], hand->errhp, 
(ub4)i+1, (dvoid *)layerinfo->items_query[i], (sb4)TEXT_SIZE, SQLT_STR, (sb2 *)
&nullind[i], (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT ) );

and the crash disappeared.

I don't know OCI's API so I don't know if this solution correct. 
Any Oracle guru that can check it ?


Albert Rovira
Nexus Geografics

Attachments (2)

test.map (3.3 KB ) - added by arovira@… 18 years ago.
Sample map using a OracleSpatial layer
oracle.map (2.0 KB ) - added by arovira@… 18 years ago.
Test 2

Download all attachments as: .zip

Change History (9)

comment:1 by fsimon@…, 18 years ago

Hi,
    Sorry for the delay to reply. I will check the code and add for the next 
release.
    Can you send the request ans the mapfile that you used in this case?
    What is the type of the data? Points? Line? Polygon?
    Best regrads.

by arovira@…, 18 years ago

Attachment: test.map added

Sample map using a OracleSpatial layer

comment:2 by arovira@…, 18 years ago

Hi,

I added a sample map file, I use mapscript to generate it so it is a bit 
verbose. In the first line (in comment) there is the query url. The layer are 
polygons. But geometry type seems irrelevant to get the error. In my case when 
the table contains few columns works, if I add some more columns in the table  
mapserver crashes in an OCI Oracle function. The size and type of column added 
seem also irrelevant. The tests I worked are in windows platform.

Thank you,

Albert Rovira
Nexus Geografics

 

comment:3 by fsimon@…, 18 years ago

Hi,
    I checked your mapfile and I saw that you defined the data parameter as 
a "select * from table". I already saw problems when the data was defined 
using this way.
    Did you already tried to change your data parameter to include the columns 
(all or just the columns that you want) instead of "*"?
    Best regards.

by arovira@…, 18 years ago

Attachment: oracle.map added

Test 2

comment:4 by arovira@…, 18 years ago

Hi Fernando,

I clean a bit the test and added the columns in the select (with and without 
the geom column) all this tests crash the original mapserver and
works fine with the modified version. 

I have only one doubt: What is the real utility of items array ?
Should I use a different elements for each call OCIDefineByPos or can I reuse 
the same?

Thank you,
Albert Rovira

comment:5 by umn-ms@…, 17 years ago

Cc: umn-ms@… added

comment:6 by fsimon, 17 years ago

Resolution: fixed
Status: newclosed

I committed the code with the fix in the SVN this afternoon. The revision is 6435. If the problem persist you can reopen the bug. Best regards.

comment:7 by dmorissette, 17 years ago

Description: modified (diff)
Milestone: 5.0 release
Note: See TracTickets for help on using tickets.