New submission from Michael Felt <aixto...@felt.demon.nl>:

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

----------
components: Tests
messages: 325632
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: Fix test_importlib for AIX
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34720>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to