Exec Address Error in mips_usermode

In exec, I have copied all the input to the user stack(with padding), copied the args pointing to those locations onto the user stack, and even done math(!!) to verify that the stackpointer is at the correct spot when I copyin. However, I am still running into an Address Error in the mips_usermode, and I am not sure why.

This means that when the user program is trying to access it’s arguments, it is probably trying to access an address in kernel space, right?

It could be, a good way to verify this is to dig and make sure these addresses are what you think they are. My partner and I drew out the stack and what all of the expected argument should have been for an example. This made it easy to check in gdb and make sure we were putting things in the right order, and where they should have been.

Doing math is a good start! Do just a little bit more to check that things are in order :slight_smile:

This may seem like a silly question, but even though the user stack grows down, copyout will copy something to an address specified and copy towards the top(0x80000000), right?

Correct, you could check the implementation of copyout if you want some more confidence.

1 Like