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.

Author Michael.Felt
Recipients Michael.Felt
Date 2018-09-18.12:03:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537272185.7.0.956365154283.issue34720@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-09-18 12:03:05Michael.Feltsetrecipients: + Michael.Felt
2018-09-18 12:03:05Michael.Feltsetmessageid: <1537272185.7.0.956365154283.issue34720@psf.upfronthosting.co.za>
2018-09-18 12:03:05Michael.Feltlinkissue34720 messages
2018-09-18 12:03:05Michael.Feltcreate