This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python: Python/ast.c:541: seq_for_testlist: Assertion fails
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: nnorwitz, tepperly
Priority: normal Keywords:

Created on 2006-10-31 23:05 by tepperly, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg30419 - (view) Author: Tom Epperly (tepperly) Date: 2006-10-31 23:05
I 
1. downloaded Python 2.5 final
wget
'http://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2'
2. edited Python-2.5/Objects/obmalloc.c to uncomment
the #define Py_USING_MEMORY_DEBUGGER line (I plan to
run valgrind on this installation of Python)
3. ./configure --without-pymalloc --with-pydebug
--prefix=/somewhere/python2_5
4. make and then "make install"
5. next I downloaded and extracted numpy-1.0.tar.gz
from Sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103

When I try to run the setup.py for numpy-1.0, I get an
assertion failure.
[epperly@tux163 numpy-1.0]$ python setup.py install
Running from numpy source directory.
python: Python/ast.c:541: seq_for_testlist: Assertion
`((n)->n_type) == 326 || ((n)->n_type) == 318 ||
((n)->n_type) == 319 || ((n)->n_type) == 300' failed.
Abort
[epperly@tux163 numpy-1.0]$
msg30420 - (view) Author: Tom Epperly (tepperly) Date: 2006-10-31 23:16
Logged In: YES 
user_id=94539

If I drop the --with-pydebug from the configure line, it
runs the NumPy's setup.py without error.
msg30421 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-11-03 08:48
Logged In: YES 
user_id=33168

That's weird.  This is definitely a non-standard
configuration, but it should work.  I don't understand why
it would matter if using pydebug or not.  It shouldn't make
a diff.  It would take quite a while to setup the same
config.  Can you debug this further?  Either find the python
code that's causing the problem or the problem in the C code?  

My guess is the only way this could happen based on the
grammar is a list inside backticks ``.  But I couldn't
reproduce it.
msg30422 - (view) Author: Tom Epperly (tepperly) Date: 2006-11-03 18:58
Logged In: YES 
user_id=94539

I think using --with-pydebug makes the assert statements
live, and the default (--without-pydebug) skips the assert()
statements.

I think it would take a great deal of time to understand the
implementation of Python well enough for me to debug this
myself. Sorry, I don't think there is much I can do more
than reporting it.
msg30423 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-11-03 19:27
Logged In: YES 
user_id=33168

Sorry, total brainfart.  I saw the pymalloc line above and
got that stuck in my mind.  You are correct that assertions
are only enabled with pydebug.

Can you find the python code that causes the assertion to
trigger.  Once I have a simple test case I should be able to
fix the problem fast.  If my guess is correct, the code
might look something like:  `[]` (ie a list or generator
expr inside back ticks).
msg30424 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-11-04 19:33
Logged In: YES 
user_id=33168

Thanks for the report.

My guess was close, the problem was:  `1,2`.

Committed revision 52621. (2.6)
Committed revision 52622. (2.5.1)
msg30425 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-11-04 19:36
Logged In: YES 
user_id=33168

Note: If you change `1,2` to `(1,2)` the assertion won't
trigger.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44183
2006-10-31 23:05:43tepperlycreate