nvdv / vprof

Visual profiler for Python
BSD 2-Clause "Simplified" License
3.95k stars 154 forks source link

vprof crashes with a stacktrace on scripts with Python 3.6.1 32-bit and Windows #64

Closed pvcraven closed 7 years ago

pvcraven commented 7 years ago
Description

vprof crashes with a stacktrace on scripts with Python 3.6.1 32-bit and Windows

How to reproduce
Actual results
C:\>vprof -c p test.py
Running Profiler...
Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python36-32\Scripts\vprof.exe\__main__.py", line 9, in <module>
  File "c:\program files (x86)\python36-32\lib\site-packages\vprof\__main__.py", line 88, in main
    source, config, verbose=True)
  File "c:\program files (x86)\python36-32\lib\site-packages\vprof\runner.py", line 78, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "c:\program files (x86)\python36-32\lib\site-packages\vprof\base_profiler.py", line 162, in run
    return dispatcher()
  File "c:\program files (x86)\python36-32\lib\site-packages\vprof\base_profiler.py", line 71, in multiprocessing_wrapper
    process.start()
  File "c:\program files (x86)\python36-32\lib\multiprocessing\process.py", line 105, in start
    self._popen = self._Popen(self)
  File "c:\program files (x86)\python36-32\lib\multiprocessing\context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "c:\program files (x86)\python36-32\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "c:\program files (x86)\python36-32\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
    reduction.dump(process_obj, to_child)
  File "c:\program files (x86)\python36-32\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'run_in_another_process.<locals>.multiprocessing_wrapper.<locals>.remote_wrapper'

C:\>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\python36-32\lib\multiprocessing\spawn.py", line 99, in spawn_main
    new_handle = reduction.steal_handle(parent_pid, pipe_handle)
  File "c:\program files (x86)\python36-32\lib\multiprocessing\reduction.py", line 82, in steal_handle
    _winapi.PROCESS_DUP_HANDLE, False, source_pid)
OSError: [WinError 87] The parameter is incorrect
Expected results

Not a stack trace.

Version and platform

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32

nvdv commented 7 years ago

Hi, did you use WSL (Windows Subsystem for Linux)? EDIT: It seems you didn't. Looks like serialization issue.

pvcraven commented 7 years ago

Ok, I will try it. If that works, then I think this report should be changed to add this requirement to the README.md.

pvcraven commented 7 years ago

I tried to. I already had WSL installed. I tried running vprof from bash but there were so many other issues with packages and the fact my program uses OpenGL that I gave up.

Paul Vincent Craven

On Thu, Apr 13, 2017 at 3:19 AM, nvdv notifications@github.com wrote:

Hi, did you use WSL (Windows Subsystem for Linux)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nvdv/vprof/issues/64#issuecomment-293824283, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZTTOEgO6vroOiHcZDUtpg4EJzSDzHRks5rvdqCgaJpZM4M73L9 .

nvdv commented 7 years ago

Thanks. Using WSL is not requirerement, I just wanted to know what environment you use, since WSL is getting popular. I'll try to reproduce this error in Windows 10 VM.

nvdv commented 7 years ago

Can reproduce this one on Windows 10. Looks like function serialization issue.