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

AttributeError: type object 'SyncManager' has no attribute 'from_address' (bcf.py) #40

Open
hacksysteam opened this issue May 24, 2016 · 8 comments

Comments

@hacksysteam
Copy link

hacksysteam commented May 24, 2016

OS: Windows 7 SP1 x86

[Tue May 24 13:34:17 2016 1960:3252] Recording a total of 10 value(s) of coverage...
Traceback (most recent call last):
  File "bcf.py", line 683, in <module>
    main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5])
  File "bcf.py", line 662, in main
    buf = fuzzer.fuzz(input_file, output, max_iterations)
  File "bcf.py", line 613, in fuzz
    self.record_metrics(input_file)
  File "bcf.py", line 260, in record_metrics
    p.start()
  File "C:\Python27\lib\multiprocessing\process.py", line 130, in start
    self._popen = Popen(self)
  File "C:\Python27\lib\multiprocessing\forking.py", line 277, in __init__
    dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File "C:\Python27\lib\multiprocessing\forking.py", line 199, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "C:\Python27\lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Python27\lib\pickle.py", line 331, in save
    self.save_reduce(obj=obj, *rv)
  File "C:\Python27\lib\pickle.py", line 419, in save_reduce
    save(state)
  File "C:\Python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\Python27\lib\pickle.py", line 649, in save_dict
    self._batch_setitems(obj.iteritems())
  File "C:\Python27\lib\pickle.py", line 681, in _batch_setitems
    save(v)
  File "C:\Python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\Python27\lib\multiprocessing\forking.py", line 67, in dispatcher
    self.save_reduce(obj=obj, *rv)
  File "C:\Python27\lib\pickle.py", line 401, in save_reduce
    save(args)
  File "C:\Python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\Python27\lib\pickle.py", line 548, in save_tuple
    save(element)
  File "C:\Python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\Python27\lib\pickle.py", line 725, in save_inst
    save(stuff)
  File "C:\Python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "C:\Python27\lib\pickle.py", line 649, in save_dict
    self._batch_setitems(obj.iteritems())
  File "C:\Python27\lib\pickle.py", line 681, in _batch_setitems
    save(v)
  File "C:\Python27\lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "C:\Python27\lib\multiprocessing\managers.py", line 484, in __reduce__
    return type(self).from_address, \
AttributeError: type object 'SyncManager' has no attribute 'from_address'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 381, in main
    self = load(from_parent)
  File "C:\Python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\Python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Python27\lib\pickle.py", line 880, in load_eof
    raise EOFError
EOFError
@hacksysteam hacksysteam changed the title AttributeError: type object 'SyncManager' has no attribute 'from_address' (bcf.oy) AttributeError: type object 'SyncManager' has no attribute 'from_address' (bcf.py) May 24, 2016
@hacksysteam
Copy link
Author

@joxeankoret I was able to locate the root cause. This is due to this code on

self.mgr = Manager()

https://github.com/joxeankoret/nightmare/blob/master/fuzzers/bcf.py#L47

@hacksysteam
Copy link
Author

@joxeankoret Remove Multiprocessing from this module, instead use threads.

@joxeankoret
Copy link
Owner

Why? Actually, I'm using multiprocessing on purpose. If you can give me a reason?

@hacksysteam
Copy link
Author

@joxeankoret Hmm. What reason? I believe without multiprocessing it can also work. I see that you basically pass a LIST to the subprocess IPC. Any other reasons?

@joxeankoret
Copy link
Owner

The reason is the GIL: with multiprocessing there is no problem with the GIL, with threading, yes.

@hacksysteam
Copy link
Author

Hmm, I see. But it's problematic on Windows.

@joxeankoret
Copy link
Owner

I haven't used BCF in Windows, this is what is happening. I will take a look and port it properly.

@hacksysteam
Copy link
Author

@joxeankoret cool. Thanks.

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

2 participants