Description of problem: In jest, I tried this: import os; os.execl("/bin/bash") and the interpreter crashed instead if displaying an error. Version-Release number of selected component (if applicable): 2.4.1-2 How reproducible: Always Steps to Reproduce: 1. python -c 'import os; os.execl("/bin/bash")' Actual results: segmentation fault Expected results: Either a shell prompt or an error message warning that the second argument is not optional.
This doesn't necessarily seem to be a problem in python's implementation of execl. Try to replace /bin/bash with /bin/ls. It works for me (/bin/bash segfaults for me too). strace -f shows the error being somewhere else, but can't really tell. I tried this: #include <stdio.h> #include <unistd.h> int main() { //char *const args[] = {"/bin/bash", NULL}; char *const args[] = {NULL}; execv(args[0], args); return 0; } This one works fine, even thogh, according to execv(3) the behaviour would be undefined (should vs. must): The execv and execvp functions provide an array of pointers to null-terminated strings that represent the argument list available to the new program. The first argument, by convention, should point to the file name associated with the file being executed. The array of pointers must be terminated by a NULL pointer. Needs more investigation.
I agree. If I run this under strace, it's clear that the exec() succeeds, and that the crash is actually in the shell. I'm okay with closing this as invalid.
+1 ==> NOTABUG