Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text string that causes validators.domain to lock at 100% CPU usage #86

Closed
CrimsonGlory opened this issue Jun 6, 2018 · 1 comment
Closed

Comments

@CrimsonGlory
Copy link

The following string makes validators 0.12.2 get lock at 100% CPU forever.

crazy_string='p.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.'

Logs:

root@db8fc13972fc:/myapp# pip list | grep validators
validators         0.12.2     
root@db8fc13972fc:/myapp# python --version
Python 2.7.15
root@db8fc13972fc:/myapp# python
Python 2.7.15 (default, May  5 2018, 03:27:20) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import validators
>>> crazy_string='p.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.'
>>> validators.domain(crazy_string)

(The validators.domain(crazy_string) never ends. If I go to htop, the python process is at 100% CPU)

With version 0.12.1 this doesn't happen.

Logs:

root@db8fc13972fc:/myapp# pip list | grep validators
validators         0.12.1     
root@db8fc13972fc:/myapp# python
Python 2.7.15 (default, May  5 2018, 03:27:20) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import validators
>>> crazy_string='p.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.'
>>> validators.domain(crazy_string)
ValidationFailure(func=domain, args={'value': 'p.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.wo.'})

The environment for tests was python:2.7-stretch Docker image from 2 days ago.

Temporary fix:
uninstall 0.12.2 and install 0.12.1

@CrimsonGlory
Copy link
Author

This was fixed in version 0.12.6

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

No branches or pull requests

1 participant