[issue9069] test_float failure on Solaris

2010-06-27 Thread Mark Dickinson
Mark Dickinson added the comment: The gcc optimization bug was fixed (with impressive speed!) upstream. I'm going to close this as 'won't fix'. It's probably possible to find a workaround, but the issue is minor, apparently only affects one platform, and relates to a little-used method. For

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks Stefan. The bug apparently exists in gcc-4.5 on OS X as well. I'll update the gcc bug report. newton:~ dickinsm$ gcc-mp-4.5 -fno-inline -O3 copysign_bug.c -o copysign_bug && ./copysign_bug copysign_bug(-0) = 3 copysign_bug(0) = 3 -- ___

[issue9069] test_float failure on Solaris

2010-06-26 Thread Stefan Krah
Stefan Krah added the comment: Fedora 12: copysign-bug varies wildly ((GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)): [ste...@fedora-amd64 trunk]$ gcc -O0 copysign_bug.c -o copysign_bug [ste...@fedora-amd64 trunk]$ ./copysign_bug copysign_bug(-0) = 2 copysign_bug(0) = 3 [ste...@fedora-amd64 trunk]$

[issue9069] test_float failure on Solaris

2010-06-26 Thread Stefan Krah
Stefan Krah added the comment: Mark, gcc-4.4 on Fedora 12 is ok: [ste...@fedora-amd64 trunk]$ ./python Python 2.7rc2+ (trunk:82245M, Jun 26 2010, 13:09:14) [GCC 4.4.3 20100127 (Red Hat 4.4.3-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> (-0.0).hex()

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: Here's some minimal failing code. // Compile with: // gcc-4.4 -m64 -fno-inline -g -O3 copysign_bug.c -o copysign_bug #include #include int copysign_bug(double x) { if (x && (x * 0.5 == x)) return 1; if (copysign(1.0, x) < 0.0) return 2; else

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: I'm glad you can reproduce it! I can understand you wanting to close it in this case. I've no problem with that. To me at least, it does not seem anywhere near as serious as the other problem. I will try it on Linux though. I have access to reasonably decen

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: Okay---this one I *can* reproduce. :) I'm going to call it a gcc optimization bug. Specifically, it seems to be a bug involving gcc's builtin version of the copysign function. When I build a current svn trunk checkout (r82245) with: CC='gcc-4.4 -m64' ./co

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: Sorry, I missed out the comment there. This is failing for me, in boht 32 and 64-bit builds with Python-2.7rc2 -- ___ Python tracker ___ ___

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: test_float test test_float failed -- Traceback (most recent call last): File "/export/home/drkirkby/Python-2.7rc2/Lib/test/test_float.py", line 1297, in test_roundtrip self.identical(-x, roundtrip(-x)) File "/export/home/drkirkby/Python-2.7rc2/Lib/test/te

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: I see the same _socket build failure as you do; but with the issue 8852 patch, I can run the test suite. It did spend quite a while in test_posix, but the test eventually finished (and failed). I didn't get to the end of the test run, unfortunately, because

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: Sorry, I seem to have wasted a lot of your time here. Python was built from a script which applied some patches - including that one that allows _socket to build. Without that (which is not commit to python and I'm told it might not be done this year), its imp

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the logs. So if you apply the issue8852 patch, and run the test suite, does test_float still fail? -- ___ Python tracker ___ __

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: Here's the header file that gets created -- Added file: http://bugs.python.org/file17776/pyconfig.h ___ Python tracker ___ ___

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: Here's a build done the same way as you. This gives the same result as you here. But an attempt to run the test suite fails because of _socket. I need to patch that in order that I can run the test suite. See http://bugs.python.org/issue8852 -- Adde

[issue9069] test_float failure on Solaris

2010-06-26 Thread David Kirkby
David Kirkby added the comment: Hi, __EXTENSIONS__ is defined to 1. Give me an hour, and I'll attach a log. -- ___ Python tracker ___

[issue9069] test_float failure on Solaris

2010-06-26 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson wrote: > I don't *think* this is related to issue 7281. I thought we'd determined that > that issue > had nothing to do with copysign itself, and everything to do with what the > signbit of the > NaN returned by float("nan") happens to be. Yes, t

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: Stefan, thanks for the feedback. I don't *think* this is related to issue 7281. I thought we'd determined that that issue had nothing to do with copysign itself, and everything to do with what the signbit of the NaN returned by float("nan") happens to be. -

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: David, I'm still missing some easy answers that would really help. Please could you answer the question about whether __EXTENSIONS__ is defined in your pyconfig.h; it would help determine what we should be investigating. There shouldn't be any need for the -

[issue9069] test_float failure on Solaris

2010-06-26 Thread Mark Dickinson
Mark Dickinson added the comment: > I would add I was building 64-bit, so adding the compiler flag -m64 on 'hawk' > at least some of the time. Ah; that may be relevant. Can you tell us exactly what command line you're using to build Python, and the values of any relavent environment variabl

[issue9069] test_float failure on Solaris

2010-06-25 Thread David Kirkby
David Kirkby added the comment: Hi, I had hoped to devote more time to this, but have been able to. I will do at the weekend. I would add I was building 64-bit, so adding the compiler flag -m64 on 'hawk' at least some of the time. Depending on your hardware, assuming you have installed !Ope

[issue9069] test_float failure on Solaris

2010-06-25 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson wrote: > Now that I've finally managed to get gcc 4.4.4 installed on OpenSolaris... > > .. I'm still failing to reproduce this bug. :( > > > dicki...@eratosthenes:~/release26-maint$ uname -a > SunOS eratosthenes 5.11 snv_134 i86pc i386 i86pc Solaris

[issue9069] test_float failure on Solaris

2010-06-25 Thread Mark Dickinson
Mark Dickinson added the comment: Now that I've finally managed to get gcc 4.4.4 installed on OpenSolaris... .. I'm still failing to reproduce this bug. :( dicki...@eratosthenes:~/release26-maint$ uname -a SunOS eratosthenes 5.11 snv_134 i86pc i386 i86pc Solaris dicki...@eratosthenes:~/releas

[issue9069] test_float failure on Solaris

2010-06-25 Thread Mark Dickinson
Mark Dickinson added the comment: David, my pyconfig.h file contains: /* Defined on Solaris to see additional function prototypes. */ #define __EXTENSIONS__ 1 Does yours? -- ___ Python tracker ___

[issue9069] test_float failure on Solaris

2010-06-25 Thread Mark Dickinson
Mark Dickinson added the comment: So perhaps the cause is simply that copysign isn't being declared for David's Python builds? If that were the case, I'd expect to see some gcc warnings in the Python build output, something like: warning: implicit declaration of function `copysign' Davi

[issue9069] test_float failure on Solaris

2010-06-25 Thread Mark Dickinson
Mark Dickinson added the comment: Did you have a chance to try a debug build of Python and see if the problem persists there? I'm failing to reproduce this in OpenSolaris 2009.06, running in Parallels on a MacBook Pro (non-debug 32-bit build of Python): dicki...@eratosthenes:~/release26-main

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: Just to clarify the hostnames and hardware used, in case you look at the results here or the links to the Sage maths bug tracker and are not sure what is what. Note some are Solaris and some are OpenSolaris. Some have SPARC and some have Intel processors. All

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: Hi Mark, Since 'copysign' is in the maths library, I would not expect the link phase to fail. Solaris does not ship with different maths libraries for C99 (one just links to libm). However, I would not be surprised if the behavior was ill defined if the com

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the update. So I'm confused: when -std=c99 isn't given, where is the build finding the copysign function from? That is, why isn't there a link error when building Python? (I'm attempting to install OpenSolaris in Parallels at the moment, but it m

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: Using the compiler option -std=c99 allows this test to pass. Perhaps adding the macro AC_PROG_CC_C99 to autoconf to add the right compiler option might be a solution. I know Solaris headers are often quite strict, and will not define something in a header f

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: I'll take a look at this in an hour or two. I'll restrict the testing to the Xeon machine, as it is a zillion times quicker than the old SPARCs. What comes to my mind, is that perhaps 'copysign' is only defined in C99. Solaris header files are pretty strict ab

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: Just to clarify something, in case you notice something does not look quite right. The link I provided to the build failure on the SPARC machine http://trac.sagemath.org/sage_trac/ticket/9297 was a Sun Blade 1000. It is *not* the same machine from which I jus

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the details. So the relevant code (see the float_hex function in Objects/floatobject.c) looks like this: if (x == 0.0) { if(copysign(1.0, x) == -1.0) return PyString_FromString("-0x0.0p+0"); else return P

[issue9069] test_float failure on Solaris

2010-06-24 Thread David Kirkby
David Kirkby added the comment: Hi Mark, Here's the info on the two systems - first the SPARC system, secondly the Intel Xeon system. 1) SPARC * Sun Blade 2000, with 2 x UltraSPARC III+ 1200 MHZ processors * 8 GB RAM * Solaris 10 update 8 10/09 release (This is the latest release of Sol

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: David, please could you also tell me whether HAVE_COPYSIGN is defined for those builds of Python? It should be in pyconfig.h in the top level of the build directory, if it is. And (just to double check), at configure time, there should be a line in the outp

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: David, would it be possible for you to provide the results of: >>> float.hex(-0.0) >>> float.fromhex('-0x0.0p+0') on those platforms, so that we can tell whether it's the float -> hex conversion or the hex -> float conversion that's losing the sign of the zer

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: And the text of the failure (from the first link David provides): test test_float failed -- Traceback (most recent call last): File "/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/python-2.6.4.p9/src/Lib/test/test_float.py", line 765, in test_roundtrip

[issue9069] test_float failure on Solaris

2010-06-24 Thread Mark Dickinson
New submission from Mark Dickinson : Comment from David Kirkby in issue 8265; moved here because it looks like a separate problem. I'm seeing this failure on both Solaris 10 (SPARC processor) in 32-bit mode and OpenSolaris 06/2009 (Intel Xeon) in 64-bit mode using Python 2.6.4. So it is not