question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation fault crash from the Editor

See original GitHub issue

Description

What steps will reproduce the problem?

Head of C stack:

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff80434300e __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff8043791ff pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff8042872c8 raise + 26
3   libsystem_platform.dylib      	    0x7ff80438edfd _sigtramp + 29
4   ???                           	  0x5300440068004d ???
5   QtGui.so                      	       0x1060ac96b meth_QTextBlock_firstLineNumber(_object*, _object*) + 75
6   Python                        	       0x1038e2d7b cfunction_call + 90
7   Python                        	       0x103897688 _PyObject_MakeTpCall + 127
8   Python                        	       0x10398e528 call_function + 279
9   Python                        	       0x103987d1c _PyEval_EvalFrameDefault + 28216
10  Python                        	       0x10389807d _PyFunction_Vectorcall + 192
11  Python                        	       0x10389acb4 method_vectorcall + 365
12  sip.cpython-39-darwin.so      	       0x105826a07 sip_api_call_procedure_method + 199
13  QtWidgets.so                  	       0x1087833d7 sipQWidget::paintEvent(QPaintEvent*) + 103
14  QtWidgets                     	       0x108bda548 QWidget::event(QEvent*) + 1096

Hapened when coming back to spyder after modyfying a file outside of it that was opened inside spyder

Traceback

Fatal Python error: Segmentation fault

Thread 0x0000700012d52000 (most recent call first):
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 316 in wait
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 574 in wait
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/channels.py", line 134 in _async_run
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py", line 256 in __step
  File "/usr/local/lib/python3.9/site-packages/nest_asyncio.py", line 183 in step
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py", line 80 in _run
  File "/usr/local/lib/python3.9/site-packages/nest_asyncio.py", line 111 in _run_once
  File "/usr/local/lib/python3.9/site-packages/nest_asyncio.py", line 75 in run_until_complete
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/channels.py", line 112 in run
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x0000700011d4f000 (most recent call first):
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/selectors.py", line 562 in select
  File "/usr/local/lib/python3.9/site-packages/nest_asyncio.py", line 98 in _run_once
  File "/usr/local/lib/python3.9/site-packages/nest_asyncio.py", line 64 in run_forever
  File "/usr/local/lib/python3.9/site-packages/tornado/platform/asyncio.py", line 199 in start
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/threaded.py", line 220 in run
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x0000700010d4c000 (most recent call first):
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 312 in wait
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 574 in wait
  File "/usr/local/lib/python3.9/site-packages/IPython/core/history.py", line 829 in run
  File "/usr/local/lib/python3.9/site-packages/IPython/core/history.py", line 58 in needs_sqlite
  File "/usr/local/lib/python3.9/site-packages/decorator.py", line 232 in fun
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 930 in _bootstrap

Current thread 0x000000010b892600 (most recent call first):
  File "/Users/quentinpeter/pyscripts/spyder/spyder/plugins/editor/panels/scrollflag.py", line 248 in paintEvent
  File "/Users/quentinpeter/pyscripts/spyder/spyder/app/utils.py", line 333 in create_window
  File "/Users/quentinpeter/pyscripts/spyder/spyder/app/mainwindow.py", line 2028 in main
  File "/Users/quentinpeter/pyscripts/spyder/spyder/app/start.py", line 266 in main
  File "/Applications/Spyder.app/Contents/MacOS/Spyder", line 83 in <module>

Versions

  • Spyder version: 6.0.0.dev0 6270a5576 (pip)
  • Python version: 3.9.12 64-bit
  • Qt version: 5.12.10
  • PyQt5 version: 5.12.3
  • Operating System: Darwin 21.4.0

Dependencies

# Mandatory:
applaunchservices >=0.1.7     :  0.3.0 (OK)
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.31.1;<8.0.0       :  7.34.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.4.0 (OK)
keyring >=17.0.0              :  23.5.0 (OK)
nbconvert >=4.0               :  6.5.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0;<3.0           :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.4.1;<1.5.0          :  1.4.1 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.3 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.3.0;<5.4.0      :  5.3.1 (OK)
qtpy >=2.1.0                  :  2.1.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  60.10.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.3.1;<2.4.0 :  3.0.0.dev0 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=22.1.0                  :  23.2.0 (OK)

# Optional:
cython >=0.21                 :  0.29.30 (OK)
matplotlib >=3.0.0            :  3.5.1 (OK)
numpy >=1.7                   :  1.23.0 (OK)
pandas >=1.1.1                :  1.4.1 (OK)
scipy >=0.17.0                :  1.8.0 (OK)
sympy >=0.7.3                 :  1.10.1 (OK)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
impact27commented, Jul 15, 2022

To reproduce more easily: Open internal console:

>>> spy.window.editor.new()
>>> editor = spy.window.editor.get_current_editor()
>>> editor.set_text(("\n" * 10 + "d") * 100)
>>> editor.set_text("") # or editor.clear()

(Doesn’t work all the time)

0reactions
impact27commented, Jul 6, 2022

That’s typical with Qt: if an object is removed and the app tries to access it again, then it generates an error or segfault. I think to solve this we should emit a signal when the file is reloaded so that the dict_flag_lists is cleaned after that and we can’t perform the block.isValid() call.

That makes sense

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity Editor Crash - Segmentation Fault near FMOD::Studio
After adding FMOD to our Unity project we've been getting fairly frequent full program crashes due to segmentation faults.
Read more >
[OpenXR] [Windows] Segmentation fault crashes Unity editor ...
The editor tries to recover, but ends up hitting a segmentation fault, and crashes out completely: ``` Got a SIGSEGV while executing native ......
Read more >
Segmentation fault in Symbol editor. - KiCad Source Code
After ending edit of pin 20 the symbol crashes, and takes the rest of KiCad with it. Changed "aaa", "bbb", "ccc". No problem....
Read more >
Joe's own editor / Bugs / #361 Segmentation fault on 4.3
joe 4.3-1 crashes with Segmentation fault(core dumped) on string containing \ and UTF-8 chars (to reproduce, open supplied 'crash.rb' file).
Read more >
Segmentation fault error while running flair - FLUKA forum
Continuing the discussion from Flair crash (seg fault, ... with make THREAD=no worked and the geometry editor is not crashing anymore.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found