pynab
pynab copied to clipboard
Runaway Regex Causing Issues - Timeout?
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?
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.