GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — curses module may call delwin() on original window before subwindows · Issue #88338 · python/cpython

curses module may call delwin() on original window before subwindows #88338

New issue
Copy link
New issue
Copy link
Closed
Closed
curses module may call delwin() on original window before subwindows#88338
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

michaelforney
mannequin
opened on May 19, 2021
Issue body actions
BPO 44172
Nosy @michaelforney
PRs
  • bpo-44172: Keep reference to original window in curses subwindow objects #26226
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-05-19.02:08:10.843>
    labels = ['3.8', '3.9', '3.10', '3.11', 'extension-modules', '3.7', 'type-crash']
    title = 'curses module may call delwin() on original window before subwindows'
    updated_at = <Date 2021-05-19.02:24:53.341>
    user = 'https://github.com/michaelforney'

    bugs.python.org fields:

    activity = <Date 2021-05-19.02:24:53.341>
    actor = 'michaelforney'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2021-05-19.02:08:10.843>
    creator = 'michaelforney'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44172
    keywords = ['patch']
    message_count = 1.0
    messages = ['393916']
    nosy_count = 1.0
    nosy_names = ['michaelforney']
    pr_nums = ['26226']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue44172'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. michaelforney commented on May 19, 2021

      @michaelforney
      michaelforneymannequin
      on May 19, 2021
      MannequinAuthor
      More actions

      When subwin() is used to create a subwindow for an original window, it does not keep a reference to the original window object. This can result in the original window getting deleted with delwin() before the subwindow.

      According to the X/Open curses specification[0]:

      The application must delete subwindows before deleting the main window.

      This is also mentioned in the ncurses documentation[1]:

      Subwindows must be deleted before the main window can be deleted.

      When building the Python curses module against NetBSD's curses implementation, deleting the windows in the wrong order causes a double-free. This results in hanging or crashing when running test_curses.

      To fix this, window objects for subwindows should keep a reference to the original window object.

      [0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
      [1] https://invisible-island.net/ncurses/man/curs_window.3x.html

    2. michaelforney
      added
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
      on May 19, 2021
    3. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    4. serhiy-storchaka
      added this to Curses issueson May 20, 2022
    5. erlend-aasland
      moved this to Bugs in Curses issueson May 20, 2022
    6. serhiy-storchaka
      closed this as completedon May 4, 2025
    7. github-project-automation
      moved this from Bugs to Done in Curses issueson May 4, 2025
    8. serhiy-storchaka
      added
      3.13only security fixesonly security fixes
      3.14bugs and security fixesbugs and security fixes
      and removed
      3.11only security fixesonly security fixes
      3.10 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.7 (EOL)end of lifeend of life
      on May 4, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

      Projects

      • Curses issues
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.