pynab icon indicating copy to clipboard operation
pynab copied to clipboard

Runaway Regex Causing Issues - Timeout?

Open Herkemer opened this issue 8 years ago • 1 comments

I had the scan process get stuck while processing binaries. If I stopped and restarted it would get stuck in the same spot every time.

I added a whole bunch of debug statements into the code and determined that it was stuck on one particular regular expression. By stuck, I mean several hours stuck before I decided to kill the process.

I added some timeout code around the regex search and it really got things moving again. Considering that a bad regex could cause this issue at any time I think a timeout is a good idea, but the code I have it pretty UNIX specific (using signals and what not), and doesn't support windows.

Is windows support for pynab important to keep? I could work on a solution that solves for both but am unable to test, would someone be able to test on windows?

Anyone have a better solution?

Herkemer avatar Dec 31 '16 16:12 Herkemer

I think I may also have this problem. /usr/bin/python3 /opt/pynab/scan.py update Is using 100% CPU and running for days.

Goes right back to it if I restart pynab.

This is on a linux system so if you have a unix solution that would be great.

dmgm avatar Aug 07 '18 00:08 dmgm