nightmare icon indicating copy to clipboard operation
nightmare copied to clipboard

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

Open hacksysteam opened this issue 9 years ago • 8 comments

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 avatar May 24 '16 08:05 hacksysteam

@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 avatar May 24 '16 10:05 hacksysteam

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

hacksysteam avatar Jun 01 '16 07:06 hacksysteam

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

joxeankoret avatar Jun 01 '16 07:06 joxeankoret

@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?

hacksysteam avatar Jun 02 '16 06:06 hacksysteam

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

joxeankoret avatar Jun 02 '16 09:06 joxeankoret

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

hacksysteam avatar Jun 02 '16 09:06 hacksysteam

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

joxeankoret avatar Jun 02 '16 09:06 joxeankoret

@joxeankoret cool. Thanks.

hacksysteam avatar Jun 02 '16 10:06 hacksysteam