polytracker icon indicating copy to clipboard operation
polytracker copied to clipboard

Never ending recursion when a function entrypoint can not be determined

Open hbrodin opened this issue 4 years ago • 5 comments

Problem is: repr for FunctionEntry call self.function, which raises a new exception which calls repr which calls...

You get a stack trace like this:

File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 677, in function raise ValueError(f"Unable to determine the function entrypoint for {self!r}") File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 687, in repr return f"{self.class.name}({self.uid!r}, {self.function.name!r})" File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 677, in function raise ValueError(f"Unable to determine the function entrypoint for {self!r}") File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 687, in repr return f"{self.class.name}({self.uid!r}, {self.function.name!r})" File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 677, in function raise ValueError(f"Unable to determine the function entrypoint for {self!r}") File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 687, in repr return f"{self.class.name}({self.uid!r}, {self.function.name!r})" File "/usr/local/lib/python3.8/dist-packages/polytracker/tracing.py", line 676, in function

hbrodin avatar Sep 28 '21 11:09 hbrodin

Do you have the input/program that you used? This way I can reproduce the issue

carsonharmon avatar Sep 28 '21 13:09 carsonharmon

I realized this happens if you run the instrumented binary without the POLYTRACE=1 setting. I tried the following program:

from polytracker import PolyTrackerTrace
trace = PolyTrackerTrace.load("temp.db")
for event in trace:
    print(event)

hbrodin avatar Sep 28 '21 16:09 hbrodin

Should we keep this open? I think its still a bug that we should handle, im not sure if this was addressed in any recent PR

carsonharmon avatar Oct 15 '21 15:10 carsonharmon

I will take a quick look to see if I am able to reproduce this in the latest version.

hbrodin avatar Oct 15 '21 15:10 hbrodin

This is still an issue. Keep it open.

hbrodin avatar Oct 15 '21 15:10 hbrodin

OBE since the tracing code was rewritten.

ESultanik avatar Sep 01 '22 14:09 ESultanik