Exception when using the profiler
I am running cherrypy 3.2.2 with python 2.6.6 (x86) under Windows 7 (x64).
I am trying to enable profiling globally for my app, using the profiling support in cherrypy.lib.profiler. However, after a few requests, the server stops responding and I start seeing the following in the console:
AssertionError: ('Bad call', ('', 0, 'setprofile'), <frame object at 0x02D25050> , <frame object at 0x02D30FF8>, <frame object at 0x04FC2C18>, <frame object at 0 x04F75E60>)
I am using the following lines to enable profiling:
server_cpapp = cherrypy.Application(HelloWorld(), "/") server_profile_cpapp = cherrypy.lib.profiler.make_app(server_cpapp, 'c:/temp', True) cherrypy.tree.graft(server_profile_cpapp)
This may not be the correct way of enabling profiling globally, however I could not find any clear documentation of how to do so.
Attached is a minimal example able to reproduce the issue. It will take a few hundred requests before the bug kicks in, holding down F5 in firefox usually triggers it within a few seconds.
This bug might be related to Issue 74481 in python, which is reported as closed but still reproducible in python 2.6.6 and 2.7.