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

Track permissions as bytes #540

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
25bddbf
Track permissions as bytes
workingjubilee Jul 2, 2023
8b39122
Comment-out unused fields
workingjubilee Jul 6, 2023
d810317
Use opt-level=3
workingjubilee Jul 6, 2023
ca8c99d
Omit needless error strings
workingjubilee Jul 6, 2023
6ff19b3
Try adding inlining
workingjubilee Jul 6, 2023
572bffa
Temporarily disable most of CI to be nice
workingjubilee Jul 6, 2023
9df8ebb
Revert "Try adding inlining"
workingjubilee Jul 6, 2023
cb775f1
Use split_ascii_whitespace
workingjubilee Jul 6, 2023
1166cc8
Try not parsing the entire map
workingjubilee Jul 6, 2023
923e090
Revert "Try not parsing the entire map"
workingjubilee Jul 6, 2023
cc6caa0
Revert "Use opt-level=3"
workingjubilee Jul 6, 2023
6a05e64
Inline, but less
workingjubilee Jul 7, 2023
9bc29a0
Revert "Track permissions as bytes"
workingjubilee Jul 7, 2023
9c00af8
Simply discard perms
workingjubilee Jul 7, 2023
1d63a5c
In tests too
workingjubilee Jul 7, 2023
65100f1
Use 1 codegen unit to eliminate variance
workingjubilee Jul 7, 2023
24c0811
Revert "Use 1 codegen unit to eliminate variance"
workingjubilee Jul 7, 2023
16b5f6e
Revert "Simply discard perms"
workingjubilee Jul 7, 2023
268a18d
Revert "In tests too"
workingjubilee Jul 7, 2023
dca80ea
Revert "Revert "Track permissions as bytes""
workingjubilee Jul 7, 2023
e48b001
only one err for io fail
workingjubilee Jul 7, 2023
06ccd70
Use a superpub field in MapsEntry
workingjubilee Jul 7, 2023
6c7e3ac
Revert "Use a superpub field in MapsEntry"
workingjubilee Jul 7, 2023
3a4e308
Try turning && to &
workingjubilee Jul 7, 2023
921ea5a
Revert "Try turning && to &"
workingjubilee Jul 7, 2023
f90ee25
fmt
workingjubilee Jul 7, 2023
b92869e
Experiment with a bufreader
workingjubilee Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 103 additions & 103 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
rust: beta
- os: ubuntu-20.04
rust: nightly
- os: macos-latest
rust: stable
- os: macos-latest
rust: nightly
# - os: macos-latest
# rust: stable
# - os: macos-latest
# rust: nightly
# Note that these are on nightly due to rust-lang/rust#63700 not being
# on stable yet
- os: windows-latest
rust: stable-x86_64-msvc
- os: windows-latest
rust: stable-i686-msvc
- os: windows-latest
rust: stable-x86_64-gnu
# - os: windows-latest
# rust: stable-x86_64-msvc
# - os: windows-latest
# rust: stable-i686-msvc
# - os: windows-latest
# rust: stable-x86_64-gnu
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -115,77 +115,77 @@ jobs:
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml --no-default-features

windows_arm64:
name: Windows AArch64
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable
shell: bash
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: rustup target add aarch64-pc-windows-msvc
- run: cargo test --no-run --target aarch64-pc-windows-msvc
- run: cargo test --no-run --target aarch64-pc-windows-msvc --features verify-winapi

ios:
name: iOS
runs-on: macos-latest
strategy:
matrix:
include:
- target: aarch64-apple-ios
sdk: iphoneos
- target: x86_64-apple-ios
sdk: iphonesimulator
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: rustup target add ${{ matrix.target }}
- run: |
export RUSTFLAGS=-Dwarnings
export SDK_PATH=`xcrun --show-sdk-path --sdk ${{ matrix.sdk }}`
export RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$SDK_PATH"
cargo test --no-run --target ${{ matrix.target }}
name: Build tests

docker:
name: Docker
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- i586-unknown-linux-gnu
- i686-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- s390x-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- arm-linux-androideabi
- armv7-linux-androideabi
- aarch64-linux-android
- i686-linux-android
- x86_64-linux-android
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable
- run: rustup target add ${{ matrix.target }}
- run: cargo generate-lockfile
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: ./ci/run-docker.sh ${{ matrix.target }}
# windows_arm64:
# name: Windows AArch64
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - name: Install Rust
# run: rustup update stable --no-self-update && rustup default stable
# shell: bash
# - run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
# shell: bash
# - run: rustup target add aarch64-pc-windows-msvc
# - run: cargo test --no-run --target aarch64-pc-windows-msvc
# - run: cargo test --no-run --target aarch64-pc-windows-msvc --features verify-winapi

# ios:
# name: iOS
# runs-on: macos-latest
# strategy:
# matrix:
# include:
# - target: aarch64-apple-ios
# sdk: iphoneos
# - target: x86_64-apple-ios
# sdk: iphonesimulator
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - run: rustup target add ${{ matrix.target }}
# - run: |
# export RUSTFLAGS=-Dwarnings
# export SDK_PATH=`xcrun --show-sdk-path --sdk ${{ matrix.sdk }}`
# export RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$SDK_PATH"
# cargo test --no-run --target ${{ matrix.target }}
# name: Build tests

# docker:
# name: Docker
# runs-on: ubuntu-20.04
# strategy:
# fail-fast: false
# matrix:
# target:
# - aarch64-unknown-linux-gnu
# - arm-unknown-linux-gnueabihf
# - armv7-unknown-linux-gnueabihf
# - i586-unknown-linux-gnu
# - i686-unknown-linux-gnu
# - powerpc64-unknown-linux-gnu
# - s390x-unknown-linux-gnu
# - x86_64-pc-windows-gnu
# - x86_64-unknown-linux-gnu
# - x86_64-unknown-linux-musl
# - arm-linux-androideabi
# - armv7-linux-androideabi
# - aarch64-linux-android
# - i686-linux-android
# - x86_64-linux-android
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - name: Install Rust
# run: rustup update stable && rustup default stable
# - run: rustup target add ${{ matrix.target }}
# - run: cargo generate-lockfile
# - run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
# shell: bash
# - run: ./ci/run-docker.sh ${{ matrix.target }}

rustfmt:
name: Rustfmt
Expand All @@ -198,28 +198,28 @@ jobs:
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt --all -- --check

build:
name: Build Targets
runs-on: ubuntu-20.04
strategy:
matrix:
target:
- wasm32-unknown-unknown
- wasm32-wasi
- x86_64-unknown-fuchsia
- x86_64-fortanix-unknown-sgx
- x86_64-unknown-illumos
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup target add ${{ matrix.target }}
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: cargo build --target ${{ matrix.target }}
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml --target ${{ matrix.target }}
# build:
# name: Build Targets
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# target:
# - wasm32-unknown-unknown
# - wasm32-wasi
# - x86_64-unknown-fuchsia
# - x86_64-fortanix-unknown-sgx
# - x86_64-unknown-illumos
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - name: Install Rust
# run: rustup update nightly && rustup default nightly
# - run: rustup target add ${{ matrix.target }}
# - run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
# shell: bash
# - run: cargo build --target ${{ matrix.target }}
# - run: cargo build --manifest-path crates/as-if-std/Cargo.toml --target ${{ matrix.target }}

msrv:
name: MSRV
Expand Down
7 changes: 3 additions & 4 deletions src/symbolize/gimli/libs_dl_iterate_phdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ pub(super) fn native_libraries() -> Vec<Library> {
}

fn infer_current_exe(base_addr: usize) -> OsString {
if let Ok(entries) = super::parse_running_mmaps::parse_maps() {
if let Some(entries) = super::parse_running_mmaps::parse_maps() {
let opt_path = entries
.iter()
.filter_map(|e| e.ok())
.find(|e| e.ip_matches(base_addr) && e.pathname().len() > 0)
.map(|e| e.pathname())
.cloned();
.map(|e| e.pathname().clone());
if let Some(path) = opt_path {
return path;
}
Expand Down
Loading