Skip to content

CheerpX JIT compilation error when running ipython #213

@NiltonVolpato

Description

@NiltonVolpato

Description

When running ipython in WebVM, CheerpX's JIT compiler produces invalid WebAssembly, causing compilation failures and triggering fail.wasm downloads.

Steps to Reproduce

  1. Build an Alpine-based WebVM image with ipython installed (pip install ipython)
  2. Boot the VM and run ipython
  3. Observe console errors

Error Output

CompileError: WebAssembly.compile(): Compiling function #8 failed: expected 0 elements on the stack for fallthru, found 1 @+35000

Uncaught CompileError: WebAssembly.Module(): Compiling function #0 failed: expected 0 elements on the stack for fallthru, found 1 @+7503
    at aog (3ed10a5f-2986-4e86-83f5-79758cd9d49b:1:15612)
    at 0073be8a:0xf168a
    at 0073be8a:0x3dba0
    at MessagePort.Iv (3ed10a5f-2986-4e86-83f5-79758cd9d49b:1:60559)

Multiple similar errors follow with different offsets (+6262, +6771, +5806, +5887).

Environment

  • Base image: i386/alpine:edge
  • Python: 3.12
  • ipython: 9.10.0 (latest)
  • Browser: Chrome 144.0.7559.97

Analysis

The error indicates the JIT-compiled WASM has invalid stack behavior ("expected 0 elements on the stack for fallthru, found 1"). This appears to be triggered by specific x86 code paths in ipython/Python that produce invalid WASM during JIT compilation.

The fail.wasm download is CheerpX's fallback mechanism when compilation fails.

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