Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process finished with exit code -1073741571

Tags:

I have a recursion function which is finding Eulerian Path. I do not think that the definition of the function is relevant (but if someone thinks so, I will paste it as well).

The problem is that when I am running the function with a big graph, I receive the following well known error: RuntimeError: maximum recursion depth exceeded in cmp

Even without the above-mentioned question, I know that I need to increase recursion limit with the following commands

import sys sys.setrecursionlimit(5000) 

The problem is that when no matter what number am I using I either get the Maximum recursion error or my program just halts with no output on the screen but: Process finished with exit code -1073741571. I tried to google for this code and the only problem I was able to find was the problem in Ruby. Any idea how I can overcome this problem.

If this is relevant I am on Windows 8 64 bit, I have plenty of RAM and I have 64bit python.

Just because for some reason this question received some attention recently, I want to highlight that I was not able to find solution to the problem. After hopelessly trying to solve the problem I gave up and rewrote it without recursion. Also it was annoying, but I spent much less time rewriting the whole algorithm, than I spent investigating this problem. I also want to mention that I do not have previous recursion code, so I will not be able to replicate the problem.

like image 617
Salvador Dali Avatar asked Dec 17 '13 08:12

Salvador Dali


People also ask

What does it mean process finished with exit code?

exit code (0) means an exit without an errors or any issues, can be a compile time error or any dependency issue. exit code (1) means there was some issue which caused the program to exit.

What is process finished with exit code 1?

Exit Code 1 indicates that a container shut down, either because of an application failure or because the image pointed to an invalid file. In a Unix/Linux operating system, when an application terminates with Exit Code 1, the operating system ends the process using Signal 7, known as SIGHUP.

What is meant by process finished with exit code 0?

It means that there is no error with your code. You have run it right through and there is nothing wrong with it.

What is process finished with exit code 0 in Python?

The function calls exit(0) and exit(1) are used to reveal the status of the termination of a Python program. The call exit(0) indicates successful execution of a program whereas exit(1) indicates some issue/error occurred while executing a program.


2 Answers

That is the signed integer representation of Microsoft's "stack overflow/stack exhaustion" error code 0xC00000FD.

You might try increasing your executable's stack size as described in the answer here: How to overcome Stack Size issue with Visual Studio (running C codes with big array)

Anytime you see strange, large negative exit codes in windows, convert them to hex and then look them up in the ntstatus error codes http://msdn.microsoft.com/en-us/library/cc704588.aspx

You may also use the MS Error Lookup Tool to find such codes locally, or even automatically. Other, similar tools exist both by Microsoft and third parties.

like image 122
reteptilian Avatar answered Oct 15 '22 07:10

reteptilian


You could use something like:

if __name__ == '__main__':     sys.setrecursionlimit(100000)     threading.stack_size(200000000)     thread = threading.Thread(target=your_code)     thread.start() 

This solved both my recursion limitation and my heap size limitation.

like image 43
Juan Pablo VEGA Avatar answered Oct 15 '22 09:10

Juan Pablo VEGA