| commit | 4eb384e1341d2999f21a6cfb222f3fd0de0a64b7 | [log] [tgz] | 
|---|---|---|
| author | Kai Ninomiya <kainino@chromium.org> | Thu Jul 31 14:26:32 2025 -0700 | 
| committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jul 31 14:26:32 2025 -0700 | 
| tree | 561964ffe43f4f3f377cfb50466346689c8d6e3f | |
| parent | 34d315a55b42abec66815c945b5cbda27259fe77 [diff] | 
[emscripten] Fix memory management of WGPUCompilationInfo library_webgpu.js would allocate space for WGPUCompilationMessages and their strings and Utf16 chain structs, even if there were no messages. Fix library_webgpu.js and webgpu.cpp so they're in sync about when they need to malloc/free. - Fixes a UB crash when trying to access messages[0] to free the Utf16 chain but there isn't actually a messages[0] at all. (This is only caught by the test in ASAN builds.) - Fixes a leak of the string allocation when there is no messages[0] so the freeing code can't get the pointer to free. (This is definitely a leak because we always allocate at least one byte. The other two allocations may also have leaked, but their allocation sizes were 0.) Tangentially, add -sSAFE_HEAP to debug builds (though this does not catch the bug, that requires a real ASAN build). Fixed: 429140232 Change-Id: Iab2f11e4cbceaa568a7c6633e2501dc3bbb1ce87 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/255497 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.