Bug 290066

Summary: Use mach_vm_remap instead of mach_vm_map to set up permanent mapping for g_config
Product: WebKit Reporter: David Degazio <d_degazio>
Component: Web Template FrameworkAssignee: David Degazio <d_degazio>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=290878

David Degazio
Reported 2025-03-19 14:25:52 PDT
rdar://147347736 Currently in order to set up a permanent memory mapping for g_config on PLATFORM(COCOA), we use mach_vm_map to map over the g_config array with new flags. But because this is creating a new mapping, and not remapping the existing memory, this has the effect of zeroing the g_config array. This is fine so long as this occurs before any nontrivial config information is written to g_config, but since g_config is used by WebKit components that could conceptually be used independently of WTF, such as the Gigacage in bmalloc, we should avoid clearing any initialization information already in the array. To accomplish this, we can use the mach_vm_remap syscall to apply the new permanent mapping flags without destroying the previous data.
Attachments
David Degazio
Comment 1 2025-03-19 15:02:45 PDT
EWS
Comment 2 2025-03-20 13:26:04 PDT
Committed 292440@main (153af8646bb8): <https://commits.webkit.org/292440@main> Reviewed commits have been landed. Closing PR #42713 and removing active labels.
EWS
Comment 3 2025-03-20 19:12:04 PDT
Committed 289651.302@safari-7621-branch (aea3c11b13d5): <https://commits.webkit.org/289651.302@safari-7621-branch> Reviewed commits have been landed. Closing PR #2846 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.