[Python-Dev] Strange compiler crash in debug builds. (original) (raw)

Mark Hammond MarkH@ActiveState.com
Fri, 25 Aug 2000 15:16:56 +1000


Something strange is happening in my Windows Debug builds (fresh CVS tree)

If you remove "urllib.pyc", and execute 'python_d -c "import urllib"', Python dies after printing the message:

FATAL: node type 305, required 311

It also happens for a number of other files (compileall.py will show you :-)

Further analysis shows this deep in the compiler, and triggered by this macro in node.h:


/* Assert that the type of a node is what we expect */ #ifndef Py_DEBUG #define REQ(n, type) { /pass/ ; } #else #define REQ(n, type)
{ if (TYPE(n) != (type)) {
fprintf(stderr, "FATAL: node type %d, required %d\n",
TYPE(n), type);
abort();
} } #endif

Is this pointing to a deeper problem, or is the assertion incorrect?

Does the Linux community ever run with Py_DEBUG defined? I couldn't even find a simple way to turn it on to confirm it also exists on Linux...

Any ideas?

Mark.