Skip to content

OS X: Programs that exit within 5 milliseconds cause a panic #2

Description

@AaronM04

This is colerr v1.0.0 installed with cargo install colerr on Mac OS X Yosemite.

Command:
colerr rm

Expected Result:
It prints in red:

usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file

Actual Result:
It panics:

thread 'mioco_thread_2' panicked at 'register failed: Error { repr: Os { code: 32, message: "Broken pipe" } }', ../src/libcore/result.rs:788
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This works though:

$ colerr -- sh -c 'sleep 0.005; rm'
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file

A backtrace (note that it now works with a 4ms sleep but not 3ms):

$ RUST_BACKTRACE=1 colerr -- sh -c 'sleep 0.003; rm'
thread 'mioco_thread_2' panicked at 'register failed: Error { repr: Os { code: 32, message: "Broken pipe" } }', ../src/libcore/result.rs:788
stack backtrace:
   1:        0x10adf7feb - std::sys::backtrace::tracing::imp::write::h46e546df6e4e4fe6
   2:        0x10adfa16a - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h077deeda8b799591
   3:        0x10adf9d9a - std::panicking::default_hook::heb8b6fd640571a4f
   4:        0x10adf0a98 - std::panicking::rust_panic_with_hook::hd7b83626099d3416
   5:        0x10adfa746 - std::panicking::begin_panic::h941ea76fc945d925
   6:        0x10adf16c8 - std::panicking::begin_panic_fmt::h30280d4dd3f149f5
   7:        0x10adfa39f - rust_begin_unwind
   8:        0x10ae202f0 - core::panicking::panic_fmt::h2d3cc8234dde51b4
   9:        0x10ad1992e - core::result::unwrap_failed::h77e8f7274d900d66
  10:        0x10ad4028d - _<mioco..src..evented..RcEventSource<T> as mioco..src..evented..RcEventSourceTrait>::register::he419acfe1b0130aa
  11:        0x10adbe00f - mioco::src::coroutine::Coroutine::register_all::hd49223ae7acf3f9d
  12:        0x10adbd1a6 - mioco::src::CoroutineControl::resume::h8ab0797f08105571
  13:        0x10adbcfcd - _<mioco..src..FifoSchedulerThread as mioco..src..SchedulerThread>::ready::h81ea54d82d9a585e
  14:        0x10adc2e32 - _<mioco..src..thread..Handler as mio..handler..Handler>::notify::h7eb501dd088f06e0
  15:        0x10ad33fd9 - _<mio..event_loop..EventLoop<H>>::run::hbdae82c0e6850f0b
  16:        0x10ad29d16 - mioco::src::Mioco::thread_loop::h8af71a87769d6015
  17:        0x10ad27519 - std::panicking::try::call::hf5640d3bfdda741e
  18:        0x10adfa81b - __rust_try
  19:        0x10adfa7b5 - __rust_maybe_catch_panic
  20:        0x10ad27d64 - _<F as alloc..boxed..FnBox<A>>::call_box::h2756c0c9825d6bda
  21:        0x10adf93a8 - std::sys::thread::Thread::new::thread_start::hf2eed4b6f7149599
  22:     0x7fff934d199c - _pthread_body
  23:     0x7fff934d1919 - _pthread_start

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions