Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
906 stars 99 forks source link

Irony crashing on any operation with latest Visual Studio update #454

Open sonictk opened 6 years ago

sonictk commented 6 years ago

Updated to latest Visual Studio 2017 15,5.1 on Win 10. After it updated, irony-mode crashes on any operation.

Following stack is generated when activing toggle-debug-on-error:

Debugger entered--Lisp error: (irony-iotask-aborted "process stopped running" "exited abnormally with code 5")
  signal(irony-iotask-aborted ("process stopped running" "exited abnormally with code 5"))
  (cond ((memql (progn (or (and (vectorp result) (>= (length result) 5) (memq (aref result 0) cl-struct-irony-iotask-result-tags)) (error "%s accessing a non-%s" (quote irony-iotask-result--tag) (quote irony-iotask-result))) (aref result 1)) (quote (quote value))) (progn (or (and (vectorp result) (>= (length result) 5) (memq (aref result 0) cl-struct-irony-iotask-result-tags)) (error "%s accessing a non-%s" (quote irony-iotask-result--value) (quote irony-iotask-result))) (aref result 2))) ((memql (progn (or (and (vectorp result) (>= (length result) 5) (memq (aref result 0) cl-struct-irony-iotask-result-tags)) (error "%s accessing a non-%s" (quote irony-iotask-result--tag) (quote irony-iotask-result))) (aref result 1)) (quote (quote error))) (signal (progn (or (and (vectorp result) (>= (length result) 5) (memq (aref result 0) cl-struct-irony-iotask-result-tags)) (error "%s accessing a non-%s" (quote irony-iotask-result--error) (quote irony-iotask-result))) (aref result 3)) (progn (or (and (vectorp result) (>= (length result) 5) (memq (aref result 0) cl-struct-irony-iotask-result-tags)) (error "%s accessing a non-%s" (quote irony-iotask-result--error-data) (quote irony-iotask-result))) (aref result 4)))) (t (signal (quote irony-iotask-result-get-error) (list result))))
  irony-iotask-result-get([cl-struct-irony-iotask-result error nil irony-iotask-aborted ("process stopped running" "exited abnormally with code 5")])
  (irony-completion--filter-candidates (irony-iotask-result-get candidates-result))
  (funcall callback (irony-completion--filter-candidates (irony-iotask-result-get candidates-result)))
  (closure ((it 266 . 281) (style) (prefix) (callback closure ((matches-available) (async-flag . t) (callback-thing "postConstructor" 266 281) (props) (has-props) (thing nil "postConstructor" 266 281) (in-string) (only-use-cached) t) (candidates) (irony-eldoc--callback callback-thing candidates (function (lambda nil (if async-flag (eldoc-print-current-symbol-info) (setq matches-available t)))))) t) (candidates-result) (funcall callback (irony-completion--filter-candidates (irony-iotask-result-get candidates-result))))([cl-struct-irony-iotask-result error nil irony-iotask-aborted ("process stopped running" "exited abnormally with code 5")])
  funcall((closure ((it 266 . 281) (style) (prefix) (callback closure ((matches-available) (async-flag . t) (callback-thing "postConstructor" 266 281) (props) (has-props) (thing nil "postConstructor" 266 281) (in-string) (only-use-cached) t) (candidates) (irony-eldoc--callback callback-thing candidates (function (lambda nil (if async-flag (eldoc-print-current-symbol-info) (setq matches-available t)))))) t) (candidates-result) (funcall callback (irony-completion--filter-candidates (irony-iotask-result-get candidates-result)))) [cl-struct-irony-iotask-result error nil irony-iotask-aborted ("process stopped running" "exited abnormally with code 5")])
  (save-current-buffer (set-buffer cb-buffer) (funcall (progn (or (and (vectorp ectx) (>= (length ectx) 5) (memq (aref ectx 0) cl-struct-irony-iotask-ectx-tags)) (error "%s accessing a non-%s" (quote irony-iotask-ectx-callback) (quote irony-iotask-ectx))) (aref ectx 3)) result))
  (condition-case err (save-current-buffer (set-buffer cb-buffer) (funcall (progn (or (and (vectorp ectx) (>= (length ectx) 5) (memq (aref ectx 0) cl-struct-irony-iotask-ectx-tags)) (error "%s accessing a non-%s" (quote irony-iotask-ectx-callback) (quote irony-iotask-ectx))) (aref ectx 3)) result)) ((debug error) (message "Irony I/O task: error in callback: %S" err) nil))
  (progn (condition-case err (save-current-buffer (set-buffer cb-buffer) (funcall (progn (or (and (vectorp ectx) (>= ... 5) (memq ... cl-struct-irony-iotask-ectx-tags)) (error "%s accessing a non-%s" (quote irony-iotask-ectx-callback) (quote irony-iotask-ectx))) (aref ectx 3)) result)) ((debug error) (message "Irony I/O task: error in callback: %S" err) nil)))
  (if (buffer-live-p cb-buffer) (progn (condition-case err (save-current-buffer (set-buffer cb-buffer) (funcall (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (aref ectx 3)) result)) ((debug error) (message "Irony I/O task: error in callback: %S" err) nil))))
  (let ((cb-buffer (progn (or (and (vectorp ectx) (>= (length ectx) 5) (memq (aref ectx 0) cl-struct-irony-iotask-ectx-tags)) (error "%s accessing a non-%s" (quote irony-iotask-ectx-schedule-buffer) (quote irony-iotask-ectx))) (aref ectx 4)))) (if (buffer-live-p cb-buffer) (progn (condition-case err (save-current-buffer (set-buffer cb-buffer) (funcall (progn (or ... ...) (aref ectx 3)) result)) ((debug error) (message "Irony I/O task: error in callback: %S" err) nil)))))
  irony-iotask-ectx-call-callback([cl-struct-irony-iotask-ectx t [cl-struct-irony-iotask-packaged-task (:start (lambda (process buffer buf-state) (let ((elem (assq buffer ...)) temp-file) (if (eq (cdr elem) buf-state) (irony-iotask-set-result t) (setq temp-file (make-temp-file "irony-unsaved-")) (irony-iotask-put :temp-file temp-file) (irony-iotask-put :buffer-state buf-state) (process-put process :buffer-state buf-state) (with-current-buffer buffer (irony--without-narrowing ...) (irony--server-send-command "set-unsaved" ... temp-file))))) :update irony--server-command-update :finish (lambda (&rest _args) (delete-file (irony-iotask-get :temp-file))) :on-success (lambda (process buffer &rest _args) (let* ((unsaved-buffers (process-get process :unsaved-buffers)) (elem (assq buffer unsaved-buffers)) (buf-state (irony-iotask-get :buffer-state))) (if elem (setcdr elem buf-state) (process-put process :unsaved-buffers (cons ... unsaved-buffers)))))) (#<process Irony> #<buffer  *Code-Fontify*> [cl-struct-irony--buffer-state nil nil t 15]) [cl-struct-irony-iotask-result nil nil nil nil] (:temp-file "c:/Users/sonictk/AppData/Local/Temp/irony-unsaved-3916Vjk" :buffer-state [cl-struct-irony--buffer-state nil nil t 15]) [cl-struct-irony-iotask-packaged-task (:start (lambda (file line column compile-options) (apply (function irony--server-send-command) "complete" file line column "--" compile-options)) :update irony--server-command-update) ("c:/Users/sonictk/Git/experiments/maya_hot_reload_example/src/deformer.cpp" 15 29 ("-x" "c++" "-working-directory" "c:/Users/sonictk/Git/experiments/maya_hot_reload_example/" "-std=c++14" "-Wall" "-Wextra" "-pthread" "-Wno-pragma-once-outside-header" "-Ithirdparty" "-Isrc" "-Ic:\\\\Users\\\\sonictk\\\\Git\\\\maya\\\\thirdparty\\\\Maya-devkit\\\\win\\\\include\\\\" "-Ic:\\\\Users\\\\sonictk\\\\Git\\\\maya\\\\thirdparty\\\\Maya-devkit\\\\win\\\\include\\\\qt-4.8.6-include")) [cl-struct-irony-iotask-result nil nil nil nil] nil [cl-struct-irony-iotask-packaged-task (:start (lambda (prefix style) (irony--server-send-command "candidates" prefix (cl-case style ... ... ...))) :update irony--server-query-update) (nil nil) [cl-struct-irony-iotask-result nil nil nil nil] nil nil]]] (closure ((it 266 . 281) (style) (prefix) (callback closure ((matches-available) (async-flag . t) (callback-thing "postConstructor" 266 281) (props) (has-props) (thing nil "postConstructor" 266 281) (in-string) (only-use-cached) t) (candidates) (irony-eldoc--callback callback-thing candidates (function (lambda nil (if async-flag ... ...))))) t) (candidates-result) (funcall callback (irony-completion--filter-candidates (irony-iotask-result-get candidates-result)))) #<buffer deformer.cpp>] [cl-struct-irony-iotask-result error nil irony-iotask-aborted ("process stopped running" "exited abnormally with code 5")])
  (while (setq ectx (car-safe (let* ((v process)) (prog1 (process-get v :ectx-q) (process-put v :ectx-q (cdr (process-get v :ectx-q))))))) (irony-iotask-ectx-call-callback ectx result))
  (let ((result (progn (vector (quote cl-struct-irony-iotask-result) nil nil nil nil))) ectx) (apply (function irony-iotask-result-set-error) result (quote irony-iotask-aborted) reasons) (while (setq ectx (car-safe (let* ((v process)) (prog1 (process-get v :ectx-q) (process-put v :ectx-q (cdr ...)))))) (irony-iotask-ectx-call-callback ectx result)))
  irony-iotask--abort-all(#<process Irony> "process stopped running" "exited abnormally with code 5")
  (if (process-live-p process) nil (irony-iotask--abort-all process "process stopped running" event) (message "%s process stopped!" (process-name process)))
  irony-iotask-process-sentinel(#<process Irony> "exited abnormally with code 5\n")

I tried grepping for the %s accessing a non-%s" string, but I couldn't find it anywhere in the irony sources.

If I try to recompile irony-server, same issue persists, even if I downgrade and compile with VS 2015 again instead. When debugging, I see the following stack:

    ucrtbase.dll!abort()   Unknown Non-user code. Symbols loaded.
    ucrtbase.dll!common_assert_to_stderr<wchar_t>() Unknown Non-user code. Symbols loaded.
>   ucrtbase.dll!_wassert()    Unknown Non-user code. Symbols loaded.
    libclang.dll!00007fffa8e957c1() Unknown No symbols loaded.
    libclang.dll!00007fffa8eb26f5() Unknown No symbols loaded.
    libclang.dll!00007fffa8eaf2d7() Unknown No symbols loaded.
    libclang.dll!00007fffa8ecf199() Unknown No symbols loaded.
    libclang.dll!00007fffa6fbb74a() Unknown No symbols loaded.
    libclang.dll!00007fffa6fbd51c() Unknown No symbols loaded.
    libclang.dll!00007fffa8d54822() Unknown No symbols loaded.
    libclang.dll!00007fffa6f887ad() Unknown No symbols loaded.
    libclang.dll!00007fffa6fb8e3b() Unknown No symbols loaded.
    libclang.dll!00007fffa6f58fd5() Unknown No symbols loaded.
    libclang.dll!00007fffa6f5c073() Unknown No symbols loaded.
    libclang.dll!00007fffa6c8cc82() Unknown No symbols loaded.
    libclang.dll!00007fffa877275c() Unknown No symbols loaded.
    libclang.dll!clang_executeOnThread() + 141 bytes    Unknown No symbols loaded.
    ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void * __ptr64)>()    Unknown Non-user code. Symbols loaded.
    kernel32.dll!BaseThreadInitThunk() + 20 bytes   Unknown Non-user code. Loading disabled by Include/Exclude setting.
    ntdll.dll!RtlUserThreadStart() + 33 bytes   Unknown Non-user code. Loading disabled by Include/Exclude setting.

I'm not good enough in assembly to know how to read what's going on, unfortunately.

Environment details: irony-server version 1.2.0 (currently checked out at a571167; I tried checking out latest HEAD as well (which just had a small fix to irony-iotask.el but it made no difference) clang version 6.0.0 (trunk) (installed from clang win64 installer, clang itself seems to be working fine when I use it for compiling test programs)

Is there any advice you could offer on trying to figure out what the issue might be?

WORKAROUND: I have reverted to Visual Studio 2017 15.4.5 for now, which resolves the issue. This should probably be looked at for a long-term issue, though.