Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Runaway Regex Causing Issues - Timeout? #306

Open
Herkemer opened this issue Dec 31, 2016 · 1 comment
Open

Runaway Regex Causing Issues - Timeout? #306

Herkemer opened this issue Dec 31, 2016 · 1 comment

Comments

@Herkemer
Copy link
Contributor

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?

@dmgm
Copy link

dmgm commented Aug 7, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants