Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual C++ Runtime Error in Python

I have a python program that runs in a server continuously and it puts some data into MYSQL dataBase and load some. It is also using TCP/IP connection. the problem is that after about 24 hrs it gives a runtime error:

Microsoft Visual C++ Runtime Library!

Runtime Error!

Program: C:\python27\pythonw.exe

This application has requested the Runtime to terminate it in an unusual way.

And I hit OK python shell closes. And when I close all python files and check Windows Task Manager I see still there is a pythonw.exe file open there!!!

I am using IDLE to run my application.

like image 971
Reza Asgharzadeh Avatar asked Dec 07 '12 02:12

Reza Asgharzadeh


People also ask

How do I fix Microsoft Visual C++ 14.0 required error?

To Solve error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools” You just need to Install Microsoft Visual C++ 14.0. First of all just download Visual C++ 2015 Build Tools from given link. And That will install Visual C++ 14.0 without installing Visual Studio.

Why is my Microsoft Visual C++ runtime error?

This error can be caused due to Runtime components of Visual C++ Libraries are missing or due to software problem. I would suggest you to try performing a clean boot and check if you can install. A clean boot helps to verify if any third party application services or startup item is causing this issue.


1 Answers

In my former answer, I tried to introduce about the reason for the reported behavior and how one can debug and determine the root cause. Unfortunately, this requires an extensive debugging knowledge and time to isolate the problem.

Alternatively, Process Monitor can some handy to give a high level understanding of the problem, which as a User would post possibly need.

Tools Required

  1. Process Monitor

Steps to Debug

  1. Run Process Monitor
  2. Add the following filters (Cntrl + F)

    1. Process Name - begins with - python
    2. Operation - begins with - CreateFile

    enter image description here

  3. Now keep running procmon, until your application Crashes
  4. Stop Capture (Cntrl + E)
  5. Search the LOG for a call to WerFault.exe

    enter image description here

  6. Gradually scroll up to see the last called Non Windows DLL which may be related to Python. In the above case, its abort_dll.dll.

  7. Now use your Python library knowledge, or ask across (including SO), to determine, what could be the failing. Even, from the log, you can identify, which Python Module called this DLL by scrolling further up.
like image 184
Abhijit Avatar answered Oct 10 '22 07:10

Abhijit