wasmerio/wasmer · error

Copying tables is currently not implemented!

Error message

Copying tables is currently not implemented!

What it means

Table::copy (element segment-style copying between tables, like the table.copy instruction) is not implemented for the v8/wasm_c_api backend; the method unconditionally panics instead of performing the copy.

Source

Thrown at lib/api/src/backend/v8/entities/table.rs:190

                }
            };
            if !wasm_table_grow(self.handle, delta, init) {
                return Err(RuntimeError::new("Could not grow table"));
            }

            Ok(size)
        }
    }

    pub fn copy(
        _store: &mut impl AsStoreMut,
        _dst_table: &Self,
        _dst_index: u32,
        _src_table: &Self,
        _src_index: u32,
        _len: u32,
    ) -> Result<(), RuntimeError> {
        unimplemented!("Copying tables is currently not implemented!")
    }

    pub(crate) fn from_vm_extern(store: &mut impl AsStoreMut, vm_extern: VMExternTable) -> Self {
        check_isolate(store);
        let store_mut = store.as_store_mut();

        Self {
            handle: vm_extern.unwrap_v_8(),
        }
    }

    pub fn is_from_store(&self, store: &impl AsStoreRef) -> bool {
        check_isolate(store);
        true
    }
}

impl crate::Table {

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Switch to a backend that implements Table::copy (sys/LLVM)
  2. Copy elements manually: read each element with Table::get and write with Table::set in a loop
  3. Avoid table.copy-dependent modules on this backend
  4. Implement Table::copy for this backend upstream

Example fix

// before
Table::copy(&mut store, &dst_table, 0, &src_table, 0, len)?;
// after
for i in 0..len {
    let item = src_table.get(&store, src_index + i).unwrap();
    dst_table.set(&mut store, dst_index + i, item)?;
}
Defensive patterns

Strategy: validation

Validate before calling

fn table_copy_supported(engine: &Engine) -> bool {
    !matches!(engine.target_backend(), Backend::WasmCApi | Backend::V8)
}

Try / catch

let res = std::panic::catch_unwind(|| Table::copy(&mut store, &dst, 0, &src, 0, len));
if res.is_err() { copy_tables_via_get_set(&mut store, &src, &dst)?; }

Prevention

When it happens

Trigger: Calling Table::copy(dst_store, dst_table, dst_index, src_table, src_index, len) with the v8 backend; instantiating modules that rely on host-driven table copies; some bulk-memory operations routed through this API.

Common situations: Dynamic linking schemes and module instrumentation that copy function tables; tests written against the sys backend being run under v8.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/bd516de6dfb91e03. Report an issue: GitHub.