Profiler hangs

I have a function, that terminates fine if I run it.

f() # terminates after ~10s

However if I profile it, it does not:

using Profile
@profile f() 

CPU usage goes down to 0% after a few seconds while and the function does not terminate anymore. Also, I cannot interrupt using CTRL+C.

Is this something people have run into before? Any ideas on how to approach this?

Hard to say what’s going wrong without knowing what f() is doing. Slower execution during profiling is expected, but it shouldn’t stall outright.

Do you have a reproducible example you can share?

No, sadly I am far away from having an MWE, just wanted to check if this is a known phenomenon, before deciding to put effort into this.