Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault in curses when calling redrawwin() before refresh() #45607

Closed
thorben mannequin opened this issue Oct 11, 2007 · 4 comments
Closed

segfault in curses when calling redrawwin() before refresh() #45607

thorben mannequin opened this issue Oct 11, 2007 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@thorben
Copy link
Mannequin

thorben mannequin commented Oct 11, 2007

BPO 1266
Nosy @akuchling, @mdickinson
Files
  • curses-01.py
  • 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 = 'https://github.com/akuchling'
    closed_at = <Date 2008-01-19.13:46:58.469>
    created_at = <Date 2007-10-11.18:14:44.491>
    labels = ['extension-modules', 'type-crash']
    title = 'segfault in curses when calling redrawwin() before refresh()'
    updated_at = <Date 2010-01-13.12:41:44.381>
    user = 'https://bugs.python.org/Thorben'

    bugs.python.org fields:

    activity = <Date 2010-01-13.12:41:44.381>
    actor = 'mark.dickinson'
    assignee = 'akuchling'
    closed = True
    closed_date = <Date 2008-01-19.13:46:58.469>
    closer = 'akuchling'
    components = ['Extension Modules']
    creation = <Date 2007-10-11.18:14:44.491>
    creator = 'Thorben'
    dependencies = []
    files = ['8514']
    hgrepos = []
    issue_num = 1266
    keywords = []
    message_count = 4.0
    messages = ['56348', '56355', '60157', '97710']
    nosy_count = 4.0
    nosy_names = ['akuchling', 'nnorwitz', 'mark.dickinson', 'Thorben']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue1266'
    versions = ['Python 2.5']

    @thorben
    Copy link
    Mannequin Author

    thorben mannequin commented Oct 11, 2007

    attached file makes python 2.5.1 segfault

    @thorben thorben mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Oct 11, 2007
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Oct 12, 2007

    What platform are you on? I can reproduce this with 2.5.1+ and trunk on
    Ubuntu. I can reproduce with a trivial C program that does the same
    thing. This could be a bug in the curses implementation. Or it could
    be misuse of the API. I don't know enough to suggest which is the case.

    The C program is:

    #include <curses.h>
    
    int main(int argc, char**argv) {
      WINDOW *win = initscr();
      WINDOW *win2 = newwin(50, 50, 50, 50);
      redrawwin(win2);
      return 0;
    }

    Perhaps a bug should be filed against curses.

    @nnorwitz nnorwitz mannequin added extension-modules C modules in the Modules dir and removed stdlib Python modules in the Lib dir labels Oct 12, 2007
    @akuchling akuchling self-assigned this Jan 9, 2008
    @akuchling
    Copy link
    Member

    The C program does crash, but newwin() is returning NULL 
    and the code should really be checking for this case.   When I try 
    the Python script with 2.5-maint and 2.6-trunk, I get the error:
    amk@amk:~/source/p/25$ ./python.exe ../python/curses-01.py
    Traceback (most recent call last):
      File "../python/curses-01.py", line 8, in <module>
        curses.wrapper(foobar)
      File "/Users/amk/source/p/25/Lib/curses/wrapper.py", line 44, in wrapper
        return func(stdscr, *args, **kwds)
      File "../python/curses-01.py", line 4, in foobar
        winmain = curses.newwin(50,50,50,50)
    _curses.error: curses function returned NULL

    I removed the import of the 'readline' module
    because I don't have it on my Mac, but that seems unlikely to
    make a difference.

    @mdickinson
    Copy link
    Member

    I wonder whether bpo-7384 (test_curses crash on FreeBSD) is related to this. There does seem to be some sort of readline interaction going on in that issue.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants