New submission from Graham Dumpleton <graham.dumple...@gmail.com>:

The code:

#include <Python.h>

int
main(int argc, char *argv[])
{
    FILE *fp = NULL;
    PyObject *co = NULL;
    struct _node *n = NULL;
    const char * filename = "/dev/null";

    Py_Initialize();

    fprintf(stderr, "START\n");

    fp = fopen(filename, "r");

    fprintf(stderr, "CALL PyParser_SimpleParseFile()\n");

    n = PyParser_SimpleParseFile(fp, filename, Py_file_input);

    fprintf(stderr, "CALL PyNode_Compile()\n");

    co = (PyObject *)PyNode_Compile(n, filename);

    fprintf(stderr, "DONE\n");

    Py_Finalize();

    return 0;
}

has worked fine since Python 2.3 (and maybe earlier) through Python 3.7, but 
now crashes in Python 3.8.

It crashes in PyNode_Compile().

START
CALL PyParser_SimpleParseFile()
CALL PyNode_Compile()
Segmentation fault: 11

Although it is part of the public interface of compile.h, the PyNode_Compile() 
seems never to actually be called anywhere in Python itself, and perhaps isn't 
even covered by tests. So if Python 3.8 internal changes mean this function 
implementation needs to be changed, that fact may have been missed.

----------
messages: 343727
nosy: grahamd
priority: normal
severity: normal
status: open
title: PyNode_Compile() crashes in Python 3.8.
versions: Python 3.8

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

Reply via email to