gotcha / ipdb

Integration of IPython pdb
BSD 3-Clause "New" or "Revised" License
1.85k stars 146 forks source link

weird python crash when ipdb.set_trace() is used #191

Closed curiale closed 4 years ago

curiale commented 4 years ago

After upgrade my miniconda distribution I observed that python or ipython crash when ipdb.set_trace() is used. To reproduce the weird crash just run python -c "import ipdb; ipdb.set_trace()". I'm using macOS catalina. This behavior was not observed using pdb. It seems to be some bug related to ipdb


Here is the error:

$ python -c "import ipdb; ipdb.set_trace()" Warning: disable autoreload in ipython_config.py to improve performance. --Return-- None

(1) ()

ipdb> 2020-03-10 11:36:38.296 python[18734:1006812] WARNING: nextEventMatchingMask should only be called from the Main Thread! This will throw an exception in the future. 2020-03-10 11:36:38.297 python[18734:1006812] Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1674.114/Foundation/Misc.subproj/NSUndoManager.m:363 2020-03-10 11:36:38.298 python[18734:1006812] Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1674.114/Foundation/Misc.subproj/NSUndoManager.m:363 2020-03-10 11:36:38.300 python[18734:1006812] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.' First throw call stack: ( 0 CoreFoundation 0x00007fff366898ab __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff6c943805 objc_exception_throw + 48 2 CoreFoundation 0x00007fff366b2d10 +[NSException raise:format:arguments:] + 88 3 Foundation 0x00007fff38dab241 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191 4 Foundation 0x00007fff38ce9d5e +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 440 5 AppKit 0x00007fff337c216c -[NSApplication run] + 864 6 libffi.6.dylib 0x00000001197c6884 ffi_call_unix64 + 76 7 ??? 0x000070000d6d06f0 0x0 + 123145527559920 ) libc++abi.dylib: terminating with uncaught exception of type NSException [1] 18734 abort python -c "import ipdb; ipdb.set_trace()"


Here is my package list:

$ conda list

Name Version Build Channel

absl-py 0.9.0 py37_0 conda-forge appnope 0.1.0 py37_1000 conda-forge apptools 4.5.0 py_0 conda-forge astor 0.7.1 py_0 conda-forge attrs 19.3.0 py_0 conda-forge autograd 1.3 py_0 conda-forge backcall 0.1.0 py_0 conda-forge bidict 0.19.0 pypi_0 pypi bioread 1.0.4 pypi_0 pypi biosppy 0.6.1 pypi_0 pypi bleach 3.1.1 py_0 conda-forge bzip2 1.0.8 h0b31af3_2 conda-forge c-ares 1.15.0 h01d97ff_1001 conda-forge ca-certificates 2019.11.28 hecc5488_0 conda-forge cairo 1.16.0 he1c11cd_1002 conda-forge certifi 2019.11.28 py37_0 conda-forge cffi 1.14.0 py37h356ff06_0 conda-forge chardet 3.0.4 py37_1003 conda-forge click 7.0 py_0 conda-forge cloudpickle 1.3.0 py_0 conda-forge conda 4.8.2 py37_0 conda-forge conda-package-handling 1.6.0 py37h0b31af3_1 conda-forge configobj 5.0.6 py_0 conda-forge cryptography 2.8 py37hafa8578_1 conda-forge curl 7.68.0 h8754def_0 conda-forge cvxopt 1.2.4 py37hae5b90f_202 conda-forge cycler 0.10.0 py_2 conda-forge cytoolz 0.10.1 py37h0b31af3_0 conda-forge dask-core 2.12.0 py_0 conda-forge dbus 1.13.6 h2f22bb5_0 conda-forge decorator 4.4.2 py_0 conda-forge defusedxml 0.6.0 py_0 conda-forge dsdp 5.8 h7674d01_1203 conda-forge entrypoints 0.3 py37_1000 conda-forge envisage 4.9.2 py_0 conda-forge expat 2.2.9 h4a8c4bd_2 conda-forge ffmpeg 4.1.3 h5c2b479_0 conda-forge fftw 3.3.8 nompi_h44ae4c8_1110 conda-forge flake8 3.7.9 py37_0 conda-forge flask 1.1.1 py_1 conda-forge fontconfig 2.13.1 h6b1039f_1001 conda-forge freetype 2.10.0 h24853df_1 conda-forge future 0.18.2 py37_0 conda-forge gast 0.3.3 py_0 conda-forge gettext 0.19.8.1 h46ab8bc_1002 conda-forge giflib 5.2.1 h0b31af3_2 conda-forge glib 2.58.3 py37h577aef8_1002 conda-forge glpk 4.65 h65ac59c_1002 conda-forge gmp 6.2.0 h4a8c4bd_2 conda-forge gnutls 3.6.5 h53004b3_1002 conda-forge graphite2 1.3.13 h2098e52_1000 conda-forge graphviz 2.42.3 h98dfb87_0 conda-forge grpcio 1.23.0 py37h8a88325_0 conda-forge gsl 2.6 ha2d443c_0 conda-forge h5py 2.10.0 nompi_py37h106b333_102 conda-forge harfbuzz 2.4.0 hd8d2a14_3 conda-forge hdf4 4.2.13 h84186c3_1003 conda-forge hdf5 1.10.5 nompi_h3e39495_1104 conda-forge icu 64.2 h6de7cb9_1 conda-forge idna 2.9 py_1 conda-forge imageio 2.8.0 py_0 conda-forge importlib_metadata 1.5.0 py37_0 conda-forge ipdb 0.12.3 py_0 conda-forge ipykernel 5.1.4 py37h5ca1d4c_0 conda-forge ipython 7.13.0 py37h5ca1d4c_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.5.1 py_0 conda-forge isort 4.3.21 py37_0 conda-forge itk 5.0.1 py37_1 conda-forge itk-core 5.0.1 pypi_0 pypi itk-filtering 5.0.1 pypi_0 pypi itk-numerics 5.0.1 pypi_0 pypi itk-registration 5.0.1 pypi_0 pypi itk-segmentation 5.0.1 pypi_0 pypi itsdangerous 1.1.0 py_0 conda-forge jasper 1.900.1 h636a363_1006 conda-forge jedi 0.16.0 py37_0 conda-forge jinja2 2.11.1 py_0 conda-forge joblib 0.14.1 py_0 conda-forge jpeg 9c h1de35cc_1001 conda-forge json5 0.9.0 py_0 conda-forge jsoncpp 1.8.4 ha1b3eb9_1002 conda-forge jsonschema 3.2.0 py37_0 conda-forge jupyter 1.0.0 py_2 conda-forge jupyter_client 6.0.0 py_0 conda-forge jupyter_console 6.0.0 py_0 conda-forge jupyter_core 4.6.3 py37_0 conda-forge jupyterlab 2.0.1 py_0 conda-forge jupyterlab_server 1.0.7 py_0 conda-forge keras-applications 1.0.8 py_1 conda-forge keras-preprocessing 1.1.0 py_0 conda-forge kiwisolver 1.1.0 py37ha1b3eb9_0 conda-forge krb5 1.16.4 h1752a42_0 conda-forge lame 3.100 h1de35cc_1001 conda-forge libblas 3.8.0 15_openblas conda-forge libcblas 3.8.0 15_openblas conda-forge libclang 9.0.1 default_hf57f61e_0 conda-forge libcurl 7.68.0 h709d2b2_0 conda-forge libcxx 9.0.1 1 conda-forge libedit 3.1.20170329 hcfe32e1_1001 conda-forge libffi 3.2.1 h6de7cb9_1006 conda-forge libgfortran 4.0.0 2 conda-forge libgpuarray 0.7.6 h1de35cc_1003 conda-forge libiconv 1.15 h01d97ff_1005 conda-forge libitk 4.13.2 h48affd4_6 conda-forge liblapack 3.8.0 15_openblas conda-forge liblapacke 3.8.0 15_openblas conda-forge libllvm9 9.0.1 ha1b3eb9_0 conda-forge libnetcdf 4.7.3 nompi_hda4e5f1_101 conda-forge libopenblas 0.3.8 h3d69b6c_0 conda-forge libopencv 4.2.0 py37_2 conda-forge libpng 1.6.37 h2573ce8_0 conda-forge libpq 12.2 h554dc5a_0 conda-forge libprotobuf 3.11.4 hd174df1_0 conda-forge libsodium 1.0.17 h01d97ff_0 conda-forge libssh2 1.8.2 hcdc9a53_2 conda-forge libtiff 4.1.0 ha78913b_3 conda-forge libwebp 1.0.2 hd3bf737_5 conda-forge libxml2 2.9.10 h53d96d6_0 conda-forge llvm-openmp 9.0.1 h28b9765_2 conda-forge lz4-c 1.8.3 h6de7cb9_1001 conda-forge mako 1.1.0 py_0 conda-forge markdown 3.2.1 py_0 conda-forge markupsafe 1.1.1 py37h0b31af3_0 conda-forge matplotlib 3.2.0 1 conda-forge matplotlib-base 3.2.0 py37h11da6c2_1 conda-forge mayavi 4.7.1 py37ha91d4f2_2 conda-forge mccabe 0.6.1 py_1 conda-forge medpy 0.4.0 pypi_0 pypi metis 5.1.0 h4a8c4bd_1005 conda-forge mistune 0.8.4 py37h0b31af3_1000 conda-forge mne 0.19.2 pypi_0 pypi natsort 7.0.1 py_0 conda-forge nbconvert 5.6.1 py37_0 conda-forge nbformat 5.0.4 py_0 conda-forge ncurses 6.1 h0a44026_1002 conda-forge nettle 3.4.1 h3efe00b_1002 conda-forge networkx 2.4 py_0 conda-forge neurokit 0.2.8 pypi_0 pypi nibabel 3.0.2 py_0 conda-forge nolds 0.5.2 pypi_0 pypi notebook 6.0.3 py37_0 conda-forge nspr 4.20 h0a44026_1000 conda-forge nss 3.47 hc0980d9_0 conda-forge numpy 1.18.1 py37hde6bac1_0 conda-forge olefile 0.46 py_0 conda-forge opencv 4.2.0 py37_2 conda-forge openh264 1.8.0 hd9629dc_1000 conda-forge openssl 1.1.1d h0b31af3_0 conda-forge packaging 20.1 py_0 conda-forge pandas 1.0.1 py37h4f17bb1_0 conda-forge pandoc 2.9.2 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.6.2 py_0 conda-forge pcre 8.44 h4a8c4bd_0 conda-forge pep8 1.7.1 py_0 conda-forge pexpect 4.8.0 py37_0 conda-forge pickleshare 0.7.5 py37_1000 conda-forge pillow 7.0.0 py37h918e99a_0 conda-forge pip 20.0.2 py_2 conda-forge pixman 0.38.0 h01d97ff_1003 conda-forge prometheus_client 0.7.1 py_0 conda-forge prompt_toolkit 2.0.10 py_0 conda-forge protobuf 3.11.4 py37h4a8c4bd_0 conda-forge ptyprocess 0.6.0 py_1001 conda-forge py-opencv 4.2.0 py37h5ca1d4c_2 conda-forge pycodestyle 2.5.0 py_0 conda-forge pycosat 0.6.3 py37h0b31af3_1002 conda-forge pycparser 2.20 py_0 conda-forge pydicom 1.4.2 py_0 conda-forge pydot 1.4.1 py37_1001 conda-forge pyface 6.1.2 py_0 conda-forge pyflakes 2.1.1 py_0 conda-forge pygments 2.6.1 py_0 conda-forge pygpu 0.7.6 py37h3b54f70_1000 conda-forge pyopenssl 19.1.0 py_1 conda-forge pyparsing 2.4.6 py_0 conda-forge pyqt 5.12.3 py37he22c54c_1 conda-forge pyqt5-sip 4.19.18 pypi_0 pypi pyqtwebengine 5.12.1 pypi_0 pypi pyrsistent 0.15.7 py37h0b31af3_0 conda-forge pysocks 1.7.1 py37_0 conda-forge python 3.7.6 hfa4aa89_4_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.7 1_cp37m conda-forge pytz 2019.3 py_0 conda-forge pywavelets 1.1.1 py37h3b54f70_0 conda-forge pyzmq 19.0.0 py37h4bf09a9_0 conda-forge qt 5.12.5 h514805e_3 conda-forge qtconsole 4.7.1 py_0 conda-forge qtpy 1.9.0 py_0 conda-forge readline 8.0 hcfe32e1_0 conda-forge requests 2.23.0 py37_0 conda-forge ruamel_yaml 0.15.80 py37h0b31af3_1000 conda-forge scikit-image 0.16.2 py37h4f17bb1_0 conda-forge scikit-learn 0.22.2.post1 py37h3dc85bc_0 conda-forge scipy 1.4.1 py37h82752d6_0 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 46.0.0 py37_0 conda-forge shap 0.34.0 py37h4f17bb1_0 conda-forge shortuuid 0.5.0 pypi_0 pypi simpleitk 1.2.4 py37h4a8c4bd_0 conda-forge six 1.14.0 py37_0 conda-forge sklearn 0.0 pypi_0 pypi sqlite 3.30.1 h93121df_0 conda-forge suitesparse 5.6.0 h0e59142_0 conda-forge tbb 2019.9 ha1b3eb9_1 conda-forge tensorboard 1.13.1 py37_0 conda-forge tensorflow 1.13.1 hfddd6c2_8 conda-forge tensorflow-base 1.13.1 py37_8 conda-forge tensorflow-estimator 1.13.0 py37h24bf2e0_0 conda-forge termcolor 1.1.0 py_2 conda-forge terminado 0.8.3 py37_0 conda-forge testpath 0.4.4 py_0 conda-forge tk 8.6.10 hbbe82c9_0 conda-forge toolz 0.10.0 py_0 conda-forge tornado 6.0.4 py37h0b31af3_0 conda-forge tqdm 4.43.0 py_0 conda-forge traitlets 4.3.3 py37_0 conda-forge traits 6.0.0 py37h0b31af3_0 conda-forge traitsui 6.1.3 py_0 conda-forge urllib3 1.25.7 py37_0 conda-forge vtk 8.2.0 py37hf0265cc_208 conda-forge wcwidth 0.1.8 py_0 conda-forge webencodings 0.5.1 py_1 conda-forge werkzeug 1.0.0 py_0 conda-forge wheel 0.34.2 py_1 conda-forge widgetsnbextension 3.5.1 py37_0 conda-forge x264 1!152.20180806 h1de35cc_0 conda-forge xarray 0.15.0 py_0 conda-forge xlrd 1.2.0 py_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge yaml 0.2.2 h0b31af3_1 conda-forge yapf 0.29.0 py_0 conda-forge zeromq 4.3.2 h6de7cb9_2 conda-forge zipp 3.1.0 py_0 conda-forge zlib 1.2.11 h0b31af3_1006 conda-forge zstd 1.4.4 he7fca8b_1 conda-forge

gotcha commented 4 years ago

Can you try with ipdb==0.13.2 ?

curiale commented 4 years ago

Yes, I installed ipdb=0.13.2 and the results was exactly the same. However, after updating all the packages, the problem gone. So, I'll close the issue. Here is the list of package updated:

The following NEW packages will be INSTALLED:

importlib-metadata conda-forge/osx-64::importlib-metadata-1.5.0-py37hc8dfbb8_1 libwebp-base conda-forge/osx-64::libwebp-base-1.1.0-2 prompt-toolkit conda-forge/noarch::prompt-toolkit-3.0.4-py_0

The following packages will be UPDATED:

absl-py 0.9.0-py37_0 --> 0.9.0-py37hc8dfbb8_1 appnope 0.1.0-py37_1000 --> 0.1.0-py37hc8dfbb8_1001 bleach 3.1.1-py_0 --> 3.1.3-pyh8c360ce_0 chardet 3.0.4-py37_1003 --> 3.0.4-py37hc8dfbb8_1006 click 7.0-py_0 --> 7.1.1-pyh8c360ce_0 conda-package-han~ 1.6.0-py37h0b31af3_1 --> 1.6.0-py37h9bfed18_2 cryptography 2.8-py37hafa8578_1 --> 2.8-py37he655712_2 entrypoints 0.3-py37_1000 --> 0.3-py37hc8dfbb8_1001 flake8 3.7.9-py37_0 --> 3.7.9-py37hc8dfbb8_1 future 0.18.2-py37_0 --> 0.18.2-py37hc8dfbb8_1 glib 2.58.3-py37h577aef8_1002 --> 2.58.3-py37h7c187be_1003 grpcio 1.23.0-py37h8a88325_0 --> 1.23.0-py37hf940fad_1 importlib_metadata conda-forge/osx-64::importlib_metadat~ --> conda-forge/noarch::importlib_metadata-1.5.0-1 ipython 7.13.0-py37h5ca1d4c_0 --> 7.13.0-py37h43977f1_1 isort 4.3.21-py37_0 --> 4.3.21-py37hc8dfbb8_1 jedi 0.16.0-py37_0 --> 0.16.0-py37hc8dfbb8_1 jsonschema 3.2.0-py37_0 --> 3.2.0-py37hc8dfbb8_1 jupyter_console 6.0.0-py_0 --> 6.1.0-py_1 jupyter_core 4.6.3-py37_0 --> 4.6.3-py37hc8dfbb8_1 kiwisolver 1.1.0-py37ha1b3eb9_0 --> 1.1.0-py37ha1cc60f_1 libblas 3.8.0-15_openblas --> 3.8.0-16_openblas libcblas 3.8.0-15_openblas --> 3.8.0-16_openblas liblapack 3.8.0-15_openblas --> 3.8.0-16_openblas liblapacke 3.8.0-15_openblas --> 3.8.0-16_openblas libopenblas 0.3.8-h3d69b6c_0 --> 0.3.9-h3d69b6c_0 libtiff 4.1.0-ha78913b_3 --> 4.1.0-h2ae36a8_5 markupsafe 1.1.1-py37h0b31af3_0 --> 1.1.1-py37h9bfed18_1 networkx 2.4-py_0 --> 2.4-py_1 pandas 1.0.1-py37h4f17bb1_0 --> 1.0.2-py37h94625e5_0 pexpect 4.8.0-py37_0 --> 4.8.0-py37hc8dfbb8_1 pickleshare 0.7.5-py37_1000 --> 0.7.5-py37hc8dfbb8_1001 pillow 7.0.0-py37h918e99a_0 --> 7.0.0-py37hfd78ece_1 prompt_toolkit 2.0.10-py_0 --> 3.0.4-0 pycosat 0.6.3-py37h0b31af3_1002 --> 0.6.3-py37h9bfed18_1004 pydot 1.4.1-py37_1001 --> 1.4.1-py37hc8dfbb8_1002 pyrsistent 0.15.7-py37h0b31af3_0 --> 0.15.7-py37h9bfed18_1 pysocks 1.7.1-py37_0 --> 1.7.1-py37hc8dfbb8_1 pyzmq 19.0.0-py37h4bf09a9_0 --> 19.0.0-py37haec44b1_1 requests conda-forge/osx-64::requests-2.23.0-p~ --> conda-forge/noarch::requests-2.23.0-pyh8c360ce_2 ruamel_yaml 0.15.80-py37h0b31af3_1000 --> 0.15.80-py37h9bfed18_1001 setuptools 46.0.0-py37_0 --> 46.0.0-py37hc8dfbb8_2 six conda-forge/osx-64::six-1.14.0-py37_0 --> conda-forge/noarch::six-1.14.0-py_1 terminado 0.8.3-py37_0 --> 0.8.3-py37hc8dfbb8_1 tornado 6.0.4-py37h0b31af3_0 --> 6.0.4-py37h9bfed18_1 traitlets 4.3.3-py37_0 --> 4.3.3-py37hc8dfbb8_1 urllib3 1.25.7-py37_0 --> 1.25.7-py37hc8dfbb8_1 vtk 8.2.0-py37hf0265cc_208 --> 8.2.0-py37hffe24a8_209