Skip to content

Can't call foreign function: clock_gettime #641

Closed
@kpp

Description

@kpp
cargo +nightly miri -V # miri 0.1.0 (76138c5 2019-02-17)
rustc -vV # 1.34.0-nightly (146aa60f3 2019-02-18)

How to reproduce:

cd tokio
git log -n1 # commit 4985e0c6084646e0de2a42b361ca897882eff504
$ cargo +nightly miri test
   Compiling tokio v0.1.15 (/home/humbug/tokio)
running 1 test
error[E0080]: constant evaluation error: can't call foreign function: clock_gettime
   --> /home/humbug/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/sys/unix/time.rs:361:13
    |
361 |             libc::clock_gettime(clock, &mut t.t)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: clock_gettime
    |
    = note: inside call to `std::sys::unix::time::inner::now` at /home/humbug/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/sys/unix/time.rs:275:26
    = note: inside call to `std::sys::unix::time::inner::Instant::now` at /home/humbug/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/time.rs:158:22
    = note: inside call to `std::time::Instant::now` at /home/humbug/tokio/tokio-timer/src/clock/clock.rs:48:17
    = note: inside call to closure at /home/humbug/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/thread/local.rs:300:16
    = note: inside call to `<std::thread::LocalKey<T>><std::cell::Cell<std::option::Option<*const tokio_timer::clock::Clock>>>::try_with::<[closure@DefId(54/1:9 ~ tokio_timer[4753]::clock[0]::clock[0]::now[0]::{{closure}}[0])], std::time::Instant>` at /home/humbug/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/thread/local.rs:246:9
    = note: inside call to `<std::thread::LocalKey<T>><std::cell::Cell<std::option::Option<*const tokio_timer::clock::Clock>>>::with::<[closure@DefId(54/1:9 ~ tokio_timer[4753]::clock[0]::clock[0]::now[0]::{{closure}}[0])], std::time::Instant>` at /home/humbug/tokio/tokio-timer/src/clock/clock.rs:46:5
    = note: inside call to `tokio_timer::clock::now` at /home/humbug/tokio/tokio-timer/src/timeout.rs:128:40
note: inside call to `<tokio_timer::Timeout<T>><futures::Finished<(), ()>>::new` at src/util/future.rs:64:9
   --> src/util/future.rs:64:9
    |
64  |         Timeout::new(self, timeout)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<futures::Finished<(), ()> as util::future::FutureExt>::timeout` at src/util/future.rs:90:32
   --> src/util/future.rs:90:32
    |
90  |         let timeouted_future = base_future.timeout(Duration::new(0, 0));
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `util::future::test::timeout_polls_at_least_once` at src/util/future.rs:88:5
   --> src/util/future.rs:88:5
    |
88  | /     fn timeout_polls_at_least_once() {
89  | |         let base_future = future::result::<(), ()>(Ok(()));
90  | |         let timeouted_future = base_future.timeout(Duration::new(0, 0));
91  | |         assert!(timeouted_future.wait().is_ok());
92  | |     }
    | |_____^

...
...
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions