Python error codes
I have a python script which uses subprocess.Popen to run multiple instances of another python script, each operating on a different file.
I have a collection of 300 files which I run through this process for testing purposes. every run, a random number of files fails, always different files, so there is nothing wrong with the files themselves, but the subprocess exits with either error code -6 or -11 when it happens. and if I run the script again with the same input files it runs successfully.
What are -6 and -11? can they be correlated to python exceptions?
Edit To Clarify: The scripts are actually django management commands. I have a large try: except clause which catches any exceptions and calls sys.exit(1), so failure is happening outside of my code. possibly in loading other modules. i've checked the django source code and it seems to always call sys.exit(1) in the event of any errors too, so the -6 and -11 appear开发者_运维百科 to be coming from a lower level. i'm thinking they may be oserrors related to race conditions, but I can't be sure about that.
Are you getting the exit status from mysubproc.returncode?
From http://docs.python.org/library/subprocess.html#subprocess.Popen.returncode:
A negative value -N indicates that the child was terminated by signal N (Unix only).
Signals 6 & 11 are SIGABRT (abort) and SIGSEGV (segfault) ( http://linux.die.net/man/7/signal ). My guess is that those other scripts are running into badness with an extension or one of the libraries that an extension depends on. You may have a bad build then - either recompile if you did so manually or see if there's an updated package.
精彩评论