When running bigexec test, all the 9 tests passes except for test 10 which hangs the kernel with the following assertion :
Assertion failed: (vaddr_t)tf > (vaddr_t)curthread->t_stack, at …/…/arch/mips/locore/trap.c:149
After debugging my sys_execv implementation I found out that copying in the argv from the userspace to the kernel space succeeds with no problem and the exception occurs when trying to copy the argv back to the new user address space. Moreover, I looked at the stack pointer and it has a value of 0x800000 which seems like a invalid pointer.
My approach is to copy all the argv into one big string created wth malloc with a size of ARG_MAX and each two arguments are separated by a null terminator. Then copy this whole string to the new stack pointer and then copy their addresses to the stack pointer.
Can you please give some hints on what might be going wrong here