Skip to content

Embedded replica (or offline sync) db stack overflows on Windows #2074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
avinassh opened this issue May 22, 2025 · 1 comment
Open

Embedded replica (or offline sync) db stack overflows on Windows #2074

avinassh opened this issue May 22, 2025 · 1 comment

Comments

@avinassh
Copy link
Member

A user is trying to make ER on Windows but unfortunately it stack overflows. This is possibly related to the bugs: #1349 and #1051

Full reproducer is here: https://github.com/kunjee17/dx_todo

dx serve --platform desktop 

# through brew
brew install cargo-binstall

# or from source
cargo install cargo-binstall
cargo binstall dioxus-cli
cargo install

Even a simple example like following is also failing:

    let db = Builder::new_remote_replica(path, url, token).build().await.unwrap();

    let conn = db.connect().unwrap();

    // Create table if it doesn't exist
    let create_table = conn.execute(
        "CREATE TABLE IF NOT EXISTS users (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            name TEXT NOT NULL,
            email TEXT NOT NULL UNIQUE
        )",
        (),
    )
    .await
    .unwrap();

    println!("Created table: {}", create_table);

Increasing the stack size to 800MB also did not work:

# 64 bit MSVC
[target.x86_64-pc-windows-msvc]
rustflags = [
    "-C", "link-arg=/STACK:800000000"
]

# 64 bit Mingw
[target.x86_64-pc-windows-gnu]
rustflags = [
    "-C", "link-arg=-Wl,--stack,800000000"
]

Here are the logs:

warning: unused manifest key: target.x86_64-pc-windows-gnu.rustflags
warning: unused manifest key: target.x86_64-pc-windows-msvc.rustflags
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.59s
     Running `target\debug\todo.exe`
2025-05-22T05:22:38.656484Z DEBUG hyper::client::connect::dns: resolving host="<db-name-redacted>.aws-ap-south-1.turso.io"
2025-05-22T05:22:38.666319Z DEBUG hyper::client::connect::dns: resolving host="<db-name-redacted>.aws-ap-south-1.turso.io"
2025-05-22T05:22:38.679580Z DEBUG hyper::client::connect::http: connecting to 13.200.53.177:443
2025-05-22T05:22:38.680493Z DEBUG hyper::client::connect::http: connecting to 13.200.53.177:443
2025-05-22T05:22:38.703463Z DEBUG hyper::client::connect::http: connected to 13.200.53.177:443
2025-05-22T05:22:38.704924Z DEBUG hyper::client::connect::http: connected to 13.200.53.177:443
2025-05-22T05:22:38.816853Z DEBUG hyper::proto::h1::io: flushed 380 bytes
2025-05-22T05:22:38.889709Z DEBUG hyper::proto::h1::io: parsed 2 headers
2025-05-22T05:22:38.890100Z DEBUG hyper::proto::h1::conn: incoming body is empty
2025-05-22T05:22:38.890685Z DEBUG hyper::client::pool: pooling idle connection for ("https", <db-name-redacted>.aws-ap-south-1.turso.io)
2025-05-22T05:22:38.893290Z DEBUG libsql::sync: read sync metadata for db_path="C:\\Users\\<name-redacted>\\AppData\\Roaming\\FuzzyCloud\\todo\\data\\local.db", metadata=MetadataJson { hash: 3278479626, version: 0, durable_frame_num: 0, generation: 1 }
2025-05-22T05:22:38.894499Z DEBUG hyper::client::connect::dns: resolving host="<db-name-redacted>.aws-ap-south-1.turso.io"
2025-05-22T05:22:38.895535Z DEBUG hyper::client::connect::http: connecting to 13.200.53.177:443
2025-05-22T05:22:38.929952Z DEBUG hyper::client::connect::http: connected to 13.200.53.177:443
2025-05-22T05:22:38.988262Z DEBUG hyper::proto::h1::io: flushed 374 bytes
2025-05-22T05:22:39.042660Z DEBUG hyper::proto::h1::io: parsed 3 headers
2025-05-22T05:22:39.042914Z DEBUG hyper::proto::h1::conn: incoming body is content-length (25 bytes)
2025-05-22T05:22:39.043262Z DEBUG hyper::proto::h1::conn: incoming body completed
2025-05-22T05:22:39.043796Z DEBUG hyper::client::pool: pooling idle connection for ("https", <db-name-redacted>.aws-ap-south-1.turso.io)

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\todo.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)
@kunjee17
Copy link
Contributor

I am that user. Just for ref. So, any one can tag me if there is need for help or test things. Thanks @avinassh for filing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants