Skip to content
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

progress callback crash #134

Open
thewh1teagle opened this issue Apr 14, 2024 · 2 comments
Open

progress callback crash #134

thewh1teagle opened this issue Apr 14, 2024 · 2 comments

Comments

@thewh1teagle
Copy link
Contributor

thewh1teagle commented Apr 14, 2024

The crash happens only in release build on windows when using move closure (closure without move works)

      params.set_progress_callback_safe(move |progress| {
            // move result in crash! but necessary for passing it into another callback 
            debug!("progress callback {}", progress);
        });

Maybe related 969422c

@CosmicHorrorDev
Copy link

I'm also hitting this same issue on Linux. The following code segfaults when it's run

    let (tx, _) = tokio::sync::mpsc::unbounded_channel::<()>();
    let msg_handle2 = msg_handle.clone();
    params.set_progress_callback_safe(move |_| {
        Handle::current().block_on(async {
            let _ = tx.send(());
        });
    });

From my hacky telegram bot

 INFO  rambot > Logging started
 DEBUG rambot::telegram > Setting telegram commands
 DEBUG rambot::telegram > Getting me
 DEBUG rambot           > Running command: Transcribe
 INFO  rambot::transcriber > Starting transcribe task for REDACTED
 INFO  rambot::transcriber > Worker 1 got work REDACTED
 DEBUG rambot::telegram    > Downloading file REDACTED to /tmp/rambotDwFIhL.ogg
 DEBUG rambot::telegram    > Sending reply to message 622 text:
[1/1] Queued...
 DEBUG rambot::telegram    > Editing message 630 len 20 snippet:
[1/1] Downloading...
 DEBUG rambot::telegram    > Editing message 630 len 21 snippet:
[1/1] Transcribing...
[1]    162739 segmentation fault (core dumped)  cargo r -r

@thewh1teagle
Copy link
Contributor Author

thewh1teagle commented Jul 6, 2024

@CosmicHorrorDev

Try somehow to use the progress callback without move keyword since then rust will touch the memory of it which lead to that crash.
I did it in core/src/transcribe.rs#L125

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