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

Ears call crashes on even runs only #13

Open
skligys opened this issue Jul 6, 2016 · 0 comments
Open

Ears call crashes on even runs only #13

skligys opened this issue Jul 6, 2016 · 0 comments

Comments

@skligys
Copy link

skligys commented Jul 6, 2016

I have very simple code:

let mut sound = Sound::new(sound_ogg_file).unwrap();
sound.play();
while sound.is_playing() {
   sleep(Duration::from_millis(100));
}
sound.stop();

It runs fine the first time (I cancel it with Ctrl+C since it loops and plays other files) but crashes on second, fourth, sixth etc. runs with the error below. Something does not get cleaned up properly on Ctrl+C signal. Any ideas what needs to be cleaned up?

Crash location:

let device = unsafe { ffi::alcOpenDevice(ptr::null_mut()) };

ALSA lib pcm_dmix.c:1079:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': File descriptor in bad state
internal error: cannot open the default device.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:325
stack backtrace:
   1:     0x5567001175df - std::sys::backtrace::tracing::imp::write::h6528da8103c51ab9
   2:     0x55670011a2bb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hbe741a5cc3c49508
   3:     0x556700119f3f - std::panicking::default_hook::he0146e6a74621cb4
   4:     0x55670010ec1e - std::panicking::rust_panic_with_hook::h983af77c1a2e581b
   5:     0x55670011a501 - std::panicking::begin_panic::he426e15a3766089a
   6:     0x55670010faea - std::panicking::begin_panic_fmt::hdddb415186c241e7
   7:     0x55670011a49e - rust_begin_unwind
   8:     0x55670014fe3f - core::panicking::panic_fmt::hf4e16cb7f0d41a25
   9:     0x556700150118 - core::panicking::panic::h907815f47e914305
  10:     0x5566ffff0840 - _<core..option..Option<T>>::unwrap::h40c081deed71d1e9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/macros.rs:21
  11:     0x5566fffe87e5 - df_ambiance::main::hcebc08599674c5fb
                        at /home/skirmis/Work/DfAmbiance/src/main.rs:296
  12:     0x556700119b78 - std::panicking::try::call::h852b0d5f2eec25e4
  13:     0x55670012403b - __rust_try
  14:     0x556700123fde - __rust_maybe_catch_panic
  15:     0x55670011961e - std::rt::lang_start::hfe4efe1fc39e4a30
  16:     0x5566ffff0ea9 - main
  17:     0x7fb7bca86740 - __libc_start_main
  18:     0x5566fffbb728 - _start
  19:                0x0 - <unknown>
error: Process didn't exit successfully: `target/debug/df_ambiance` (exit code: 101)
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

1 participant