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

internal error: entered unreachable code #100

Closed
alanhoff opened this issue Nov 19, 2016 · 0 comments
Closed

internal error: entered unreachable code #100

alanhoff opened this issue Nov 19, 2016 · 0 comments

Comments

@alanhoff
Copy link

alanhoff commented Nov 19, 2016

Hello there, I'm using OSX El Captain and some times when files are created and removed really fast the code reaches this unreachable!() . It doean't happens all the time but an easy way is to monitor a Node.js project while rm -rf ./node_modules && npm install, you will easly receive +30K events and the error almost always happens.

This is my environment:

cargo 0.15.0-nightly (a9c23dd 2016-11-15)
rustc 1.15.0-nightly (43006fcea 2016-11-15)

The stack trace is this:

thread '<unnamed>' panicked at 'internal error: entered unreachable code', /Users/alanhoff/.cargo/git/checkouts/notify-04e06d4ee73f48be/6f58cce7be12c9b5f92404765241541424c6e741/src/debounce/mod.rs:151
stack backtrace:
   1:        0x10b1f17aa - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x10b1f3b6f - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x10b1f3817 - std::panicking::default_hook::h88ffbc5922643264
   4:        0x10b1f4036 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10b1841b3 - std::panicking::begin_panic::h5f0a1fd8f4de57ec
   6:        0x10b1e2f84 - notify::debounce::Debounce::check_partial_rename::h5471efb435c2dda1
   7:        0x10b1e3742 - notify::debounce::Debounce::event::h5ac2f781e05a9a46
   8:        0x10b1e1c12 - notify::debounce::EventTx::send::h1850375a0ba61046
   9:        0x10b1de360 - notify::fsevent::callback::h8dc799b35ccea274
  10:     0x7fff870b2b0a - implementation_callback_rpc
  11:     0x7fff870b06c9 - _Xcallback_rpc
  12:     0x7fff870b079d - FSEventsD2F_server
  13:     0x7fff870b5fd8 - FSEventsClientProcessMessageCallback
  14:     0x7fff86cca12b - __CFMachPortPerform
  15:     0x7fff86cca018 - __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
  16:     0x7fff86cc9f88 - __CFRunLoopDoSource1
  17:     0x7fff86cc19ba - __CFRunLoopRun
  18:     0x7fff86cc0ed7 - CFRunLoopRunSpecific
  19:     0x7fff86d029b0 - CFRunLoopRun
  20:        0x10b1dd688 - notify::fsevent::FsEventWatcher::run::{{closure}}::h1f26a1146180fe54
  21:        0x10b1db4da - <std::panic::AssertUnwindSafe<F> as core::ops::FnOnce<()>>::call_once::h2a906c890c327ae8
  22:        0x10b184d03 - std::panicking::try::do_call::he6db71e4883187fb
  23:        0x10b1f4e8a - __rust_maybe_catch_panic
  24:        0x10b184332 - std::panicking::try::h5e80a8d4bba11476
  25:        0x10b18203e - std::panic::catch_unwind::hd00cde07760ce1f8
  26:        0x10b183ee2 - std::thread::Builder::spawn::{{closure}}::ha40d83fe6940f3de
  27:        0x10b1b5513 - <F as alloc::boxed::FnBox<A>>::call_box::h7dc0418dee0ac1eb
  28:        0x10b1f3264 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  29:     0x7fff909d999c - _pthread_body
  30:     0x7fff909d9919 - _pthread_start

The code that I used is this one:

extern crate notify;

use std::env;
use notify::{RecommendedWatcher, Watcher, RecursiveMode};
use std::sync::mpsc::{channel};
use std::time::Duration;
use std::thread;

fn watch() -> notify::Result<()> {
    let (tx, rx) = channel();
    let mut watcher: RecommendedWatcher = try!(Watcher::new(tx, Duration::from_secs(2)));
    let current_dir = env::current_dir().unwrap();

    try!(watcher.watch(current_dir.clone(), RecursiveMode::Recursive));

    loop {
        match rx.try_recv() {
            Ok(event) => {
                println!("{:?}", event);
            },
            _ => thread::sleep(Duration::from_millis(10))
        };
    }
}

fn main() {
    if let Err(e) = watch() {
        println!("error: {:?}", e)
    }
}

And here is my Cargo.lock

[root]
name = "rust-notify"
version = "0.1.0"
dependencies = [
 "notify 3.0.1 (git+https://github.com/passcod/notify)",
]

[[package]]
name = "bitflags"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "bytes"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "cfg-if"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "filetime"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "fsevent"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "fsevent-sys"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "inotify"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "libc"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "log"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "mio"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
 "nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "miow"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "net2"
version = "0.2.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "nix"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "notify"
version = "3.0.1"
source = "git+https://github.com/passcod/notify#6f58cce7be12c9b5f92404765241541424c6e741"
dependencies = [
 "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
 "fsevent 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
 "fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "inotify 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "mio 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
 "walkdir 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "slab"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "time"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "walkdir"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[metadata]
"checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27"
"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"
"checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922"
"checksum fsevent 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "740a52ca589381d87dd0d9960555de3320aa6d408326659e3bae88be9f71a125"
"checksum fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "72e33a926306442d961595c3a325864326ca4287795e106dae8993afe484ede6"
"checksum inotify 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8458c07bdbdaf309c80e2c3304d14c3db64e7465d4f07cf589ccb83fd0ff31a"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8"
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
"checksum mio 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a637d1ca14eacae06296a008fa7ad955347e34efcb5891cfd8ba05491a37907e"
"checksum miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d5bfc6782530ac8ace97af10a540054a37126b63b0702ddaaa243b73b5745b9a"
"checksum net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "5edf9cb6be97212423aed9413dd4729d62b370b5e1c571750e882cebbbc1e3e2"
"checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79"
"checksum notify 3.0.1 (git+https://github.com/passcod/notify)" = "<none>"
"checksum slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d807fd58c4181bbabed77cb3b891ba9748241a552bcc5be698faaebefc54f46e"
"checksum time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7ec6d62a20df54e07ab3b78b9a3932972f4b7981de295563686849eb3989af"
"checksum walkdir 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c66c0b9792f0a765345452775f3adbd28dde9d33f30d13e5dcc5ae17cf6f3780"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
@dfaust dfaust closed this as completed in b124c36 Nov 19, 2016
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