Opened 15 years ago

Closed 13 years ago

#1304 closed defect (fixed)

Possible bug in constructor MgSelection (MgMap *map, CREFSTRING xmlSelectionString) triggered by empty xmlSelectionString

Reported by: gabrimonfa Owned by:
Priority: low Milestone: 2.4
Component: Server Version: 2.2.0
Severity: trivial Keywords: haspatch
Cc: External ID:

Description

I have mapguide 2.1.0 on Debian etch with apache (let's call it mapguide_apache) and php. In my setup main apache web server is configured to use mapguide_apache with proxy/reverseProxy directives.

If MgSelection (MgMap *map, CREFSTRING xmlSelectionString) is called with an empty xmlSelectionString (it happens when no elements are selected in the map), my main apache logs:

502 Proxy Error

while mapguide_apache logs

[notice] child pid 24438 exit signal Segmentation fault (11)

The server appears to continue without problems but I'm not sure since I have also sporadic crashes (without log entries...)

Attachments (3)

1304.patch (12.3 KB ) - added by jng 13 years ago.
1304_v2.patch (3.3 KB ) - added by jng 13 years ago.
1304_v3.patch (3.5 KB ) - added by jng 13 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by jng, 15 years ago

The MgSelection constructor just delegates to its parent constructor, which internally calls the FromXml() method (http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp#L104)

From what I can see, it just assumes as though the selection string is not empty (it doesn't actually check for an empty string).

I guess the solution is to check for an empty string, but then what to do once we encounter an empty string? Do nothing (return)? Throw MG exception?

comment:2 by gabrimonfa, 14 years ago

Version: 2.1.02.2.0

Is that solved in 2.2RC1 or in trunk?

by jng, 13 years ago

Attachment: 1304.patch added

comment:3 by jng, 13 years ago

Keywords: haspatch added
Milestone: 2.4

by jng, 13 years ago

Attachment: 1304_v2.patch added

by jng, 13 years ago

Attachment: 1304_v3.patch added

comment:4 by jng, 13 years ago

Resolution: fixed
Status: newclosed

Fixed trunk (r6758) and 2.4 (r6756)

Note: See TracTickets for help on using tickets.