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.

Crash while rendering traceback

See original GitHub issue

On a clean checkout of 58006f3

PS C:\Users\wiese\Repos\lean\mathlib> py -3.8 -m IPython
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.0.dev -- An enhanced Interactive Python. Type '?' for help.

In [1]: from enum import Enum

In [2]: class MyEnum(Enum):
   ...:     X = 1
   ...:

In [3]: MyEnum(2)
ValueError: 2 is not a valid MyEnum

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 3410, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-a0dabac034d8>", line 1, in <module>
    MyEnum(2)
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\enum.py", line 304, in __call__
    return cls.__new__(cls, value)
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\enum.py", line 595, in __new__
    raise exc
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\enum.py", line 579, in __new__
    result = cls._missing_(value)
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\enum.py", line 608, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 2 is not a valid MyEnum

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2042, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'ValueError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 3330, in run_ast_nodes
    if (await self.run_code(code, result,  async_=asy)):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 3427, in run_code
    self.showtraceback(running_compiled_code=True)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2044, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 1002, in structured_traceback
    return FormattedTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 902, in structured_traceback
    return VerboseTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 777, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 703, in format_exception_as_a_whole
    records = self.get_records(etb, number_of_lines_of_context, tb_offset)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 753, in get_records
    return list(stack_data.FrameInfo.stack_data(etb, options=options))[tb_offset:]
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\core.py", line 527, in stack_data
    if is_frame(frame_or_tb):
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 87, in is_frame
    assert_(isinstance(frame_or_tb, (types.FrameType, types.TracebackType)))
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 168, in assert_
    raise error
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2042, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'AssertionError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2916, in _run_cell
    return runner(coro)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\async_helpers.py", line 67, in _pseudo_sync_runner
    coro.send(None)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 3138, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 3349, in run_ast_nodes
    self.showtraceback()
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2044, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 1002, in structured_traceback
    return FormattedTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 902, in structured_traceback
    return VerboseTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 777, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 703, in format_exception_as_a_whole
    records = self.get_records(etb, number_of_lines_of_context, tb_offset)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 753, in get_records
    return list(stack_data.FrameInfo.stack_data(etb, options=options))[tb_offset:]
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\core.py", line 527, in stack_data
    if is_frame(frame_or_tb):
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 87, in is_frame
    assert_(isinstance(frame_or_tb, (types.FrameType, types.TracebackType)))
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 168, in assert_
    raise error
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2042, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'AssertionError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\users\wiese\repos\forks\ipython\IPython\__main__.py", line 14, in <module>
    start_ipython()
  File "c:\users\wiese\repos\forks\ipython\IPython\__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\traitlets\config\application.py", line 664, in launch_instance
    app.start()
  File "c:\users\wiese\repos\forks\ipython\IPython\terminal\ipapp.py", line 356, in start
    self.shell.mainloop()
  File "c:\users\wiese\repos\forks\ipython\IPython\terminal\interactiveshell.py", line 564, in mainloop
    self.interact()
  File "c:\users\wiese\repos\forks\ipython\IPython\terminal\interactiveshell.py", line 555, in interact
    self.run_cell(code, store_history=True)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2870, in run_cell
    result = self._run_cell(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2921, in _run_cell
    self.showtraceback(running_compiled_code=True)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\interactiveshell.py", line 2044, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 1002, in structured_traceback
    return FormattedTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 902, in structured_traceback
    return VerboseTB.structured_traceback(
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 777, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 703, in format_exception_as_a_whole
    records = self.get_records(etb, number_of_lines_of_context, tb_offset)
  File "c:\users\wiese\repos\forks\ipython\IPython\core\ultratb.py", line 753, in get_records
    return list(stack_data.FrameInfo.stack_data(etb, options=options))[tb_offset:]
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\core.py", line 527, in stack_data
    if is_frame(frame_or_tb):
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 87, in is_frame
    assert_(isinstance(frame_or_tb, (types.FrameType, types.TracebackType)))
  File "C:\Users\wiese\AppData\Local\Programs\Python\Python38\lib\site-packages\stack_data\utils.py", line 168, in assert_
    raise error
AssertionError

If you suspect this is an IPython 8.0.0.dev bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aulemahalcommented, Apr 26, 2022

I confirm that my issue with raise ValueError() from ValueError() has been fixed as well in 8.2.

1reaction
lestevecommented, Feb 10, 2022

FWIW a git bisect points to #11886 which uses stack_data to show the stacktrace.

I tried to see whether that was a regression in stack_data but actually I get the same behaviour for all the available stack_data versions.

To reproduce in a fresh environment:

conda create -n test-env ipython -y 
conda activate test-env
ipython -c 'raise ValueError("error") from ValueError("cause")'
❯ conda list             
# packages in environment at /home/local/lesteve/miniconda3/envs/test-env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     22.1.0             pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
click                     8.0.3           py310hff52083_1    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
executing                 0.8.2              pyhd8ed1ab_0    conda-forge
ipython                   8.0.1           py310hff52083_0    conda-forge
jedi                      0.18.1          py310hff52083_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_12    conda-forge
libgomp                   11.2.0              h1d223b6_12    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mypy_extensions           0.4.3           py310hff52083_4    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
openssl                   3.0.0                h7f98852_2    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       22.0.3             pyhd8ed1ab_0    conda-forge
platformdirs              2.4.1              pyhd8ed1ab_1    conda-forge
prompt-toolkit            3.0.26             pyha770c72_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
python                    3.10.2          hc74c709_3_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                60.8.1          py310hff52083_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.37.0               h9cd32fc_0    conda-forge
stack_data                0.1.4              pyhd8ed1ab_0    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
typed-ast                 1.5.2           py310h6acc77f_0    conda-forge
typing_extensions         4.0.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
Read more comments on GitHub >

github_iconTop Results From Across the Web

bug, mantra crashing while rendering particle liquid | Forums
I'm trying to render a simple liquid sim and mantra is frequently crashing. I'm using build 725 on Windows XP. My scene contains:...
Read more >
crashes when opening a specific part - PTC Community
I am using Creo Parametric - Release 4.0 (connected) 4.0 M120 Crashes when opening part. Here are the errors that I faced
Read more >
Bundled executable crashes without warning when rendering ...
_umath_linalg.inv() and the program abruptly exits with no error message, warning, or traceback. _umath_linalg is a .pyd file and I ...
Read more >
Some modifiers make render crashes right away on complex ...
Error: Traceback (most recent call last): File "C:\Users\test\Desktop\blender-2.78.0-git.e041bf7-windows64\2.78\scripts\addons\cycles\__init__.py", line 69, ...
Read more >
5 Troubleshoot System Crashes
In some cases a bug in a native library manifests itself as a crash in Java VM code. Consider the crash in the...
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