classification
Title: Fix test_importlib.test_bad_traverse for AIX
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Michael.Felt, miss-islington, ned.deily
Priority: normal Keywords: patch

Created on 2018-09-18 12:03 by Michael.Felt, last changed 2019-09-10 13:30 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9391 merged Michael.Felt, 2018-09-18 12:08
PR 14238 merged Michael.Felt, 2019-06-19 15:14
Messages (6)
msg325632 - (view) Author: Michael Felt (Michael.Felt) * Date: 2018-09-18 12:03
Issue32374 added a new subtest (test_bad_traverse) in test_importlib. The test succeeds when a script calling a bad_traverse exits with a non-zero status (e.g., crashes because of segmentation violation)

This patch "fixes" Modules/_testmultiphase.c so that it exits with a non-zero status when a NULL pointer is accessed. This is what was causing other systems to 'crash' expectedly - while AIX was not.

A simple demo program to demonstrate the difference behavior of AIX:

/*
 * Program to show whether an executable crashes, or not
 * when a NULL pointer is accessed
 * Author: AIXTOOLS
 */

#include<stdio.h>
main()
{
        long *vpt = NULL;

        fprintf(stdout, "vpt = %08lx\n", (long) vpt);
        if (*vpt)
                fprintf(stdout,"True\n");
        else
                fprintf(stdout,"False\n");

}

On AIX:
root@x066:[/data/prj/python/git]make nullpr; ./nullpr
cc     nullpr.c   -o nullpr
vpt = 00000000
False

On a Linux server:
root@x074:/data/prj/python/git# rm nullpr; make nullpr; ./nullpr
make: Warning: File 'nullpr.c' has modification time 352 s in the future
cc     nullpr.c   -o nullpr
nullpr.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^
make: warning:  Clock skew detected.  Your build may be incomplete.
vpt = 00000000
Segmentation fault
msg335772 - (view) Author: miss-islington (miss-islington) Date: 2019-02-17 12:03
New changeset 1bf8845f74013c5f1cc5f49a11e52c652a1fb9dd by Miss Islington (bot) (Michael Felt) in branch 'master':
bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-9391)
https://github.com/python/cpython/commit/1bf8845f74013c5f1cc5f49a11e52c652a1fb9dd
msg337628 - (view) Author: Michael Felt (Michael.Felt) * Date: 2019-03-10 18:26
Could this also be backported to 3.6 and 3.7 please?
msg337629 - (view) Author: Michael Felt (Michael.Felt) * Date: 2019-03-10 18:31
could this be backported to versions 3.7, and if applicable, to version 3.6
msg337702 - (view) Author: Michael Felt (Michael.Felt) * Date: 2019-03-11 21:45
On 10/03/2019 19:31, Michael Felt wrote:
> Michael Felt <aixtools@felt.demon.nl> added the comment:
>
> could this be backported to versions 3.7, and if applicable, to version 3.6
Only 3.7 - As 3.6 is in security mode.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue34720>
> _______________________________________
>
msg351648 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-09-10 13:30
New changeset 61f34f9f63aab7503420603627ad5bd8902d904b by Ned Deily (Michael Felt) in branch '3.7':
bpo-34720: Fix test_importlib.test_bad_traverse for AIX  (GH-14238)
https://github.com/python/cpython/commit/61f34f9f63aab7503420603627ad5bd8902d904b
History
Date User Action Args
2019-09-10 13:30:21ned.deilysetnosy: + ned.deily
messages: + msg351648
2019-06-19 15:14:29Michael.Feltsetpull_requests: + pull_request14074
2019-03-12 07:36:16Michael.Feltsetversions: - Python 3.6
2019-03-11 21:45:32Michael.Feltsetmessages: + msg337702
2019-03-10 18:31:34Michael.Feltsetmessages: + msg337629
2019-03-10 18:26:52Michael.Feltsetmessages: + msg337628
versions: + Python 3.6, Python 3.7
2019-02-18 11:26:27ncoghlansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-02-17 12:03:00miss-islingtonsetnosy: + miss-islington
messages: + msg335772
2018-09-18 12:08:21Michael.Feltsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8815
2018-09-18 12:04:51Michael.Feltsettitle: Fix test_importlib for AIX -> Fix test_importlib.test_bad_traverse for AIX
2018-09-18 12:03:05Michael.Feltcreate