-
Notifications
You must be signed in to change notification settings - Fork 7
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
Execve #38
Comments
What I'm noticing here is that although the fork/exec program is not faulting, and reaches succesful termination. The progress of the
In fact, the progress of the My hypothesis right now is that something is causing Lind to exit before the exec'd cage has a chance to execute, as we see the "Persisting..." and " Terminated" messages in each of these (Which signify Lind exiting). |
The above problem was solved by adding a |
I realized that I characterized another error in today's meeting. I believed for a bit that exec'ing the initial cage causes Lind to boot out of itself, but that's not happening. In fact I had a working exec with a hello program here. I'm almost positive the errors I was getting at that point are the same that I'm getting now with fork/exec'ing an ls program. |
The fork/exec'd
It's a bit hard to tell what is causing this internally because since I don't have an easy way to debug into |
I tracked the line in getopt where it's faulting using the program counter (w/o the base address) and then used addr2line. It led me to a while loop dealing with optind and arguments. My fork/exec/ls test was using ls with the argument This lets us know two things.
Hopefully this is easier to track down now. |
Diving deeper it seems the args are in fact being copied incorrectly. There's a pretty wonky reallocation method and it seems like I think when copying |
The error is definitely from address translation for The best solution I can think of is patching into |
The above is all fixed with the recent PR. All it took was some proper pointer manipulation to do the trick, with no glibc edits necessary. I'm going to keep this open for a little. I don't think environment variables are being passed correctly, but I need to figure out more about how they exist in Lind in general. Running a simple program that prints all the environment variables has the same behavior when ran through lind solo, as well as with a |
I still haven't closed this one, since we haven't inspected ENV variables too deeply. I think this is a good first project for one of the new interns when the wiki/testing stuff is done. |
This is an old issue that I didn't fully close because the Environment variable aspect of execve wasn't fully tested. @mzhang15 It would be good to investigate this with a test case in the suite while you're putting that together. |
I'm actually going to close this and open a new issue specifically on environment variables. |
Execve doesn't seem to work properly, as it does not execute the prompted binary.
Note: Execv here seems to also be broken, as the default environment its being sent is set as NULL, but should be an array of NULL. Should be a quick fix.
The text was updated successfully, but these errors were encountered: