I'm making a test case, and whenever I call subprocess, I get the following error.
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', 'TestRunner/TestRunner.py', '-r', '1000000']' returned non-zero exit status -11
The thing is, how I'm suppose to extract the actual error message?
I do not get anything from exit status -11.
Are there any temp file which stores the error details?
Thanks.
2 Answers 2
To elaborate on my comment:
Based on the link I provided, it looks like you're running into a segfault because a thread did something it wasn't supposed to. Perhaps it would be helpful to check out this link as well: https://wiki.python.org/moin/CrashingPython
You can also try the highest voted answer in this question. I have little experience debugging segfaults in Python specifically, but that's where I'd start looking.
1 Comment
Try running the command manually:
/usr/bin/python TestRunner/TestRunner.py -r 1000000
If the -11 return is interpreted as "exited with signal 11 (Seg fault)", the shell should print a message saying such.
stderroutput, you can look at that (if you're running without a terminal, you can open a file and passstdout=fileobjand/orstderr=fileobjto send the output the process produced to a file to check (or usePopeninstead ofcheck_callwithstdout=subprocess.PIPEandstderr=subprocess.PIPEand you can call.communicate()on thePopenobject to read it into your Python process). Aside from that, process exit codes are not standardized; it's up to the program run what each code means.