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

Fix test_importlib.test_bad_traverse for AIX #78901

Closed
aixtools opened this issue Sep 18, 2018 · 6 comments
Closed

Fix test_importlib.test_bad_traverse for AIX #78901

aixtools opened this issue Sep 18, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@aixtools
Copy link
Contributor

BPO 34720
Nosy @ned-deily, @aixtools, @miss-islington
PRs
  • bpo-34720: Fix test_importlib.test_bad_traverse for AIX #9391
  • [3.7] bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-9391) #14238
  • 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 = <Date 2019-02-18.11:26:27.841>
    created_at = <Date 2018-09-18.12:03:05.679>
    labels = ['3.7', '3.8', 'type-bug', 'tests']
    title = 'Fix test_importlib.test_bad_traverse for AIX'
    updated_at = <Date 2019-09-10.13:30:21.197>
    user = 'https://github.com/aixtools'

    bugs.python.org fields:

    activity = <Date 2019-09-10.13:30:21.197>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-18.11:26:27.841>
    closer = 'ncoghlan'
    components = ['Tests']
    creation = <Date 2018-09-18.12:03:05.679>
    creator = 'Michael.Felt'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34720
    keywords = ['patch']
    message_count = 6.0
    messages = ['325632', '335772', '337628', '337629', '337702', '351648']
    nosy_count = 3.0
    nosy_names = ['ned.deily', 'Michael.Felt', 'miss-islington']
    pr_nums = ['9391', '14238']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34720'
    versions = ['Python 3.7', 'Python 3.8']

    @aixtools
    Copy link
    Contributor Author

    bpo-32374 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 = 0000000
    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 = 0000000
    Segmentation fault

    @aixtools aixtools added 3.8 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Sep 18, 2018
    @aixtools aixtools changed the title Fix test_importlib for AIX Fix test_importlib.test_bad_traverse for AIX Sep 18, 2018
    @miss-islington
    Copy link
    Contributor

    New changeset 1bf8845 by Miss Islington (bot) (Michael Felt) in branch 'master':
    bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-9391)
    1bf8845

    @aixtools
    Copy link
    Contributor Author

    Could this also be backported to 3.6 and 3.7 please?

    @aixtools aixtools added the 3.7 (EOL) end of life label Mar 10, 2019
    @aixtools
    Copy link
    Contributor Author

    could this be backported to versions 3.7, and if applicable, to version 3.6

    @aixtools
    Copy link
    Contributor Author

    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\>


    @ned-deily
    Copy link
    Member

    New changeset 61f34f9 by Ned Deily (Michael Felt) in branch '3.7':
    bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-14238)
    61f34f9

    @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.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants