[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 77f0ed7a42606d03ebfe48ab152caf0d796d6540 by Guido van Rossum in 
branch 'master':
bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL (#13634)
https://github.com/python/cpython/commit/77f0ed7a42606d03ebfe48ab152caf0d796d6540


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
keywords: +patch
pull_requests: +13534
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13634

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

OK, I'll look into this.

--
assignee:  -> gvanrossum
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a release blocker.

--
nosy: +lukasz.langa, vstinner
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Petr Viktorin


Petr Viktorin  added the comment:

Looks like this is caused by: 
https://github.com/python/cpython/pull/12086/files#diff-4d35cf8992b795c5e97e9c8b6167cb34R787

PyAST_FromNodeObject doesn't ignore flags any more, so when PyNode_Compile 
passes NULL flags, it crashes.

(This is unfamiliar code for me; I won't have time to fix & test properly this 
week.)

--
nosy: +petr.viktorin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-27 Thread Graham Dumpleton


Graham Dumpleton  added the comment:

FWIW, this was occurring on macOS. Not been able to test on other platforms.

--
type:  -> crash

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-27 Thread Graham Dumpleton


New submission from Graham Dumpleton :

The code:

#include 

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com