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

Silent crash in VSCode arising from _cmap_utils.draw_colormap #261

Closed
gselzer opened this issue Dec 12, 2024 · 1 comment · Fixed by #262
Closed

Silent crash in VSCode arising from _cmap_utils.draw_colormap #261

gselzer opened this issue Dec 12, 2024 · 1 comment · Fixed by #262
Labels
bug Something isn't working

Comments

@gselzer
Copy link
Contributor

gselzer commented Dec 12, 2024

Describe the bug
All of a sudden this morning QColormapComboBox is crashing on me. It's silent if I just run e.g. examples/colormap_combo_box.py, but it's much uglier downstream e.g. in ndv. I have no idea what caused this to begin.

Using the hard crash I pasted below, I found that adding painter.end() to the end of _cmap_utils.draw_colormap resolved my issue. I'm a bit confused on why this is necessary though, as the docs say that this method doesn't normally need to be called?

To Reproduce
Steps to reproduce the behavior:

  1. debug examples/colormap_combo_box.py within VSCode.
  2. observe crash

Expected behavior
You know...not crashing.

Screenshots
Soft crash coming out of examples/colormap_combo_box.py:

Code_KUm0VwTUAs

Hard crash coming out of ndv:

WARNING: QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
WARNING:vispy:QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
Windows fatal exception: access violation

Thread 0x00004b90 (most recent call first):
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 338 in wait
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 634 in wait
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydevd.py", line 325 in _on_run
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py", line 53 in run
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1052 in _bootstrap_inner
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1009 in _bootstrap

Thread 0x00005b90 (most recent call first):
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 338 in wait
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 634 in wait
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydevd.py", line 279 in _on_run
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py", line 53 in run
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1052 in _bootstrap_inner
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1009 in _bootstrap

Thread 0x00003038 (most recent call first):
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 227 in _read_line
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 245 in _on_run
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py", line 53 in run
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1052 in _bootstrap_inner
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1009 in _bootstrap

Thread 0x000070ac (most recent call first):
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 338 in wait
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\queue.py", line 180 in get
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 390 in _on_run
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py", line 53 in run
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1052 in _bootstrap_inner
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\threading.py", line 1009 in _bootstrap

Current thread 0x00004ed8 (most recent call first):
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\site-packages\superqt\cmap\_cmap_utils.py", line 121 in draw_colormap
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\site-packages\superqt\cmap\_cmap_line_edit.py", line 130 in paintEvent
  File "C:\Users\gjselzer\code\pyapp-kit\ndv\src\ndv\views\_app.py", line 189 in run_app
  File "C:\Users\gjselzer\code\pyapp-kit\ndv/mvc.py", line 27 in <module>
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 118 in _run_code
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 127 in _run_module_code
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 310 in run_path
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 351 in run_file
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 501 in main
  File "c:\Users\gjselzer\.vscode\extensions\ms-python.debugpy-2024.14.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 71 in <module>
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\runpy.py", line 88 in _run_code
  File "c:\Users\gjselzer\micromamba\envs\ndv\Lib\runpy.py", line 198 in _run_module_as_main

Desktop (please complete the following information):

  • OS with version [e.g macOS 10.15.7] Windows 11 Pro 10.0.22631
  • Qt Backend [e.g PyQt5, PySide2] PyQt5
  • Python version 3.12.0
@gselzer gselzer added the bug Something isn't working label Dec 12, 2024
@tlambert03
Copy link
Member

btw: was just able to reproduce this on the current superqt release ... but wanted to note that it requires that debugpy be running. which is an interesting detail :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants