New issue
Advanced search Search tips

Issue 762389 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 635196



Sign in to add a comment

git cl upload on windows doesn't work due by presubmit_support.py

Project Member Reported by yosin@chromium.org, Sep 6 2017

Issue description

I got following error with "git cl upload" on Win10.

This is happend after patch[1].

[1] http://crrev.com/c/651764 Capture ctrl-c in presubmit multiprocessing pool


Running presubmit upload checks ...
Traceback (most recent call last):
  File "c:\src\depot_tools\\git_cl.py", line 6112, in <module>
    sys.exit(main(sys.argv[1:]))
  File "c:\src\depot_tools\\git_cl.py", line 6094, in main
    return dispatcher.execute(OptionParser(), argv)
  File "c:\src\depot_tools\subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "c:\src\depot_tools\\git_cl.py", line 4943, in CMDupload
    return cl.CMDUpload(options, args, orig_args)
  File "c:\src\depot_tools\\git_cl.py", line 1641, in CMDUpload
    change=change)
  File "c:\src\depot_tools\\git_cl.py", line 1573, in RunHook
    gerrit_obj=self._codereview_impl.GetGerritObjForPresubmit())
  File "c:\src\depot_tools\presubmit_support.py", line 1368, in DoPresubmitChecks
    results += executer.ExecPresubmitScript(presubmit_script, filename)
  File "c:\src\depot_tools\presubmit_support.py", line 1262, in ExecPresubmitScript
    gerrit_obj=self.gerrit, dry_run=self.dry_run)
  File "c:\src\depot_tools\presubmit_support.py", line 451, in __init__
    self.cpu_count, _capture_interrupt)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\__init__.py", line 232, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\pool.py", line 159, in __init__
    self._repopulate_pool()
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\pool.py", line 222, in _repopulate_pool
    w.start()
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\process.py", line 130, in start
    self._popen = Popen(self)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\forking.py", line 277, in __init__
    dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\forking.py", line 199, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 224, in dump
    self.save(obj)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 331, in save
    self.save_reduce(obj=obj, *rv)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 419, in save_reduce
    save(state)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 649, in save_dict
    self._batch_setitems(obj.iteritems())
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 681, in _batch_setitems
    save(v)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 562, in save_tuple
    save(element)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 748, in save_global
    (obj, module, name))
pickle.PicklingError: Can't pickle <function _capture_interrupt at 0x0312DA70>: it's not found as presubmit_support._capture_interrupt

C:\src\w\cr2\src>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\multiprocessing\forking.py", line 381, in main
    self = load(from_parent)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "c:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\pickle.py", line 880, in load_eof
    raise EOFError
EOFError

 
Status: Started (was: Assigned)
Thanks for the heads-up; I didn't foresee that. Does applying this patch fix the issue? https://chromium-review.googlesource.com/653305
That patch doesn't work. Loads of "invalid signal value" errors on the 

 signal.signal(CTRL_C, lambda x, y: sys.exit(1))

line. Is CTRL_C_EVENT the right value (0) for Windows?
According to the signal documentation: https://docs.python.org/2/library/signal.html

signal.CTRL_C_EVENT can only be used with os.kill(). Shouldn't it just use SIGINT like all the other platforms? That should still be Ctrl+C.

I removed the if sys.platform == 'win32': statement and that patch now seems to work.
Status: Fixed (was: Started)
I'm landing a revert: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/653434

Will track the reland including whatever fixes are necessary in the original bug.
Blocking: 635196
Issue 762356 has been merged into this issue.

Sign in to add a comment