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

thread 'main' panicked at 'called Result::unwrap() on an Err value #12

Open
jtpio opened this issue Mar 30, 2017 · 9 comments
Open

thread 'main' panicked at 'called Result::unwrap() on an Err value #12

jtpio opened this issue Mar 30, 2017 · 9 comments
Labels

Comments

@jtpio
Copy link
Contributor

jtpio commented Mar 30, 2017

Got this error when showing the logs via sonic-pi-tool logs:

[Run 7, Time 497.6501]
  ├ cue :drum
  └ sync :lead
 
 => Starting run 35
  
  => Thread :live_loop_drum exists: skipping creation
  
  => Thread :live_loop_lead exists: skipping creation
  
  => Thread :live_loop_bass exists: skipping creation
  
 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value
 : ReadError(Error { repr: Custom(Custom { kind: UnexpectedEof, error:
 StringError("failed to fill whole buffer") }) })', src/libcore/result.
 rs:868
 note: Run with `RUST_BACKTRACE=1` for a backtrace.

Just leaving it here for now, but I can try to get more details later if needed (a backtrace for example).

@lpil
Copy link
Owner

lpil commented Mar 31, 2017

How exciting. Thank you for the report :)

@lpil lpil added the bug label Mar 31, 2017
@lpil
Copy link
Owner

lpil commented Apr 2, 2017

Are you able to replicate the error?

@jtpio
Copy link
Contributor Author

jtpio commented Apr 3, 2017

Not yet, haven't played with Sonic Pi since.

@jtpio
Copy link
Contributor Author

jtpio commented Apr 4, 2017

Did a pretty long session (more than 30 minutes) after setting RUST_BACKTRACE=1, but couldn't reproduce.

@yaychris
Copy link
Contributor

Here's a test case to reproduce this error:

  1. Run sonic-pi-tool start-server
  2. Run sonic-pi-tool logs
  3. Eval the following via sonic-pi-tool eval-stdin:
    live_loop :boom do
      8.times do
        sample :loop_industrial
    
        sleep sample_duration(:loop_industrial)
      end
    end
  4. Eval the following via sonic-pi-tool eval-stdin:
    live_loop :boom do
      8.times do
        sample :loop_industrial, onset: 'uh oh'
    
        sleep sample_duration(:loop_industrial)
      end
    end

@lpil
Copy link
Owner

lpil commented May 12, 2017

Wonderful, thank you!

@lpil
Copy link
Owner

lpil commented May 12, 2017

Would you like to make a PR adding these files to the priv directory? You could possibly also add a shell script that looks something like this:

#!/bin/sh
set -euo pipefail

# Replication of crash detailed here:
# https://github.com/lpil/sonic-pi-tool/issues/12

cargo run eval-file path/to/file/one.rb
sleep 1
cargo run eval-file path/to/file/two.rb

yaychris added a commit to yaychris/sonic-pi-tool that referenced this issue May 12, 2017
@yaychris
Copy link
Contributor

PR for reproduction script here.

lpil pushed a commit that referenced this issue May 14, 2017
@lpil
Copy link
Owner

lpil commented May 14, 2017

That example script doesn't cause a crash for me.

Could you confirm what version of Sonic PI you're using? I'm testing on v2.11.1.

louis ~/projects/sonic-pi-tool (master) ✘ $ cargo run logs
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/sonic-pi-tool logs`
=> Studio: Resuming SuperCollider audio server

=> Starting run 3

=> Redefining fn :live_loop_boom

[Run 3, Time 0.0]
 ├ cue :boom
 └ sample "/Applications/Sonic Pi.app/etc/samples",
           "loop_industrial.flac"

=> Starting run 4

=> Redefining fn :live_loop_boom

=> Thread :live_loop_boom exists: skipping creation

[Run 3, Time 0.8837]
 └ sample "/Applications/Sonic Pi.app/etc/samples",
           "loop_industrial.flac"

[Run 3, Time 1.7675]
 └ sample "/Applications/Sonic Pi.app/etc/samples",
           "loop_industrial.flac"

=> Completed run 4

[Run 3, Time 2.6512]
 └ sample "/Applications/Sonic Pi.app/etc/samples",
           "loop_industrial.flac"

Runtime Error: [buffer eval, line 4]
Thread death +--> :live_loop_boom
 Unknown sample onset: value. Expected a number or a proc. Got "uh oh"


[Run 3, Time 3.535]
 └ cue :boom

=> Completed run 3

=> All runs completed


=> Studio: Pausing SuperCollider audio server

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

No branches or pull requests

3 participants