1

Closed

Profiling a Django web app causes unhandled exception in python.exe (1828)

description

Configuration
  • Windows 8.1 with the latest update
  • VS 2013 Ult or Pro with Update2
  • Azure Tools 2.3 + Python 3.4.1 through the install of Azure SDK for Python
  • PTVS build 20616.00
Repro
  • Create a Django web app - go through all the steps including to create the superuser for DB
  • Do a couple of F5, and let the code run, then close the app and stop the debugger
  • Select Analyze->Launch Python Profiling... on the VS menu to start profiling
Actual Result
  • Error message "Python.exe stopped working".
More info.
There was actually an unhandled win32 exception occurred in python.exe. Specifically in VsPyProfX86. Here is the partial call stack. I don't have all the source on the machine so I didn't have pythonapi.cpp the attached debugger was asking for. I do have the repro machines if needed.
VsPyProfX86.dll!VsPyProf::GetClassNameFromSelf(PyObject * self, PyObject * codeObj) Line 271 C++
VsPyProfX86.dll!VsPyProf::GetClassNameFromFrame(PyFrameObject * frameObj, PyObject * codeObj) Line 258  C++
VsPyProfX86.dll!VsPyProf::GetUserToken(PyFrameObject * frameObj, unsigned long & func, unsigned long & module) Line 187 C++
VsPyProfX86.dll!VsPyProfThread::Trace(PyFrameObject * frame, int what, PyObject * arg) Line 542 C++
VsPyProfX86.dll!TraceFunction(PyObject * obj, PyFrameObject * frame, int what, PyObject * arg) Line 26  C++
python34.dll!622c35d8() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for python34.dll]  
python34.dll!622c459e() Unknown
python34.dll!622c4e98() Unknown
python34.dll!6227808e() Unknown
python34.dll!6225ae61() Unknown
python34.dll!6225b365() Unknown
python34.dll!62243ccb() Unknown
python34.dll!62253d82() Unknown
python34.dll!62243ccb() Unknown
python34.dll!6228760c() Unknown
python34.dll!62284994() Unknown
python34.dll!62243ccb() Unknown
python34.dll!622c478f() Unknown
python34.dll!622c4d9d() Unknown
python34.dll!622c6dd9() Unknown
python34.dll!622c7dfd() Unknown
python34.dll!62243ccb() Unknown
python34.dll!62274825() Unknown
python34.dll!622c4d1e() Unknown
python34.dll!622c6dd9() Unknown
python34.dll!622c7dfd() Unknown
python34.dll!6225b20a() Unknown
python34.dll!62274812() Unknown
python34.dll!622c49d6() Unknown
python34.dll!622c6e84() Unknown
[External Code] 
python34.dll!62277ca6() Unknown
python34.dll!62243ccb() Unknown
python34.dll!62244114() Unknown
python34.dll!622d9037() Unknown
python34.dll!622bf793() Unknown
python34.dll!62274825() Unknown
python34.dll!62243ccb() Unknown
python34.dll!622c389b() Unknown
python34.dll!622c6764() Unknown
[External Code] 
python34.dll!6225b20a() Unknown
python34.dll!62274812() Unknown
python34.dll!622c49d6() Unknown
python34.dll!622c6e84() Unknown
[External Code] 
python34.dll!62277ca6() Unknown
python34.dll!62243ccb() Unknown
python34.dll!62244114() Unknown
python34.dll!622d9037() Unknown
python34.dll!622bf793() Unknown
python34.dll!62274825() Unknown
python34.dll!62243ccb() Unknown
python34.dll!622c389b() Unknown
python34.dll!622c6764() Unknown
python34.dll!622c7dfd() Unknown
python34.dll!622c7f64() Unknown
python34.dll!622c03c4() Unknown
python34.dll!62274812() Unknown
python34.dll!622c4d1e() Unknown
python34.dll!622c6dd9() Unknown
python34.dll!622c7ecf() Unknown
python34.dll!622c4d8c() Unknown
python34.dll!622c6dd9() Unknown
python34.dll!622c7dfd() Unknown
python34.dll!622c7f64() Unknown
python34.dll!622f116d() Unknown
python34.dll!622f2145() Unknown
python34.dll!622f2f0a() Unknown
python34.dll!622f37b7() Unknown
python34.dll!621fd945() Unknown
python34.dll!621fe006() Unknown
python.exe!1c5d1184()   Unknown
[External Code] 
Closed Sep 5 at 11:12 PM by jinglou
This was already fixed in RC. Also verified in 20905.03. Fixed. Closing the issue.

comments

jinglou wrote Jun 17 at 8:18 PM

A little more info:

Unhandled exception at 0x520921DE (VsPyProfX86.dll) in python.exe: 0xC0000005: Access violation reading location 0x00000018.

jinglou wrote Jun 17 at 8:39 PM

Minimum repro steps:
  • Create a Django web project including installing the requirements
  • once the requirements are installed, launch Python Profiling
  • Python.exe crashes

jinglou wrote Jun 17 at 9:14 PM

This is not isolated to just Django projects. Occurs to Flask, Bottle as well. From the call stack it looks like it's stemmed from py3.4.1. So it's not framework specific.