darfink / region-rs

A cross-platform virtual memory API written in Rust
https://darfink.github.io/region-rs/
MIT License
119 stars 23 forks source link

query_code test fails on Fedora Rawhide #5

Closed ignatenkobrain closed 5 years ago

ignatenkobrain commented 5 years ago
---- tests::query_code stdout ----
thread 'tests::query_code' panicked at 'assertion failed: `(left == right)`
  left: `Read`,
 right: `Read | Execute | ReadExecute`', src/lib.rs:211:7
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Let me know what other information you need.

Thanks!

darfink commented 5 years ago

Thanks for your report. This test in particular is a peculiar one which has displayed unexpected behaviours on multiple platforms.

Do you happen to be able to re-run the tests using: cargo test -- --test-threads=1? And also, have you noticed whether this result is sporadic or consistent?

ignatenkobrain commented 5 years ago

This is happening always and --test-threads=1 does not help with it =(

darfink commented 5 years ago

I've investigated the issue and resolved it. I naively used a reference to the function, so the query was executed on a local variable (in the data segment) instead of the function address itself (text segment).

https://github.com/darfink/region-rs/commit/aa9eb3570572501964d87b8e7bc096e2192ccc7d