Skip to content

decimal: Context(traps=...) dereferences a SignalDict's NULL flags pointer #161389

Closed

Description

@theosotr

Bug report

Summary

Building a Context from a signal dictionary that you created yourself crashes the interpreter with seg fault.

Expected: the same NULL check the signal-dict methods already make, or a ValueError.

Reproducer

import decimal

SignalDict = type(decimal.Context().traps)
decimal.Context(traps=SignalDict())
Segmentation fault (core dumped)

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Nov 5, 2026
  3. added 3 commits that reference this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions