sonic-pi-tool icon indicating copy to clipboard operation
sonic-pi-tool copied to clipboard

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

Open jtpio opened this issue 7 years ago • 9 comments

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).

jtpio avatar Mar 30 '17 23:03 jtpio

How exciting. Thank you for the report :)

lpil avatar Mar 31 '17 07:03 lpil

Are you able to replicate the error?

lpil avatar Apr 02 '17 14:04 lpil

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

jtpio avatar Apr 03 '17 21:04 jtpio

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

jtpio avatar Apr 04 '17 23:04 jtpio

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
    

yaychris avatar May 12 '17 03:05 yaychris

Wonderful, thank you!

lpil avatar May 12 '17 08:05 lpil

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

lpil avatar May 12 '17 08:05 lpil

PR for reproduction script here.

yaychris avatar May 12 '17 18:05 yaychris

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

lpil avatar May 14 '17 11:05 lpil