[Python-bugs-list] [ python-Bugs-428342 ] [IRIX] crash on int->float conversio

noreply@sourceforge.net noreply@sourceforge.net
Wed, 30 May 2001 14:15:44 -0700


Bugs item #428342, was updated on 2001-05-29 09:01
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=428342&group_id=5470

Category: Python Interpreter Core
Group: Platform-specific
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Charles Schwieters (chuckorama)
Assigned to: Nobody/Anonymous (nobody)
Summary: [IRIX] crash on int->float conversio

Initial Comment:
here is a snippet from a python session running on
IRIX 6.5.11m, compiled with the native compiler

% python
Python 2.1 (#3, May 29 2001, 10:15:29) [C] on irix646
>>> amin = 0; a=1.0; Na=10
>>> xmin = amin * a / Na
Bus error (core dumped)

I also had this problem with version 2.1b2. 

It works fine if I explicitly change the integers to
floats

it runs fine on Linux and Solaris platforms.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-05-30 14:15

Message:
Logged In: YES 
user_id=31435

I don't see that there's anything we can do about it:  it's 
a compiler-specific optimization error, and you should 
report that to your compiler vendor.  SGI does very 
aggressive optimization and Python users on SGI have had 
similar problems for years (although in different places 
under different releases of the compiler).  By now, they 
should have added Python to their internal compiler 
regression suite!

The code in question looks like standard, portable C to me, 
so there's nothing principled to do I can think of in the 
way of guessing what might make SGI's compiler happier.  If 
you try enough different ways of rewriting the macro I'm 
sure you'll stumble into some way that SGI is happy with.  
I probably wouldn't accept that change back into the Python 
code base, though, as if there's no solid *reason* for the 
change, it will just break again someday.

It's also possible that there's some subtle non-standard 
assumption Python is making here, in which case there is a 
solid reason.  But I don't see one.  If you do, let us know 
and I'll reopen the bug report.


----------------------------------------------------------------------

Comment By: Charles Schwieters (chuckorama)
Date: 2001-05-30 06:07

Message:
Logged In: YES 
user_id=182049

You are so right. Compiling floatobject.c -O1 removes the
problem. (all others use the default -O -OPT:Olimit=0)
The optimizer seems to muck up the call to convert_to_double
in the CONVERT_TO_DOUBLE macro. Suggestions on where to go
from here?

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-05-29 21:24

Message:
Logged In: YES 
user_id=31435

First thing to try with any problem on IRIX is to recompile 
Python with optimization turned off.  That's usually all 
there is to it.  Then, if that fixes it and you feel like 
it, you can play binary search to determine which file 
optimization is breaking (floatobject.c would be my first 
guess).

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=428342&group_id=5470