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

signal module doesn't have pause method in Python 2.7 for Windows #49

Open
jimmers opened this issue May 21, 2013 · 8 comments
Open

signal module doesn't have pause method in Python 2.7 for Windows #49

jimmers opened this issue May 21, 2013 · 8 comments

Comments

@jimmers
Copy link

jimmers commented May 21, 2013

Traceback (most recent call last):
File "C:\SE\login.py", line 25, in
sess.fuzz()
File "C:\sulley_build\sulley\sulley\sessions.py", line 540, in fuzz
self.fuzz(self.fuzz_node, path)
File "C:\sulley_build\sulley\sulley\sessions.py", line 553, in fuzz
signal.pause()
AttributeError: 'module' object has no attribute 'pause'

@Fitblip
Copy link
Member

Fitblip commented May 21, 2013

Yeah, this is a known bug, I thought this was fixed a while ago. Are you using sulley from the google code svn or from the master repo here?

@jimmers
Copy link
Author

jimmers commented May 22, 2013

I got code via:

git clone https://github.com/OpenRCE/sulley.git

On each fuzzer run I get an exception about pause method missing since I'm running Sulley on Windows.

@Fitblip
Copy link
Member

Fitblip commented May 23, 2013

That's odd, I've never run into that issue myself...

@litdgfb
Copy link

litdgfb commented Apr 23, 2014

I also meet the problem .on win7 git clone sulley form github.

@acpiper
Copy link

acpiper commented Dec 2, 2014

I've also ran into this problem.
The cause is that the "signal" module on Windows does not implement the "pause()" method:

https://docs.python.org/2/library/signal.html#signal.pause

@juniorprincewang
Copy link

Is there any solution about this issue? My system is win7 64bits.

@jtpereyda
Copy link
Contributor

I made a pull request but what worked for me is to catch the exception and loop instead:

diff --git a/sulley/sessions.py b/sulley/sessions.py
index 64d8c4c..5f0921c 100644
--- a/sulley/sessions.py
+++ b/sulley/sessions.py
@@ -551,8 +551,13 @@ class session (pgraph.graph):
             # if fuzzing is not finished, web interface thread will catch it
             if self.total_mutant_index == self.total_num_mutations:
                 import signal
-                while True:
-                    signal.pause()
+                try:
+                    while True:
+                        signal.pause()
+                except AttributeError:
+                    # signal.pause() is missing for Windows; wait 1ms and loop instead
+                    while True:
+                        time.sleep(1)


     ####################################################################################################################

@bicepjai
Copy link

bicepjai commented Feb 27, 2017

Still having the issue ! @jtpereyda suggestion didnt work out. Is this stackoverflow post considered a fix ?

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

7 participants