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

AIX: test_curses crashes buildbot #87825

Open
aixtools opened this issue Mar 29, 2021 · 12 comments
Open

AIX: test_curses crashes buildbot #87825

aixtools opened this issue Mar 29, 2021 · 12 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@aixtools
Copy link
Contributor

BPO 43659
Nosy @serhiy-storchaka, @aixtools, @miss-islington
PRs
  • bpo-43659: check for curses.update_lines_cols() in Lib/test/test_curses.py #25074
  • [3.9] bpo-43659: Fix test_curses on AIX (GH-25074) #25076
  • [3.8] bpo-43659: Fix test_curses on AIX (GH-25074) #25077
  • Files
  • issue43659.zip: test output for TERM=xterm and TERM=ansi
  • test.out: modified testing results
  • 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-03-29.17:51:13.912>
    labels = ['3.8', '3.10', 'tests', '3.9', 'type-crash']
    title = 'AIX: test_curses crashes buildbot'
    updated_at = <Date 2021-04-29.06:07:32.768>
    user = 'https://github.com/aixtools'

    bugs.python.org fields:

    activity = <Date 2021-04-29.06:07:32.768>
    actor = 'Michael.Felt'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2021-03-29.17:51:13.912>
    creator = 'Michael.Felt'
    dependencies = []
    files = ['49917', '49918']
    hgrepos = []
    issue_num = 43659
    keywords = ['patch']
    message_count = 12.0
    messages = ['389716', '389720', '389726', '389728', '389729', '389731', '389795', '389801', '389803', '389808', '389901', '392209']
    nosy_count = 3.0
    nosy_names = ['serhiy.storchaka', 'Michael.Felt', 'miss-islington']
    pr_nums = ['25074', '25076', '25077']
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue43659'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @aixtools
    Copy link
    Contributor Author

    Since bpo-42789 the AIX bot's have crashed - to the extent that the bot's did not even return results.

    Part of this has been resolved, for now, by using:

    $ export TERM=unknown
    $ buildbot start buildarea

    However, the test still crash because AIX default libcurses.a does not include support for update_lines_cols().

    This patch should allow test_curses.py to pass in the buildbot.

    When run from command-line as:

    $ TERM=unknown ./python Lib/test/test_curses.py
    .ss......ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

    Ran 71 tests in 0.121s

    OK (skipped=64)
    aixtools@cpython2:[/home/aixtools/py3a-10.0]

    (When TERM is defined - a core dump still occurs - that will be a new issue and a new PR).

    @aixtools aixtools added 3.10 only security fixes tests Tests in the Lib/test dir labels Mar 29, 2021
    @aixtools
    Copy link
    Contributor Author

    backports needed for 3.8 and 3.9

    @aixtools aixtools added 3.8 only security fixes 3.9 only security fixes labels Mar 29, 2021
    @serhiy-storchaka
    Copy link
    Member

    New changeset c8b5738 by Michael Felt in branch 'master':
    bpo-43659: Fix test_curses on AIX (GH-25074)
    c8b5738

    @serhiy-storchaka
    Copy link
    Member

    Minor correction. update_lines_cols() is not provided by the underlying curses library, it is a helper defined in Python wrapper. But it is optional, snd skipping test is the correct solution. Thank you.

    As for the core dump, could you please run the test in verbose mode with redirected stdout and stderr and show the result?

    ./python -m test -vuall test_curses 2>test.err >test.out
    

    What is the default value of TERM? Does the result differ if set TERM=xterm?

    @miss-islington
    Copy link
    Contributor

    New changeset e9092b2 by Miss Islington (bot) in branch '3.8':
    bpo-43659: Fix test_curses on AIX (GH-25074)
    e9092b2

    @miss-islington
    Copy link
    Contributor

    New changeset f1d53bc by Miss Islington (bot) in branch '3.9':
    bpo-43659: Fix test_curses on AIX (GH-25074)
    f1d53bc

    @aixtools
    Copy link
    Contributor Author

    my default TERM=xterm

    I'll also use 'ansi'

    The filenames will be ${TERM}.err and ${TERM}.out

    for TERM in xterm ansi; do
    ./python -m test -vuall test_curses 2>${TERM}.err >${TERM}.out
    done

    After TERM=ansi - my terminal is in raw mode (i.e.,
    $ stty sane ^J

    needed).

    @serhiy-storchaka
    Copy link
    Member

    Thank you. I see that 7 tests are failed (test_background, test_color_attrs, test_color_content, test_getch, test_getstr, test_init_pair, test_insert_delete) and test_output_string perhaps crashes.

    Could you please run tests with test_insert_delete skipped (option -i test_insert_delete or just skip in code)? If it crashes on other tests, skip them as well.

    @serhiy-storchaka
    Copy link
    Member

    Please also try to comment out the following line in test_output_string. Does it help?

                s = '\u0661\u0662\u0663\u0664'
                try:
                    func(s, 3)
                except UnicodeEncodeError:
                    self.assertRaises(UnicodeEncodeError, s.encode, encoding)
    

    @aixtools
    Copy link
    Contributor Author

    ./python -m test -vuall -i test_output_string -i test_insert_delete test_curses 2>test.err 1>test.out

    returns four failures: see attached

    '-i test_output_string' stops the crash

    @aixtools
    Copy link
    Contributor Author

    FYI: from a core dump - top of where is:

    Segmentation fault in winsnstr at 0xd3ebc050
    0xd3ebc050 (winsnstr+0x190) a4190002 lhzu r0,0x2(r25)
    (dbx) where
    winsnstr(??, ??, ??) at 0xd3ebc050
    unnamed block in IPRA.$_curses_window_insstr_impl(self = 0x100fd954, group_left_1 = -739652824, y = 804382672, x = 804382676, str = 0x2ff1e7dc, group_right_1 = -739620304, attr = 0), line 1855 in "_cursesmodule.c"
    IPRA.$_curses_window_insstr_impl(self = 0x100fd954, group_left_1 = -739652824, y = 804382672, x = 804382676, str = 0x2ff1e7dc, group_right_1 = -739620304, attr = 0), line 1855 in "_cursesmodule.c"
    _curses_window_insstr(self = 0x100a96ec, args = 0x20088288), line 1160 in "_cursesmodule.c.h"
    cfunction_call(func = 0x305337d0, args = 0x20088288, kwargs = 0x2ff1e8b0), line 567 in "methodobject.c"
    _PyObject_MakeTpCall(tstate = (nil), callable = 0x20088288, args = 0x2ff1e930, nargs = 131, keywords = 0x10167b48), line 215 in "call.c"
    _PyEval_EvalFrameDefault(tstate = 0x100b2a6c, f = 0x303a1268, throwflag = 806335952), line 1429 in "abstract.h"
    _PyEval_Vector(tstate = 0x100ef278, con = 0x300fd59a, locals = 0x2ff1ea90, args = 0x20045994, argcount = 806339296, kwnames = 0x300ff6a0), line 46 in "pycore_ceval.h"

    @aixtools
    Copy link
    Contributor Author

    Dome some 'dumb' testing - and I hope this helps understand why it is failing:

    With the the last two func() calls commented out, the function passes:

        def test_output_string(self):
            stdscr = self.stdscr
            encoding = stdscr.encoding
            # addstr()/insstr()
            for func in [stdscr.addstr, stdscr.insstr]:
                with self.subTest(func.__qualname__):
                    stdscr.move(0, 0)
                    func('abcd')
                    func(b'abcd')
                    s = 'à▒^▒ç▒^▒'
                    try:
                        func(s)
                    except UnicodeEncodeError:
                        self.assertRaises(UnicodeEncodeError, s.encode, encoding)
                    func('abcd', curses.A_BOLD)
                    # func(1, 2, 'abcd')
                    # func(2, 3, 'abcd', curses.A_BOLD)

    @aixtools aixtools added type-crash A hard crash of the interpreter, possibly with a core dump labels Apr 29, 2021
    @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
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    Status: Bugs
    Development

    No branches or pull requests

    3 participants