Open Bug 2010402 Opened 8 months ago Updated 3 months ago

memory.grow is not correctly implemented for custom page sizes

Categories

(Core :: JavaScript: WebAssembly, defect, P1)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox147 --- unaffected
firefox148 --- disabled
firefox149 --- disabled
firefox150 --- disabled

People

(Reporter: bvisness, Assigned: asumu)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

It seems that memory.grow is not properly supported in the current implementation of custom page sizes. In fact, there seems to be no testing of various memory APIs whatsoever in the current implementation of custom page sizes. I wish we had caught this before but it seems there are some glaring omissions now.

I've attached a test file that exercises memory.grow. Right now this triggers debug asserts related to our memory bookkeeping, seemingly stemming from the fact that the allocation procedures for wasm memory cannot handle deltas that are not aligned to the system page size.

Set release status flags based on info from the regressing bug 1977854

Thanks and sorry for the broken code paths here, there was some test coverage from the spec tests but I agree it's not enough. I've looked into the memory.grow issue and have some fixes for it that I'll make into a patch. I'll look over the other memory APIs as well.

Pref: javascript.options.wasm_custom_page_sizes

Severity: -- → S3
Priority: -- → P1

Wasm memories with custom page sizes need to be monitored by the
instance for bounds limit changes like moving growable memories.

Add an alternate bounds check that checks against the volatile
memory length for shared memories with custom page sizes, whose
bounds limits can't be updated like non-shared memories when shared
between instances.

Attachment #9548015 - Attachment description: Bug 2010402 - Fix memory.grow for custom page size wasm memories → WIP: Bug 2010402 - Fix memory.grow for custom page size wasm memories
Attachment #9548015 - Attachment description: WIP: Bug 2010402 - Fix memory.grow for custom page size wasm memories → Bug 2010402 - Fix memory.grow for custom page size wasm memories
Attachment #9548016 - Attachment description: WIP: Bug 2010402 - Support shared growable custom page size memories → Bug 2010402 - Support shared growable custom page size memories
Duplicate of this bug: 2029278
Duplicate of this bug: 2029312
Blocks: 2029751
Duplicate of this bug: 2035208
Duplicate of this bug: 2042736
Duplicate of this bug: 2042752
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: