Closed
Bug 1320196
Opened 7 years ago
Closed 7 years ago
Eliminate unnecessary string concatenations in ImageCacheKey::ComputeHash
Categories
(Core :: Graphics: ImageLib, defect, P3)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla53
People
(Reporter: aosmond, Assigned: aosmond)
References
Details
(Whiteboard: gfx-noted)
Crash Data
Attachments
(1 file, 1 obsolete file)
3.81 KB,
patch
|
aosmond
:
review+
jcristau
:
approval-mozilla-aurora+
gchang
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Hashing several strings appended together, and hashing them individually should result in the same value, except the latter is a much cheaper option. http://searchfox.org/mozilla-central/rev/b4e6fa3527436bdbcd9dd2e1982382fe423431f3/image/ImageCacheKey.cpp#158 This allow triggers a malloc, which shows up in crash signatures, such as: https://crash-stats.mozilla.com/report/index/77317c14-819d-4853-99ac-7bcaf2161118 The malloc is so big (presumably) because the URI spec can be quite large if it is just a base64 encoded image instead of a normal URL.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: gfx-noted
Assignee | ||
Updated•7 years ago
|
Crash Signature: [@ OOM | large | NS_ABORT_OOM | nsACString_internal::Assign | mozilla::image::ImageCacheKey::ImageCacheKey ]
Assignee | ||
Comment 1•7 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dec4057d18498db22bed7480dd730c991746da70
Attachment #8814245 -
Flags: review?(tnikkel)
Assignee | ||
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Comment on attachment 8814245 [details] [diff] [review] Remove string concat in ImageCacheKey::ComputeHash, v1 Nice! ImageURL::ComputeHash isn't a generic function, but rather specific to ImageCacheKey. So maybe make it private and mark ImageCacheKey as a friend class?
Attachment #8814245 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 3•7 years ago
|
||
Incorporate review feedback.
Attachment #8814245 -
Attachment is obsolete: true
Attachment #8814389 -
Flags: review+
Pushed by aosmond@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b8cdb59ac18b Avoid string concatenation when computing the hash for ImageCacheKey. r=tnikkel
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b8cdb59ac18b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Assignee | ||
Comment 6•7 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review] Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel] Approval Request Comment [Feature/regressing bug #]: N/A [User impact if declined]: May crash in low memory conditions. [Describe test coverage new/current, TreeHerder]: The crash itself has only been observed in crash reports, not easily reproducible. However the crash occurs on a success path used every time an image is loaded and is thus well exercised by existing mochi/web-platorm/reftests. [Risks and why]: Minimal, there was no functional change, only the need for some temporary allocations on the heap was removed. [String/UUID change made/needed]: N/A
Attachment #8814389 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 7•7 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review] Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel] Approval Request Comment [Feature/regressing bug #]: N/A [User impact if declined]: May crash in low memory conditions. [Describe test coverage new/current, TreeHerder]: The crash itself has only been observed in crash reports, not easily reproducible. However the crash occurs on a success path used every time an image is loaded and is thus well exercised by existing mochi/web-platorm/reftests. [Risks and why]: Minimal, there was no functional change, only the need for some temporary allocations on the heap was removed. [String/UUID change made/needed]: N/A
Attachment #8814389 -
Flags: approval-mozilla-beta?
Comment 8•7 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review] Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel] reduce risk of OOM, take in aurora52
Attachment #8814389 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 9•7 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/35d579c4ff1e
Comment 10•7 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review] Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel] Fix a crash. Beta51+. Should be in 51 beta 5.
Attachment #8814389 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 11•7 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/110c796d4372
You need to log in
before you can comment on or make changes to this bug.
Description
•