vmprof / vmprof-python

vmprof - a statistical program profiler
https://vmprof.readthedocs.io
Other
433 stars 55 forks source link

Real time fails to emit necessary code objects #202

Closed timpalpant closed 5 years ago

timpalpant commented 5 years ago

Suspect a known issue, since the test is marked xfail: https://github.com/vmprof/vmprof-python/blob/master/vmprof/test/test_run.py#L258-L280. But I didn't see a GitHub issue, so documenting my understanding of the problem here.

One specific case fails: True (insert the background thread for profiling), False (don't remove the main thread).

Looking into the test failure a bit, it appears that the code object from the background thread does not get emitted, giving in the results: '<unknown code>': 1.

Furthermore, if we omit the code object filtering here (just this one line, i.e. emit all code objects) then the test passes. The only thing it seems it could be is if the code object is not getting included in the seen_code_objects. Perhaps the output file needs to be flushed before reading it back in to determine the set of seen addresses?

timpalpant commented 5 years ago

After further investigation, this particular test failure appears to be due to interruption of sleep by the SIGALRM triggered during real_time profiling (#204). Closing this.