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.
Mark Hammond writes:
Is this pointing to a deeper problem, or is the assertion incorrect?
I expect that there's an incorrect assertion that was fine until one of the recent grammar changes; the augmented assignment patch is highly suspect given that it's the most recent. Look for problems handling expr_stmt nodes.
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...
I don't think I've ever used it, either on Linux or any other Unix. We should definately have an easy way to turn it on! Probably at configure time would be good. -Fred -- Fred L. Drake, Jr. <fdrake at beopen.com> BeOpen PythonLabs Team Member
On Fri, Aug 25, 2000 at 03:16:56PM +1000, Mark Hammond wrote:
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:
#define REQ(n, type) \ { if (TYPE(n) != (type)) { \ fprintf(stderr, "FATAL: node type %d, required %d\n", \ TYPE(n), type); \ abort(); \ } }
Is this pointing to a deeper problem, or is the assertion incorrect?
At first sight, I would say "yes, the assertion is wrong". That doesn't mean it shouldn't be fixed ! It's probably caused by augmented assignment or list comprehensions, though I have used both with Py_DEBUG enabled a few times, so I don't know for sure. I'm compiling with debug right now, to inspect this, though. Another thing that might cause it is an out-of-date graminit.h file somewhere. The one in the CVS tree is up to date, but maybe you have a copy stashed somewhere ?
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...
There's undoubtedly a good way, but I usually just chicken out and add '#define Py_DEBUG 1' at the bottom of config.h ;) That also makes sure I don't keep it around too long, as config.h gets regenerated often enough :) -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
On Fri, Aug 25, 2000 at 07:29:53AM +0200, Thomas Wouters wrote:
On Fri, Aug 25, 2000 at 03:16:56PM +1000, Mark Hammond wrote:
FATAL: node type 305, required 311
Is this pointing to a deeper problem, or is the assertion incorrect?
At first sight, I would say "yes, the assertion is wrong". That doesn't mean it shouldn't be fixed ! It's probably caused by augmented assignment or list comprehensions,
Actually, it was a combination of removing UNPACK_LIST and adding list comprehensions. I just checked in a fix for this. Can you confirm that this fixes it for the windows build, too ? -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
"MH" == Mark Hammond <MarkH@ActiveState.com> writes:
MH> Does the Linux community ever run with Py_DEBUG defined? I MH> couldn't even find a simple way to turn it on to confirm it also MH> exists on Linux... I build a separate version of Python using make OPT="-Wall -DPy_DEBUG" On Linux, the sre test fails. Do you see the same problem on Windows? Jeremy
Mark> [Jeremy] >> On Linux, the sre test fails. Do you see the same problem on Windows? Mark> Not with either debug or release builds. Nor I on Mandrake Linux. Skip
participants (5)
-
Fred L. Drake, Jr. -
Jeremy Hylton -
Mark Hammond -
Skip Montanaro -
Thomas Wouters