failure in test_long under gcc (was RE: errors when doing 'make test')

Tim Peters tim_one at
Sat Feb 5 09:34:42 CET 2000

[posted & mailed]
[Al-Amerrho H. Amerin]
> I've downloaded the latest CVS snapshot. I was able to compile without
> any problems and everything seems to be okay. I can run and use python.
> However, when I do 'make test' as the README says, I get these 2 errors:
> 2 tests failed: test_types test_long
> I did the following to determine the exact problem:
> ...
> long miscellaneous operations
> Traceback (innermost last):
>   File "", line 257, in ?
>     test_misc()
>   File "", line 231, in test_misc
>     raise TestFailed, "int(long(-sys.maxint-1)) overflowed!"
> test_support -- test failed: int(long(-sys.maxint-1)) overflowed!
> These errors seem to be related to 'sys.maxint'. In my box its value is:
> 2147483647
> My system:
> Linux version 2.2.9-27mdk (root at (gcc version
> pgcc-2.91.66 19990314 (egcs-1.1.2 release)) #1 Mon Jun 14 16:44:05 CEST
> 1999
> Detected 350805109 Hz processor.
> Console: colour VGA+ 80x25
> Calibrating delay loop... 699.60 BogoMIPS
> Memory: 63164k/65472k available (964k kernel code, 408k reserved, 888k
> data, 48k init)
> VFS: Diskquotas version dquot_6.4.0 initialized
> CPU: AMD AMD-K6(tm) 3D processor stepping 0c
> My python installation:
> Python 1.5.2+ (#2, Feb  5 2000, 02:07:33)  [GCC pgcc-2.91.66
> 19990314 (egcs-1.1.2 release)] on linux2

sys.maxint is correct for your machine.  Previous reports of this symptom
were traced to an optimization bug in a particular version of gcc (sorry,
don't recall the details; DejaNews has 'em *somewhere*, though <wink>).  Try
recompiling Python without optimization.  If the problem goes away, now you
know why.

Using a newer version of the compiler may fix it (anyone out there know for
sure?).  If not, it should suffice to disable optimization only for the file
Objects/longobject.c.  Or, if you're extreme, just disable it for the
function PyLong_AsLong in that file.  There's nothing wrong with the code
there (it's been critically reviewed by dozens of unhappy campers by now
<0.9 wink>), so there's nothing more we can do about it on this end.

BTW, I wrote both the function and the test that's failing, so I can pretend
to know what I'm talking about here <wink>.

the-good-news-is-that-it-doesn't-fail-anywhere-else-ly y'rs  - tim

More information about the Python-list mailing list