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

Fix kernel close and select bug #89

Merged
merged 7 commits into from
Nov 8, 2024
Merged

Fix kernel close and select bug #89

merged 7 commits into from
Nov 8, 2024

Conversation

Yaxuan-w
Copy link
Member

@Yaxuan-w Yaxuan-w commented Nov 7, 2024

Description

Fixes #48

kernel close

The updated fdtable API passing fd entry and count instead of real fd into kernel_close function in RawPOSIX, which will cause the actual requested real fd not being closed. Updated code to fit newest API.

select

The initial error occurred because cases where each fd_set was empty were not handled. In the updated code, uninitialized values are automatically assigned to the corresponding fd_set. Additionally, during in-depth debugging, I found that when processing the return value, the fdtable:: function should receive an nfd associated with the kernel file descriptor (i.e., the maximum kernel file descriptor + 1).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@Yaxuan-w Yaxuan-w added the bug Something isn't working label Nov 7, 2024
@Yaxuan-w Yaxuan-w mentioned this pull request Nov 7, 2024
Copy link
Member

@JustinCappos JustinCappos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs This review box is broken. I can't see if I'm approving, but it should say that I requestchanges.

src/safeposix/syscalls/net_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/net_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/net_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/net_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/net_calls.rs Show resolved Hide resolved
@Yaxuan-w Yaxuan-w merged commit 105c116 into main Nov 8, 2024
1 check failed
@Yaxuan-w Yaxuan-w deleted the fix-kernel-close branch November 8, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix select syscall
4 participants