vmprof-python icon indicating copy to clipboard operation
vmprof-python copied to clipboard

AssertionError when disabling vmprof

Open plocharz-9livesdata opened this issue 6 years ago • 5 comments

Following assertion is thrown once every 100 or so executions:

>>  File "site-packages/vmprof/__init__.py", line 38, in disable
>>  File "site-packages/vmprof/reader.py", line 294, in read_all
>>AssertionError: (26820, "b'/'")

vmprof is enabled and disabled by http request to flask application.

plocharz-9livesdata avatar Feb 05 '19 10:02 plocharz-9livesdata

Bug was introduced between versions 0.4.3 and 0.4.12

plocharz-9livesdata avatar Feb 11 '19 10:02 plocharz-9livesdata

I have also seen this. Don't have an easy repro but willing to investigate if anyone has ideas

    vmprof.disable()
  File "vmprof/__init__.py", line 38, in disable
    l.read_all()
  File "vmprof/reader.py", line 294, in read_all
    assert not marker, (fileobj.tell(), repr(marker))
AssertionError: (204679, "'y'")

timpalpant avatar Jul 09 '19 16:07 timpalpant

Here's an example where we hit it on Travis in test_line_profiling: https://ci.appveyor.com/project/antocuni/vmprof-python/builds/26541234/job/c2u3veh8ex8v8urv

>               assert not marker, (fileobj.tell(), repr(marker))
529E               AssertionError: (422, "b'\\x00'")

timpalpant avatar Aug 07 '19 19:08 timpalpant

I suspect something in bb40a6873669ed414817f87b4a0cde5d5b90af82, since it introduced a substantially different implementation for writing out the code objects.

timpalpant avatar Aug 07 '19 20:08 timpalpant

is this going any further? the issue is still forcing me to install version 0.4.2 and make dirty workarounds in _vmprof.enable arguments to keep it work with latest PyPy

    vmprof.disable()
  File "/home/lib/pypy3.9/site-packages/vmprof/__init__.py", line 38, in disable
    l.read_all()
  File "/home/lib/pypy3.9/site-packages/vmprof/reader.py", line 294, in read_all
    assert not marker, (fileobj.tell(), repr(marker))
AssertionError: (7459042, "b'\\x00'")

gerasimovalexander avatar Oct 27 '22 07:10 gerasimovalexander