Skip to content

[BUG] - crashing with multiple connections #5

@malteki

Description

@malteki

Description

When I have multiple SmbFs instances in parallel (rayon, tokio, std::thread, ...) the application crashes with varying messages.
Example error message (I chose the one with the most info, but sometimes it shows only the last line):

talloc: access after free error - first free may be at ../../source3/param/loadparm.c:441
talloc: access after free error - first free may be at ../../source3/param/loadparm.c:441
Bad talloc magic value - unknown value
Bad talloc magic value - access after free
fish: Job 1, 'cargo r -r --bin connect_two' terminated by signal SIGABRT (Abort)

Steps to reproduce

fn main() {
    thread::spawn(|| loop {
        let mut client = SmbFs::try_new(
            SmbCredentials::default()
                .server("smb://192.168.0.250")
                .share("/")
                .username("user")
                .password("wrong-password"),
            SmbOptions::default()
                .case_sensitive(true)
                .one_share_per_server(true),
        )
        .unwrap();

        client.connect();
        client.disconnect();
    });

    loop {
        let mut client = SmbFs::try_new(
            SmbCredentials::default()
                .server("smb://192.168.0.250")
                .share("/")
                .username("user")
                .password("wrong-password"),
            SmbOptions::default()
                .case_sensitive(true)
                .one_share_per_server(true),
        )
        .unwrap();

        client.connect();
        client.disconnect();
    }
}

Environment

  • OS: (Linux) Fedora 41
  • Architecture x86_64
  • Rust version:
    rustc 1.84.1 (e71f9a9a9 2025-01-27)
    binary: rustc
    commit-hash: e71f9a9a98b0faf423844bf0ba7438f29dc27d58
    commit-date: 2025-01-27
    host: x86_64-unknown-linux-gnu
    release: 1.84.1
    LLVM version: 19.1.5
  • remotefs version: "0.3"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions