-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
after vfork and closing zipos file, __isfdkind is incorrect #978
Comments
@jart what should happen here? Is it safe to lock |
(No, that probably won't work as such. I'll think about it some more.) |
I would imagine that it is safe to lock a mutex after vfork, provided you unlock it before calling execve(). |
Ok, took a bit to look at this. Looks like the problem is straightforward. The comment says that it wants to avoid locking so So one proposal is: if Unfortunately, this does not work: master...0bc5e63 dies with I also don't know that much about |
The only thing |
Speaking of which, I've just realized another issue we need to solve. The |
This is no longer a blocker for the fexecve work. I read about |
I changed the code to not call |
Calling something like |
Actually, I just checked, and my commit does not do anything. It looks like it is the case that I wonder if |
Yeah I see it now. The test in the original comment is definitely wrong. It doesn't make sense to white-box test TEST(zipos, close_after_vfork) {
ASSERT_SYS(0, 3, open("/zip/life.elf", O_RDONLY));
SPAWN(vfork);
ASSERT_SYS(0, 0, close(3));
ASSERT_SYS(0, 3, open("/etc/hosts", O_RDONLY));
ASSERT_SYS(0, 0, close(3));
ASSERT_SYS(EBADF, -1, close(3));
EXITS(0);
ASSERT_SYS(0, 0, close(3));
ASSERT_SYS(EBADF, -1, close(3));
} That test would much more closely conform to cosmo's best practices for system call testing. |
Agreed! The original test was an example of an issue with a change to the internal api. There's no guarantees or necessarily need for the internal api to maintain a behavior so it didn't really demonstrate a bug. |
I made a test:
Fails on
EXPECT_EQ(0, __isfdkind(fd, kFdZip));
@mrdomino could you please take a look? I'm trying to revive #888 and maintain vfork compat if possible.
The text was updated successfully, but these errors were encountered: