1

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.

asked Oct 26, 2015 at 20:48
8
  • 2
    Have you seen this? stackoverflow.com/questions/3630389/python-error-codes Commented Oct 26, 2015 at 20:53
  • Did you mean exit status -1? Commented Oct 26, 2015 at 20:53
  • Its exit status -11 not -1 Commented Oct 26, 2015 at 20:54
  • The error details (if any) are specific to the process that was run. If the process produced stderr output, you can look at that (if you're running without a terminal, you can open a file and pass stdout=fileobj and/or stderr=fileobj to send the output the process produced to a file to check (or use Popen instead of check_call with stdout=subprocess.PIPE and stderr=subprocess.PIPE and you can call .communicate() on the Popen object 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. Commented Oct 26, 2015 at 20:54
  • 1
    Or ignore me and look at what @McGlothlin linked; forgot about the "negative status means killed by signal" rule. Commented Oct 26, 2015 at 20:58

2 Answers 2

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.

answered Oct 26, 2015 at 21:05
Sign up to request clarification or add additional context in comments.

1 Comment

I'll take your answer for now! Thanks.
2

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.

answered Oct 26, 2015 at 20:59

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.