This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: AIX: test_curses crashes buildbot
Type: crash Stage:
Components: Tests Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Michael.Felt, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-03-29 17:51 by Michael.Felt, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
issue43659.zip Michael.Felt, 2021-03-30 07:24 test output for TERM=xterm and TERM=ansi
test.out Michael.Felt, 2021-03-30 08:55 modified testing results
Pull Requests
URL Status Linked Edit
PR 25074 merged Michael.Felt, 2021-03-29 18:03
PR 25076 merged miss-islington, 2021-03-29 19:07
PR 25077 merged miss-islington, 2021-03-29 19:07
Messages (12)
msg389716 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-03-29 17:51
Since issue42789 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).
msg389720 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-03-29 18:05
backports needed for 3.8 and 3.9
msg389726 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-03-29 19:06
New changeset c8b5738810516df5722caf049003e9b319427bec by Michael Felt in branch 'master':
bpo-43659:  Fix test_curses on AIX (GH-25074)
https://github.com/python/cpython/commit/c8b5738810516df5722caf049003e9b319427bec
msg389728 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-03-29 19:18
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?
msg389729 - (view) Author: miss-islington (miss-islington) Date: 2021-03-29 19:26
New changeset e9092b221d4951609827e437178a557fd07353af by Miss Islington (bot) in branch '3.8':
bpo-43659:  Fix test_curses on AIX (GH-25074)
https://github.com/python/cpython/commit/e9092b221d4951609827e437178a557fd07353af
msg389731 - (view) Author: miss-islington (miss-islington) Date: 2021-03-29 19:31
New changeset f1d53bcd536036c0a0c39962fbc0f465b5865492 by Miss Islington (bot) in branch '3.9':
bpo-43659:  Fix test_curses on AIX (GH-25074)
https://github.com/python/cpython/commit/f1d53bcd536036c0a0c39962fbc0f465b5865492
msg389795 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-03-30 07:24
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).
msg389801 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-03-30 08:03
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.
msg389803 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-03-30 08:31
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)
msg389808 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-03-30 08:55
./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
msg389901 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-03-31 14:22
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"
msg392209 - (view) Author: Michael Felt (Michael.Felt) * Date: 2021-04-28 15:02
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)
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87825
2021-04-29 06:07:32Michael.Feltsettype: crash
2021-04-28 15:02:03Michael.Feltsetmessages: + msg392209
2021-03-31 14:22:26Michael.Feltsetmessages: + msg389901
2021-03-30 08:55:17Michael.Feltsetfiles: + test.out

messages: + msg389808
2021-03-30 08:31:11serhiy.storchakasetmessages: + msg389803
2021-03-30 08:03:44serhiy.storchakasetmessages: + msg389801
2021-03-30 07:50:28serhiy.storchakasetstatus: closed -> open
resolution: fixed ->
stage: resolved ->
2021-03-30 07:49:32serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-03-30 07:24:01Michael.Feltsetfiles: + issue43659.zip

messages: + msg389795
2021-03-29 19:31:10miss-islingtonsetmessages: + msg389731
2021-03-29 19:26:46miss-islingtonsetmessages: + msg389729
2021-03-29 19:18:19serhiy.storchakasetmessages: + msg389728
2021-03-29 19:07:14miss-islingtonsetpull_requests: + pull_request23827
2021-03-29 19:07:06miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request23826
2021-03-29 19:06:41serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg389726
2021-03-29 18:05:14Michael.Feltsetmessages: + msg389720
versions: + Python 3.8, Python 3.9
2021-03-29 18:03:01Michael.Feltsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23824
2021-03-29 17:51:13Michael.Feltcreate