[issue42057] pytest case which catch exceptions become segfault

Hiroshi Miura report at bugs.python.org
Fri Oct 16 22:33:29 EDT 2020


New submission from Hiroshi Miura <miurahr at linux.com>:

I've observed that pytest becomes segmentation fault on python 3.9.0 with attached case.

I've tested the case with several python versions;
  python 3.9.0a2 - good
  python 3.9.0a3, 3.9.0-final - bad
  python 3.10.0a1 - good

- OS: Mint Linux 20, Linux kernel 5.8.14
- Attachments:
    * test_main.py  - pytest test case to reproduce
    * py_stacktrace.txt - pytest result which become segmentation fault
    * gdb_backtrace.txt - gdb backtrace

So I've bisected and  a result is as follows;

9af0e47b1705457bb6b327c197f2ec5737a1d8f6 is the first bad commit
commit 9af0e47b1705457bb6b327c197f2ec5737a1d8f6
Author: Mark Shannon <mark at hotpy.org>
Date:   Tue Jan 14 10:12:45 2020 +0000

    bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)

    Break up COMPARE_OP into four logically distinct opcodes:
    * COMPARE_OP for rich comparisons
    * IS_OP for 'is' and 'is not' tests
    * CONTAINS_OP for 'in' and 'is not' tests
    * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.

 Doc/library/dis.rst                                |   21 +
 Include/opcode.h                                   |    8 +-
 Lib/importlib/_bootstrap_external.py               |    3 +-
 Lib/opcode.py                                      |    7 +-
 Lib/test/test_dis.py                               |  141 +-
 Lib/test/test_peepholer.py                         |   12 +-
 Lib/test/test_positional_only_arg.py               |    6 +-
 .../2019-12-30-10-53-59.bpo-39156.veT-CB.rst       |    9 +
 PC/launcher.c                                      |    3 +-
 Python/ceval.c                                     |  137 +-
 Python/compile.c                                   |   71 +-
 Python/importlib.h                                 | 2922 +++++++------
 Python/importlib_external.h                        | 4560 ++++++++++----------
 Python/importlib_zipimport.h                       | 1831 ++++----
 Python/opcode_targets.h                            |    6 +-
 Python/peephole.c                                  |    6 +-
 Tools/scripts/generate_opcode_h.py                 |    5 -
 17 files changed, 4901 insertions(+), 4847 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and Builtins/2019-12-30-10-53-59.bpo-39156.veT-CB.rst

----------
components: Interpreter Core
files: test_main.py
messages: 378796
nosy: miurahr
priority: normal
severity: normal
status: open
title: pytest case which catch  exceptions become segfault
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file49521/test_main.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42057>
_______________________________________


More information about the Python-bugs-list mailing list