Bug 254532 - [CG] Building the dictionary of the async image decoding options is not thread safe
Summary: [CG] Building the dictionary of the async image decoding options is not threa...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-27 09:57 PDT by Said Abou-Hallawa
Modified: 2023-03-27 14:40 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2023-03-27 09:57:05 PDT
imageSourceThumbnailOptions() is called to build the dictionary of the async image decoding options. It uses the static variable `options` which is initialized the first time this function is called. If this function is called from multiple threads at the same time, more than one thread can see that the static variable `options` is initialized and may initialize it then. Setting the variable from these threads are not be atomic. So we may be end up with invalid pointer for this static variable.
Comment 1 Said Abou-Hallawa 2023-03-27 09:57:27 PDT
rdar://106302373
Comment 2 Said Abou-Hallawa 2023-03-27 10:01:20 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12015
Comment 3 EWS 2023-03-27 14:40:44 PDT
Committed 262175@main (04196137234f): <https://commits.webkit.org/262175@main>

Reviewed commits have been landed. Closing PR #12015 and removing active labels.