tursodatabase / tursodatabase/libsql

WASM UDF Memory Leak

Open
#898 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

It looks like there's a memory leak in the wasm udf implementation. I built v0.2.2 in a docker container, and created a very simple function, but invoking it will cause the memory usage of the container to increase, remaining until the container is restarted.

basic docker implementation: https://github.com/uname-n/libsql-wasm

#[libsql_bindgen::libsql_bindgen]
pub fn hello_world() -> f64 {
    return 1.0;
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WASM UDF implementation and reproduce the leak using the linked Docker setup and the Rust hello_world function. Measure container memory across repeated invocations, then identify the allocation lifetime involved. Done means the reproduction no longer shows unbounded memory growth and a regression test or equivalent verification covers the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, rust, wasm
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.