Bug fix: SharedMemory's mapped IDs can be empty on OnMemoryDump
On OnMemoryDump, base::SharedMemory's IDs are used to create ownership edges. However, there is no guarantee that the ID is still valid when OnMemoryDump is called. Actually, some crashes [1] are found when MemoryAllocatorDumpGuid::UseSharedMemoryBasedGUIDs() is true [2]. This CL fixes this bug to avoid dumping when shared memory id is invalid (empty). Also, this CL changes OnMemoryDump use SharedMemory:: mapped_id(), that returns an valid ID only when the shared memory is actually mapped, so that we can avoid unnecessary dumps. [1] https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/501311 [2] This is now always false, but we plan to make this return true to use new ownership edges. Bug: 604726 Change-Id: I2400ba334860e57b9b83a785cd69f4a32b8ef151 Reviewed-on: https://chromium-review.googlesource.com/571386Reviewed-by:Primiano Tucci <primiano@chromium.org> Reviewed-by:
Siddhartha S <ssid@chromium.org> Reviewed-by:
John Bauman <jbauman@chromium.org> Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org> Cr-Commit-Position: refs/heads/master@{#488134}
Showing
Please register or sign in to comment