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 , 15 years ago
comment:2 by , 12 years ago
Milestone: | → 2.5 |
---|
comment:3 by , 12 years ago
Owner: | set to |
---|
comment:4 by , 12 years ago
Milestone: | 2.5 → 2.6 |
---|
comment:5 by , 10 years ago
I did not find a specific wrong place, please specify where to invoke the MgNamedCollection cache.
comment:8 by , 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.
This problem was found and reported by Reva.