Thanks all ! On Fri, Apr 24, 2015 at 10:48 PM, Henry Hallam <henry@pericynthion.org> wrote:
On Thu, Apr 23, 2015 at 10:56 AM, Avinash Sridharan <avinash.sridharan@gmail.com> wrote:
Are you passing the arguments to execve correctly? Usually the EFAULT error occurs, cause the argument format to execve is not correct and the kernel is unable to interpret the executable that needs to be launched, or the parameters that need to be passed to the new process.
Just an example:
http://www.linuxquestions.org/questions/programming-9/execve-alwayse-produce...
Specifically, both the argv[] and envp[] arrays need to end with a null pointer. Forgetting this often leads to intermittent or situation-dependent strange behavior or crashes, because sometimes that memory happens to contain zeros anyway, and sometimes not.
Henry