Skip to content

wasm64: bufferSubData fails after heap grows beyond 4 GB #20517

Open
@jspanchu

Description

@jspanchu

Version of emscripten/emsdk:

|-> $ emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.47 (431685f05c67f0424c11473cc16798b9587bb536)
clang version 18.0.0 (https://github.com/llvm/llvm-project 21030b9ab4487d845e29792063f5666d8c4b8e09)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/local/KHQ/jaswant.panchumarti/Documents/code/ansys/vtk-wasm-memory-branch/emsdk/upstream/bin

Error:

Uncaught (in promise) TypeError: Failed to execute 'bufferSubData' on 'WebGL2RenderingContext': parameter 3 is not of type 'ArrayBufferView'.
    at _glBufferSubData (vtkWasmRendererApplication.js:7581:17)

From debugger, it looks like HEAPU8 is a proxy object due to changes introduced by #19737. What is the approach to make the proxy recognizable by bufferSubData?

heap-beyond-4gb-in-buffer-sub-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions