fix(compile): bump libsui to 0.16.4 to fix Windows resource SizeOfImage - #36242
Merged
Conversation
libsui 0.16.4 corrects the SizeOfImage computation when `deno compile`
appends the embedded data (and, with --icon, the icon) as a PE resource
section. The previous version grew SizeOfImage by the unaligned raw length of
the appended resource, under-counting the image by up to one page. On Windows
that leaves the tail of the resource section unmapped, which surfaced either
as an access violation at startup before any JavaScript ran, or as the runtime
failing to locate the embedded section ("Could not find standalone binary
section") when an icon was embedded.
This is what regressed compiled binaries between 2.9.2 and 2.9.3 on Windows:
libsui itself was unchanged, but the base binary's layout shifted enough to
start tripping the latent SizeOfImage bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps libsui from 0.16.3 to 0.16.4.
libsui 0.16.4 corrects the SizeOfImage field in the PE header when
deno compileappends the embedded payload (and, with--icon, the icon) as aresource section. The previous version grew SizeOfImage by the unaligned raw
length of the appended resource data, under-counting the image by up to one
section-alignment page. On Windows an undersized SizeOfImage leaves the tail of
the resource section outside the mapped image, which shows up either as an
access violation at startup before any JavaScript runs, or as the runtime
failing to find the embedded section and reporting "Could not find standalone
binary section" when an icon is embedded.
This is what regressed compiled binaries between 2.9.2 and 2.9.3 on Windows.
libsui itself did not change between those releases; the base
denobinary'ssection layout shifted just enough that the latent SizeOfImage miscalculation
began clipping the resource section. The fix recomputes SizeOfImage from the
final section table so it always covers every section's aligned virtual extent.
The libsui change (denoland/sui#79) also adds cross-platform regression tests
for this.
Closes #36206
Closes #36238