Closed janosh closed 1 year ago
@janosh Sorry yo'ure runing into this issue.
info 16:40:28.731: Interrupt requested
Based on the logs it seems that somehow the kernel is getting interrupted. Can you do me a faviour:
Please could you enable logging as follows:
Jupyter->Logging
verbose
Jupyter
output panel.Can you try the same thing in VS Code insiders with the pre-release version of Jupyter extension & ensure you have the same verbose
logging.
Do provide the logs for that too.
@DonJayamanne Thanks for the quick reply! 👍
Just installed py3.11, started from a fresh environment and tried in there. Same kernel crash.
@janosh
Minimal code to reproduce:
!pip install pymatgen
from pymatgen.entries.computed_entries import ComputedStructureEntry
from pymatgen.entries.compatibility import MaterialsProjectCompatibility
dct = {'@module': 'pymatgen.entries.computed_entries',
'@class': 'ComputedStructureEntry',
'energy': -32.50022431,
'composition': {'S': 2.0, 'Bi': 1.0, 'Li': 6.0},
'correction': 0.0,
'parameters': {'potcar_symbols': ['PAW_PBE S 17Jan2003',
'PAW_PBE Bi 08Apr2002',
'PAW_PBE Li_sv 23Jan2001'],
'is_hubbard': False,
'hubbards': {},
'run_type': 'GGA',
'potcar_spec': [{'hash': None, 'titel': 'PAW_PBE S 17Jan2003'},
{'hash': None, 'titel': 'PAW_PBE Bi 08Apr2002'},
{'hash': None, 'titel': 'PAW_PBE Li_sv 23Jan2001'}]},
'data': {},
'entry_id': 'wbm-step-1-24459',
'structure': {'@module': 'pymatgen.core.structure',
'@class': 'Structure',
'charge': None,
'lattice': {'matrix': [[4.0332905, 0.00019654, 0.00033189],
[0.00019791, 4.09449716, 0.00105079],
[2.01755058, 2.04667974, 9.83595687]],
'a': 4.0332905184,
'b': 4.0944972996,
'c': 10.2472169807,
'alpha': 78.4638510747,
'beta': 78.6397987424,
'gamma': 89.9944373726,
'volume': 162.4224924451},
'sites': [{'species': [{'element': 'S', 'occu': 1}],
'abc': [0.67847964, 0.67665944, 0.64561893],
'xyz': [4.0392082508, 4.0920886875, 6.3512161575],
'label': 'S',
'properties': {}},
{'species': [{'element': 'S', 'occu': 1}],
'abc': [0.32476989, 0.32232743, 0.35455337000000003],
'xyz': [2.0252844611, 2.0454897761, 3.4878181418],
'label': 'S',
'properties': {}},
{'species': [{'element': 'Bi', 'occu': 1}],
'abc': [0.00178017, 0.99953694, 8.554e-05],
'xyz': [0.0075503424, 4.092776585, 0.001892262],
'label': 'Bi',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.60702988, 0.10487906, 0.78886588],
'xyz': [4.0399254186, 2.0441021331, 7.7595624449],
'label': 'Li',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.10382818, 0.60266268, 0.79410993],
'xyz': [2.0210454349, 4.0929097432, 7.811498753],
'label': 'Li',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.39640045, 0.89413866, 0.21137099],
'xyz': [2.0254267916, 4.0937348354, 2.0801070545],
'label': 'Li',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.7519066999999999, 0.24963494, 0.49971919000000004],
'xyz': [4.0409162969, 2.0450424745, 4.9157282642],
'label': 'Li',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.25116892, 0.74921193, 0.5004725999999999],
'xyz': [2.0229142799, 4.0920026152, 4.9234975331],
'label': 'Li',
'properties': {}},
{'species': [{'element': 'Li', 'occu': 1}],
'abc': [0.89971318, 0.39648191, 0.20599457000000002],
'xyz': [4.0444875535, 2.0451757971, 2.026868931],
'label': 'Li',
'properties': {}}]}}
cse = ComputedStructureEntry.from_dict(dct)
MaterialsProjectCompatibility().process_entry(cse)
>>> kernel crashes on this line
Does this only occur when you run the cell 11?
No, I've found many different ways to trigger this crash. No idea what's going on.
Can you replicate this same behaviour with other code, I suspect it has something to do with the code that's getting executed in the notebook.
What do you mean by other code? I'm pretty sure it's the code being executed since the kernel crash is very reproducible.
I'm running arm64 (M1 Pro chip).
Great thanks, I'm on a M1 as well and can repro this same issue, will look into this.
@janosh Thanks for providing all of the information and specially the sample code, that helped a lot.
I can repro the same kernel crash even outside VS Code, i.e. if you run the same code in Jupyter Notebooks the kernel crashes. I have no idea why its crashing, however since it crashes in Juptyer Notebook as well, I'm going to close this issue.
I can repro the same kernel crash even outside VS Code, i.e. if you run the same code in Jupyter Notebooks the kernel crashes.
Should have tried that myself. 🤦
Just to check, do you have any advice how to debug this? Is there some hidden stack trace somewhere?
Just to check, do you have any advice how to debug this? Is there some hidden stack trace somewhere?
I've found that this is very difficult to trace, basically the process just dies before anything can be written to disc. Sorry, but really no idea how to trace this issue.
@DonJayamanne Found the problem over at https://github.com/spglib/spglib/issues/194.
TIL: The crash becomes easy to debug if you enable faulthandler
.
# prefix repro code from above with
import faulthandler
faulthandler.enable()
Running python -Xfaulthandler t.py
now prints stack trace which pointed me at spglib
:
Fatal Python error: Segmentation fault
Thread 0x00000001705db000 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 324 in wait
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 622 in wait
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/tqdm/_monitor.py", line 60 in run
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 995 in _bootstrap
Current thread 0x00000001eae06500 (most recent call first):
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/spglib-2.0.1-py3.11-macosx-10.9-universal2.egg/spglib/spglib.py", line 270 in get_magnetic_symmetry
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/spglib-2.0.1-py3.11-macosx-10.9-universal2.egg/spglib/spglib.py", line 153 in get_symmetry
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/symmetry/analyzer.py", line 219 in _get_symmetry
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/symmetry/analyzer.py", line 240 in get_symmetry_operations
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/symmetry/analyzer.py", line 285 in get_symmetrized_structure
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/analysis/structure_analyzer.py", line 544 in sulfide_type
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/entries/compatibility.py", line 283 in get_correction
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/entries/compatibility.py", line 748 in get_corrections_dict
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/entries/compatibility.py", line 714 in get_adjustments
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/entries/compatibility.py", line 632 in process_entries
File "/Users/janosh/.venv/py311/lib/python3.11/site-packages/pymatgen/entries/compatibility.py", line 590 in process_entry
File "/Users/janosh/dev/matbench-discovery/t.py", line 123 in <module>
oh wow that's a great top, thank a lot for sharing
Applies To
What happened?
I have a code cell I've run successfully in the past that started bringing the whole server down recently. I think it may have started after upgrading some packages in my venv. Tried downgrading those again which didn't help.
VS Code Version
1.72.2
Jupyter Extension Version
2022.9.1202862440
Jupyter logs
Coding Language and Runtime Version
Python 3.10
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local