Skip to content

Make the Rust Process own the C Process#2612

Merged
sporksmith merged 10 commits intoshadow:mainfrom
sporksmith:owning-process
Dec 20, 2022
Merged

Make the Rust Process own the C Process#2612
sporksmith merged 10 commits intoshadow:mainfrom
sporksmith:owning-process

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

No description provided.

@sporksmith sporksmith self-assigned this Dec 15, 2022
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable labels Dec 15, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 15, 2022

Codecov Report

Base: 68.01% // Head: 67.89% // Decreases project coverage by -0.11% ⚠️

Coverage data is based on head (1cfe4d4) compared to base (a4ab9bf).
Patch coverage: 77.88% of modified lines in pull request are covered.

❗ Current head 1cfe4d4 differs from pull request most recent head 513a9af. Consider uploading reports for the commit 513a9af to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2612      +/-   ##
==========================================
- Coverage   68.01%   67.89%   -0.12%     
==========================================
  Files         200      200              
  Lines       29278    29512     +234     
  Branches     5755     5789      +34     
==========================================
+ Hits        19912    20037     +125     
- Misses       4770     4878     +108     
- Partials     4596     4597       +1     
Flag Coverage Δ
tests 67.89% <77.88%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/lib/shadow-build-common/src/lib.rs 1.17% <0.00%> (-0.20%) ⬇️
src/main/host/descriptor/socket/unix.rs 68.15% <ø> (ø)
src/main/host/memory_manager/memory_mapper.rs 71.84% <ø> (+0.20%) ⬆️
src/main/host/syscall/handler/eventfd.rs 25.71% <0.00%> (-45.72%) ⬇️
src/main/host/syscall/handler/mod.rs 82.50% <33.33%> (-3.75%) ⬇️
src/main/host/syscall/handler/ioctl.rs 60.00% <36.84%> (+3.75%) ⬆️
src/main/host/syscall/handler/random.rs 50.00% <50.00%> (-2.39%) ⬇️
src/main/host/syscall/handler/unistd.rs 66.00% <55.26%> (-5.19%) ⬇️
src/main/host/descriptor/descriptor_table.rs 70.83% <57.14%> (-8.00%) ⬇️
src/main/host/syscall/handler/fcntl.rs 50.00% <60.00%> (-13.64%) ⬇️
... and 44 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sporksmith sporksmith force-pushed the owning-process branch 3 times, most recently from 9b280f7 to 91d6d7c Compare December 15, 2022 05:07
At this step, compiles but crashes at runtime due to recursive mut
borrows of Process.
To avoid recursive borrow problems, we'll for now need to *not* have a
mutable borrow of Process for the whole duration of syscalls, since
legacy C code needs to try to borrow again.

For that to work, we need to make Process's mut methods be non-mut,
which means we need interior mutability.

To implement interior mutability we need to move corresponding objects
into the Rust Process.
Having a mix of calling DescriptorTable methods through Process and
borrowing the whole DescriptorTable led to borrow conflicts.
@sporksmith sporksmith enabled auto-merge December 20, 2022 15:49
@sporksmith sporksmith merged commit e150143 into shadow:main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants