Opened 15 years ago

Last modified 4 years ago

#1268 new defect

MgNamedCollection cache can become stale and cause crashes by holding refs to deleted objects

Reported by: tomfukushima Owned by: jng
Priority: high Milestone: 4.0
Component: General Version: 2.1.0
Severity: major Keywords:
Cc: External ID: 1289652.01

Description

When more than 10 elements are added to the MgNamedCollection it will switch to using a std::map for faster lookups.

Unfortunately, the key used for lookup can be renamed after the std::map was created, the key for that element would be invalid and if the renamed element is removed, its entry in the map would not be removed (becomes an orphan) and thus opens up opportunities for crashes whenever a query comes in looking for the same element by name because of a stale object stored for the queried element name.

Change History (8)

comment:1 by tomfukushima, 15 years ago

This problem was found and reported by Reva.

comment:2 by jng, 12 years ago

Milestone: 2.5

comment:3 by jng, 12 years ago

Owner: set to jng

comment:4 by jng, 12 years ago

Milestone: 2.52.6

comment:5 by cmy, 10 years ago

I did not find a specific wrong place, please specify where to invoke the MgNamedCollection cache.

comment:6 by jng, 7 years ago

Milestone: 3.03.3

Ticket retargeted after milestone closed

comment:7 by jng, 6 years ago

Milestone: 3.34.0

Milestone renamed

comment:8 by cmy, 4 years ago

It is recommended that this issue be turned off, and the validity of the application cache data should be controlled by the application, regardless of mapguide.

Note: See TracTickets for help on using tickets.