Skip to content

miri does not support parking_lot (requires futexes: syscall ID 202) #1562

@ralpha

Description

@ralpha

I'm testing out miri on my codebase. (So not very familiar with it)
Given this is much higher level then some small library, so did not expect it to work 2nd try.
This test failed because of unsupported operation: miri does not support syscall ID 202.
It was trying to connect to a SQLite database (via Diesel).

let mut builder = r2d2::Pool::builder();
let pool_result = builder.build(manager); // <<---Error from here

Maybe you can do something with this info.
So call is going: MyApplication -> (diesel ->) r2d2 -> parking_lot -> parking_lot_core -> Error

error: unsupported operation: miri does not support syscall ID 202
   --> /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/thread_parker/linux.rs:112:13
    |
112 | /             libc::syscall(
113 | |                 libc::SYS_futex,
114 | |                 &self.futex,
115 | |                 libc::FUTEX_WAIT | libc::FUTEX_PRIVATE_FLAG,
116 | |                 1,
117 | |                 ts_ptr,
118 | |             )
    | |_____________^ miri does not support syscall ID 202
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
            
    = note: inside `parking_lot_core::thread_parker::imp::ThreadParker::futex_wait` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/thread_parker/linux.rs:112:13
    = note: inside `<parking_lot_core::thread_parker::imp::ThreadParker as parking_lot_core::thread_parker::ThreadParkerT>::park_until` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/thread_parker/linux.rs:87:13
    = note: inside closure at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/parking_lot.rs:650:30
    = note: inside `parking_lot_core::parking_lot::with_thread_data::<parking_lot_core::parking_lot::ParkResult, [closure@parking_lot_core::parking_lot::park::{{closure}}#0 0:&usize, 1:[closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#0 0:&&parking_lot::condvar::Condvar, 1:&*mut parking_lot::raw_mutex::RawMutex, 2:&mut bool], 2:&std::option::Option<std::time::Instant>, 3:&parking_lot_core::parking_lot::ParkToken, 4:[closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#1 0:&&parking_lot::raw_mutex::RawMutex], 5:[closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#2 0:&usize, 1:&mut bool, 2:&&parking_lot::condvar::Condvar]]>` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/parking_lot.rs:224:5
    = note: inside `parking_lot_core::parking_lot::park::<[closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#0 0:&&parking_lot::condvar::Condvar, 1:&*mut parking_lot::raw_mutex::RawMutex, 2:&mut bool], [closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#1 0:&&parking_lot::raw_mutex::RawMutex], [closure@parking_lot::condvar::Condvar::wait_until_internal::{{closure}}#2 0:&usize, 1:&mut bool, 2:&&parking_lot::condvar::Condvar]>` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot_core-0.8.0/src/parking_lot.rs:617:5
    = note: inside `parking_lot::condvar::Condvar::wait_until_internal` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot-0.11.0/src/condvar.rs:338:26
    = note: inside `parking_lot::condvar::Condvar::wait_until::<r2d2::PoolInternals<diesel::sqlite::connection::SqliteConnection>>` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/parking_lot-0.11.0/src/condvar.rs:292:9
    = note: inside `r2d2::Pool::<diesel::r2d2::ConnectionManager<diesel::sqlite::connection::SqliteConnection>>::wait_for_initialization` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/r2d2-0.8.9/src/lib.rs:398:16
    = note: inside `r2d2::config::Builder::<diesel::r2d2::ConnectionManager<diesel::sqlite::connection::SqliteConnection>>::build` at /home/username/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/r2d2-0.8.9/src/config.rs:228:9

For now I'll be adding #[cfg_attr(miri, ignore)].

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