Skip to content

math test fails on Solaris 10 #47417

Closed
Closed

Description

@MrJean1
mannequin
BPO 3167
Nosy @loewis, @smontanaro, @terryjreedy, @mdickinson
Files
  • math_log.patch: Possible fix for math.log and math.log10 failures
  • Python-2.6.1-32bit-Solaris10-math_patch.log
  • Python-2.6.1-64bit-Solaris10-math_patch.log
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mdickinson'
    closed_at = <Date 2008-12-11.22:06:17.642>
    created_at = <Date 2008-06-21.21:47:19.307>
    labels = ['type-bug', 'tests']
    title = 'math test fails on Solaris 10'
    updated_at = <Date 2008-12-11.22:06:17.641>
    user = 'https://bugs.python.org/MrJean1'

    bugs.python.org fields:

    activity = <Date 2008-12-11.22:06:17.641>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2008-12-11.22:06:17.642>
    closer = 'mark.dickinson'
    components = ['Tests']
    creation = <Date 2008-06-21.21:47:19.307>
    creator = 'MrJean1'
    dependencies = []
    files = ['12251', '12307', '12308']
    hgrepos = []
    issue_num = 3167
    keywords = ['patch']
    message_count = 47.0
    messages = ['68548', '68560', '68561', '68594', '68624', '68627', '68637', '68699', '68706', '68707', '68719', '68762', '68763', '68836', '68837', '68849', '68867', '68870', '68878', '68880', '68882', '68885', '68886', '68888', '68892', '68893', '68903', '68907', '68911', '68918', '68933', '68938', '68940', '68952', '68953', '68954', '68980', '69441', '69443', '69450', '69452', '69455', '77147', '77152', '77452', '77627', '77634']
    nosy_count = 5.0
    nosy_names = ['loewis', 'skip.montanaro', 'terry.reedy', 'mark.dickinson', 'MrJean1']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3167'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1']

    Activity

    1. MrJean1 commented on Jun 21, 2008

      MrJean1mannequin
      MannequinAuthor

      There are 2 math test failures with 32-bit Python 2.6b1 and 3.0b1 on
      Solaris 10 both built with Sun's C compiler. The failures do *not*
      occur for the 64-bit builds. The same compiler options are used for all
      these builds (except -xtarget=native vs -xtarget=native64).

      ======================================================================
      FAIL: testLog (main.MathTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "Lib/test/test_math.py", line 419, in testLog
          self.assertRaises(ValueError, math.log, NINF)
      AssertionError: ValueError not raised

      ======================================================================
      FAIL: testLog10 (main.MathTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "Lib/test/test_math.py", line 441, in testLog10
          self.assertRaises(ValueError, math.log10, NINF)
      AssertionError: ValueError not raised

    2. added
      tests
      type-bug
      on Jun 21, 2008
    3. mdickinson commented on Jun 22, 2008

      @mdickinson
      Member

      I'll take a look.

    4. self-assigned this
      on Jun 22, 2008
    5. mdickinson commented on Jun 22, 2008

      @mdickinson
      Member

      Could you tell me what

      >> import math
      >> math.log(float('-inf'))

      gives instead of the expected ValueError?

    6. MrJean1 commented on Jun 22, 2008

      MrJean1mannequin
      MannequinAuthor

      Here is that in from 32- and 64-bit Python 2.6b1:

      > ./python (32-bit)
      Python 2.6b1 (r26b1:64398, Jun 20 2008, 09:20:49) [C] on sunos5
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import math
      >>> math.log(float('-inf'))
      -inf
      >>> math.log(float('inf'))
      inf
      >>> math.log(float('nan'))
      nan
      
      > ./python (64-bit)                  
      Python 2.6b1 (r26b1:64398, Jun 19 2008, 20:27:39) [C] on sunos5
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import math
      >>> math.log(float('-inf'))
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ValueError: math domain error
      >>> math.log(float('inf'))         
      inf
      >>> math.log(float('nan'))
      nan

      Look like a Sun issue, doesn't it?

    7. mdickinson commented on Jun 23, 2008

      @mdickinson
      Member

      Judging by the information at

      http://docs.sun.com/app/docs/doc/802-1930-03/6i5u95u0i?
      l=en&a=view&q=matherr

      this behaviour is intentional. It looks like log(-inf)
      sets errno = EDOM and returns -inf. An IEEE 754
      conforming math library would return NaN instead.

      I've no idea why the 64-bit build doesn't exhibit
      this problem.

      math_1 in Modules/mathmodule.c bases its error reporting
      primarily on return values, only looking at errno in the
      case when a finite value is returned. So it doesn't
      ever take any notice of the EDOM errno value.

      Unfortunately, changing this would likely cause failures
      on other machines. GNU libc is all over the place when
      it comes to setting errno: I recall finding that on one
      Linux machine, of the three calls atanh(1.), log(0.) and
      log10(0.), one of these sets errno = EDOM, one sets errno
      = ERANGE, and one doesn't set errno at all. (All three
      calls correspond to logarithmic singularities, and should
      all behave the same way.)

      One obvious solution is to write a matherr function
      for use on Solaris, as described on the man page
      above. Do you think you could have a
      go at this?

    8. mdickinson commented on Jun 23, 2008

      @mdickinson
      Member

      On second thoughts, forget about matherr---looks like it's
      outdated technology.

    9. MrJean1 commented on Jun 23, 2008

      MrJean1mannequin
      MannequinAuthor

      Here is a simple test case, demonstrating the issue.

      #include <errno.h>
      #include <math.h>
      #include <stdio.h>
      
      int main(int argc, char *argv[])
      {
          printf("%f %d\n", log(-HUGE_VAL), errno);
          printf("%f %d\n", log( HUGE_VAL), errno);
      }

      result is different for 32- and 64-bit

      cc -xtarget=native log_inf.c -lm ; a.out
      -Inf 33
      Inf 33

      cc -xtarget=native64 log_inf.c -lm ; a.out
      -NaN 0
      Inf 0

      #define EDOM 33 in /usr/include/sys/errno.h
    10. mdickinson commented on Jun 24, 2008

      @mdickinson
      Member

      On Mon, Jun 23, 2008 at 5:25 PM, Jean Brouwers <report@bugs.python.org>
      wrote:

      result is different for 32- and 64-bit

      > cc -xtarget=native log_inf.c -lm ; a.out
      -Inf 33
      Inf 33

      That 33 for the second log call may just be the propagated errno value
      from the first call. Could you try setting errno = 0 before each of the
      printf
      calls? I'd expect that log(HUGE_VAL) doesn't set errno at all.

      Mark

    11. MrJean1 commented on Jun 24, 2008

      MrJean1mannequin
      MannequinAuthor

      Right on! With errno = 0; in between both calls:

      -Inf 33
      Inf 0

      /Jean

      On Tue, Jun 24, 2008 at 1:17 PM, Mark Dickinson <report@bugs.python.org> wrote:

      Mark Dickinson <dickinsm@gmail.com> added the comment:

      On Mon, Jun 23, 2008 at 5:25 PM, Jean Brouwers <report@bugs.python.org>
      wrote:

      > result is different for 32- and 64-bit
      >
      > > cc -xtarget=native log_inf.c -lm ; a.out
      > -Inf 33
      > Inf 33
      >

      That 33 for the second log call may just be the propagated errno value
      from the first call. Could you try setting errno = 0 before each of the
      printf
      calls? I'd expect that log(HUGE_VAL) doesn't set errno at all.

      Mark

      Added file: http://bugs.python.org/file10722/unnamed


      Python tracker <report@bugs.python.org>
      <http://bugs.python.org/issue3167\>


    12. MrJean1 commented on Jun 24, 2008

      MrJean1mannequin
      MannequinAuthor

      Mark,

      Take a look at the SUN forum, there is a (long) answer.

      <http://forum.java.sun.com/thread.jspa?threadID=5308106&tstart=0\>

      /Jean

      On Tue, Jun 24, 2008 at 3:37 PM, Jean Brouwers <report@bugs.python.org> wrote:
      >
      > Jean Brouwers <MrJean1@Gmail.com> added the comment:
      >
      > Right on!  With errno = 0; in between both calls:
      >
      > -Inf 33
      > Inf 0
      >
      > /Jean
      >
      > On Tue, Jun 24, 2008 at 1:17 PM, Mark Dickinson <report@bugs.python.org> wrote:
      >>
      >> Mark Dickinson <dickinsm@gmail.com> added the comment:
      >>
      >> On Mon, Jun 23, 2008 at 5:25 PM, Jean Brouwers <report@bugs.python.org>
      >> wrote:
      >>
      >>> result is different for 32- and 64-bit
      >>>
      >>> > cc -xtarget=native log_inf.c -lm ; a.out
      >>> -Inf 33
      >>> Inf 33
      >>>
      >>
      >> That 33 for the second log call may just be the propagated errno value
      >> from the first call.  Could you try setting errno = 0 before each of the
      >> printf
      >> calls?  I'd expect that log(HUGE_VAL) doesn't set errno at all.
      >>
      >> Mark
      >>
      >> Added file: http://bugs.python.org/file10722/unnamed
      >>
      >> _______________________________________
      >> Python tracker <report@bugs.python.org>
      >> <http://bugs.python.org/issue3167>
      >> _______________________________________
      >
      > _______________________________________
      > Python tracker <report@bugs.python.org>
      > <http://bugs.python.org/issue3167>
      > _______________________________________
      >
    13. mdickinson commented on Jun 25, 2008

      @mdickinson
      Member

      Nice reply from zal. His conclusion:

      The short answer to your question is to use the cc -xlibmieee
      option (and not rely on errno in the case of log(-Inf)) if you
      would like to see results in the spirit of IEEE 754.

      It sounds like using the -xlibmieee flag is the way to go. (math_1 is
      already doing an excellent job of not relying on errno).

      Could you try compiling with this flag to see whether it fixes the
      problem? (Opening up the 'configure' file and adding the flag to
      BASECFLAGS might be the easiest way to do this; there may be easier
      ways.) If it does, I'll cook up a configure patch.

    14. MrJean1 commented on Jun 25, 2008

      MrJean1mannequin
      MannequinAuthor

      Unless I am doing something wrong, that flag does not fix the problem.

      #include <errno.h>
      #include <math.h>
      #include <stdio.h>
      
      int main(int argc, char *argv[])
      {
          errno = 0;
          printf("%f %d\n", log(-HUGE_VAL), errno);
          errno = 0;
          printf("%f %d\n", log( HUGE_VAL), errno);
      }

      /* result is different for 32- and 64-bit

      rm a.out; cc -xtarget=native -xlibmieee log_inf.c -lm ; a.out
      -NaN 33
      Inf 0

      rm a.out ; cc -xtarget=native64 -xlibmieee log_inf.c -lm ; a.out
      -NaN 0
      Inf 0

      #define EDOM 33 in /usr/include/sys/errno.h

      */

    15. 26 remaining items

    16. MrJean1 commented on Jun 29, 2008

      MrJean1mannequin
      MannequinAuthor

      What about this case? Should cmath not produce the same result as math:

      >>> math.log(float('-inf'))
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ValueError: math domain error
      
      >>> cmath.log(float('-inf'))
      (inf+3.1415926535897931j)
      >>> cmath.log(complex(float('-inf'), 0))
      (inf+3.1415926535897931j)

      This occurs in all 32- and 64-bit builds (with -xlibmieee and SUN C) on
      Solaris 10 (Opteron) and on 32-bit MacOS X 10.4.11 (Intel) built with
      gcc.

    17. mdickinson commented on Jun 29, 2008

      @mdickinson
      Member

      What about this case? Should cmath not produce the same result as math:

      No; this is correct, I think. Note that the cmath.log result has nonzero
      imaginary part, so can't be represented as a float.

      Similarly, math.sqrt(-1) is an error, while cmath.sqrt(-1) returns a
      complex result and doesn't raise any exception.

    18. smontanaro commented on Jun 30, 2008

      @smontanaro
      Contributor

      I tried to configure with '-Xlinker -xlibmieee' added to LDFLAGS. Failed
      miserably. In fact, configure complained that my compiler couldn't create
      executables, told me to look at config.log for details then logged me out
      from the machine! It would appear gcc *really* doesn't like that
      combination:

      ...
      configure:2676: checking for C compiler default output file name
      configure:2703: gcc -I/opt/app/nonc++/ncurses-5.6/include -
      I/opt/app/nonc++/ncu
      rses-5.6/include/ncurses -I/opt/app/nonc++/gdbm-1.8/include -
      I/opt/app/nonc++/re
      adline-4.3/include -I/opt/app/nonc++/tcl-8.4/include -
      I/opt/app/nonc++/BerkleyDB
      -4.3/include -L/opt/app/nonc++/ncurses-5.6/lib -R/opt/app/nonc++/ncurses-
      5.6/lib
      -L/opt/app/nonc++/gdbm-1.8/lib -R/opt/app/nonc++/gdbm-1.8/lib -
      L/opt/app/nonc++
      /readline-4.3/lib -R/opt/app/nonc++/readline-4.3/lib -L/opt/app/nonc++/tcl-
      8.4/l
      ib -R/opt/app/nonc++/tcl-8.4/lib -L/opt/app/nonc++/BerkleyDB-4.3/lib -
      R/opt/app/
      nonc++/BerkleyDB-4.3/lib -Xlinker -xlibmieee conftest.c >&5
      /usr/ccs/bin/ld: illegal option -- x
      usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:P:Q:R:S:VY:?]
      file(s)
      [-64] enforce a 64-bit link-edit
      [-a] create an absolute file
      [-b] do not do special PIC relocations in a.out
      [-B direct | nodirect]
      establish direct bindings, or inhibit direct binding
      to, the object being created
      ...

      Skip

    19. mdickinson commented on Jul 8, 2008

      @mdickinson
      Member

      I'm pretty much out of ideas here. Skip, if you have any time to figure
      out where the math.log call is going wrong, I'd appreciate it. On Jean's
      machine, the problem was that the call log(-inf) to the C library's log
      function was returning -inf instead of the expected nan.

      The actual function call takes place in math_1, in the line
      "r = (*func)(x)" (line 178 of Modules/mathmodule.c in the current trunk,
      r64812). A couple of printf calls would show the inputs and outputs to
      that function.

      Is /usr/bin/ccs/ld Sun's own linker? If so, why doesn't it accept the -
      xlibmieee option? (Or maybe it does, in which case the question is why
      isn't gcc passing that option to ld properly.)

    20. mdickinson commented on Jul 8, 2008

      @mdickinson
      Member

      Some other possibilities to try. This page:

      http://www.redhat.com/docs/wp/solaris_port/x99.html

      seems to suggest that linking with -lieee, and possibly also adding the -
      ffast-math gcc option, might help.

    21. smontanaro commented on Jul 9, 2008

      @smontanaro
      Contributor

      Here's a gdb session using r64812. gcc 4.2.2. ldd on math.so shows:

      % ldd build/lib.solaris-2.10-i86pc-2.6/math.so
      libm.so.2 => /lib/libm.so.2
      libgcc_s.so.1 => /opt/app/nonc++/lib/libgcc_s.so.1
      libc.so.1 => /lib/libc.so.1

      % gdb ./python
      GNU gdb 6.8
      Copyright (C) 2008 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later
      <http://gnu.org/licenses/gpl.html\>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law. Type "show
      copying"
      and "show warranty" for details.
      This GDB was configured as "i386-pc-solaris2.10"...
      (gdb) b math_1
      Function "math_1" not defined.
      Make breakpoint pending on future shared library load? (y or [n]) y

      Breakpoint 1 (math_1) pending.
      (gdb) r
      Starting program: /home/tuba/skipm/src/python-svn/trunk/build/python 
      Python 2.6b1+ (trunk:64812M, Jul  8 2008, 20:43:40) 
      [GCC 4.2.2] on sunos5
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import math
      >>> inf = float('inf')
      >>> math.log(-inf)

      Breakpoint 1, math_1 (arg=0x81f1fbc, func=0x805e88c <log@plt>,
      can_overflow=0)
      at /home/tuba/skipm/src/python-svn/trunk/Modules/mathmodule.c:171
      171 {
      (gdb) p func
      $1 = (double (*)(double)) 0x805e88c <log@plt>
      (gdb) n
      173 x = PyFloat_AsDouble(arg);
      (gdb) n
      174 if (x == -1.0 && PyErr_Occurred())
      (gdb) x
      0x0: Cannot access memory at address 0x0
      (gdb) p x
      $2 = -inf
      (gdb) n
      176 errno = 0;
      (gdb) n
      178 r = (*func)(x);
      (gdb) n
      180 if (Py_IS_NAN(r)) {
      (gdb) p r
      $3 = -inf

      Does this help? I don't know how to tell where log@plt is resolved, but
      I suppose it probably comes from /lib/libm.so.2. It's got a date on my
      system of Jan 22 2005. Any idea how to tell if there's a Sun patch for
      it?

      As for the /usr/ccs/bin/ld thing, it doesn't look like we are using it,
      at least not directly. Adding the --verbose flag to the link line I get
      this output:

      % gcc --verbose -L/opt/app/nonc++/ncurses-5.6/lib -
      R/opt/app/nonc++/ncurses-5.6/lib -L/opt/app/nonc++/gdbm-1.8/lib -
      R/opt/app/nonc++/gdbm-1.8/lib -L/opt/app/nonc++/readline-4.3/lib -
      R/opt/app/nonc++/readline-4.3/lib -L/opt/app/nonc++/tcl-8.4/lib -
      R/opt/app/nonc++/tcl-8.4/lib -L/opt/app/nonc++/BerkleyDB-4.3/lib -
      R/opt/app/nonc++/BerkleyDB-4.3/lib -o python
      Modules/python.o libpython2.6.a -lresolv -lsocket -lnsl
      -lrt -ldl -lm
      Reading specs from /opt/app/g++lib6/gcc-4.2/lib/gcc/i386-pc-
      solaris2.10/4.2.2/specs
      Target: i386-pc-solaris2.10
      Configured with: ../configure --prefix=/opt/app/g++lib6/gcc-4.2 --
      enable-languages=c,c++,fortran,objc --disable-nls --with-included-
      gettext --with-gnu-as --with-as=/usr/sfw/bin/gas --with-target-
      tools=/usr/sfw/bin/ --with-gmp=/opt/app/nonc++/gmp-4.2 --with-
      mpfr=/opt/app/nonc++/mpfr-2.3
      Thread model: posix
      gcc version 4.2.2
      /opt/app/g++lib6/gcc-4.2/libexec/gcc/i386-pc-solaris2.10/4.2.2/collect2
      -V -R/opt/app/nonc++/lib -R/opt/app/g++lib6/lib -
      R/opt/app/nonc++/ncurses-5.6/lib -R/opt/app/nonc++/gdbm-1.8/lib -
      R/opt/app/nonc++/readline-4.3/lib -R/opt/app/nonc++/tcl-8.4/lib -
      R/opt/app/nonc++/BerkleyDB-4.3/lib -Y P,/usr/ccs/lib:/usr/lib -Qy -o
      python /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o
      /opt/app/g++lib6/gcc-4.2/lib/gcc/i386-pc-solaris2.10/4.2.2/crtbegin.o -
      L/opt/app/nonc++/ncurses-5.6/lib -L/opt/app/nonc++/gdbm-1.8/lib -
      L/opt/app/nonc++/readline-4.3/lib -L/opt/app/nonc++/tcl-8.4/lib -
      L/opt/app/nonc++/BerkleyDB-4.3/lib -L/opt/app/g++lib6/gcc-
      4.2/lib/gcc/i386-pc-solaris2.10/4.2.2 -L/opt/app/g++lib6/gcc-
      4.2/lib/gcc/i386-pc-solaris2.10/4.2.2/../../.. Modules/python.o
      libpython2.6.a -lresolv -lsocket -lnsl -lrt -ldl -lm -lgcc -lgcc_eh -lc
      -lgcc -lgcc_eh /opt/app/g++lib6/gcc-4.2/lib/gcc/i386-pc-
      solaris2.10/4.2.2/crtend.o /usr/lib/crtn.o
      ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.482

      I don't see /usr/ccs/bin/ld mentioned.

      Skip

    22. smontanaro commented on Jul 9, 2008

      @smontanaro
      Contributor

      Regarding -lieee, I don't see an ieee library on my system.

      Regarding -ffast-math, while it changes the log function which is linked
      to, it doesn't appear to modify the result of math.log:

      % ldd build/lib.solaris-2.10-i86pc-2.6/math.so
      libm.so.2 => /lib/libm.so.2
      libgcc_s.so.1 => /opt/app/nonc++/lib/libgcc_s.so.1
      libc.so.1 => /lib/libc.so.1
      % gdb ./python
      GNU gdb 6.8
      Copyright (C) 2008 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later
      <http://gnu.org/licenses/gpl.html\>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law. Type "show
      copying"
      and "show warranty" for details.
      This GDB was configured as "i386-pc-solaris2.10"...
      (gdb) b math_1
      Function "math_1" not defined.
      Make breakpoint pending on future shared library load? (y or [n]) y

      Breakpoint 1 (math_1) pending.
      (gdb) r
      Starting program: /home/tuba/skipm/src/python-svn/trunk/build/python 
      Python 2.6b1+ (trunk:64812M, Jul  8 2008, 21:40:26) 
      [GCC 4.2.2] on sunos5
      Type "help", "copyright", "credits" or "license" for more information.
      im>>> import math
      >>> inf = float('inf')
      >>> math.log(-inf)

      Breakpoint 1, math_1 (arg=0x81f19bc, func=0xfee2d6a0 <log>,
      can_overflow=0)
      at /home/tuba/skipm/src/python-svn/trunk/Modules/mathmodule.c:171
      171 {
      (gdb) func
      Undefined command: "func". Try "help".
      (gdb) p func
      $1 = (double (*)(double)) 0xfee2d6a0 <log>
      (gdb) n
      173 x = PyFloat_AsDouble(arg);
      (gdb) n
      174 if (x == -1.0 && PyErr_Occurred())
      (gdb) p x
      $2 = -inf
      (gdb) n
      176 errno = 0;
      (gdb) n
      178 r = (*func)(x);
      (gdb) n
      186 else if (Py_IS_INFINITY(r)) {
      (gdb) p r
      $3 = -inf

    23. MrJean1 commented on Jul 9, 2008

      MrJean1mannequin
      MannequinAuthor

      The /lib/libm.so.* files on my Solaris 10 (Opteron) box are equally old:

      ll /lib/libm.so*
      lrwxrwxrwx 1 root root 9 Sep 7 2006 /lib/libm.so -> libm.so.2*
      -rwxr-xr-x 1 root bin 13536 Jan 22 2005 /lib/libm.so.1
      -rwxr-xr-x 1 root bin 337804 Jan 22 2005 /lib/libm.so.2

      Also, this looks like a more recent patch for the Math libraries, under 3.2:

      <http://developers.sun.com/sunstudio/downloads/express_readme.html\>

      Then thare are the Studio patches SUN recommended the other day:

      <http://developers.sun.com/sunstudio/downloads/patches/ss11_patches.html\>

      If things change after I install those, I will certainly let you know.

      /Jean Brouwers

    24. mdickinson commented on Dec 6, 2008

      @mdickinson
      Member

      Skip, Jean:

      Could you try the attached patch to see if it fixes the math.log and
      math.log10 test failures. (The patch is generated against the trunk, but
      should apply cleanly to py3k or either of the 2.6 or 3.0 maintenance
      branches.

    25. smontanaro commented on Dec 6, 2008

      @smontanaro
      Contributor

      Mark> Could you try the attached patch to see if it fixes the math.log
      Mark> and math.log10 test failures. (The patch is generated against the
      Mark> trunk, but should apply cleanly to py3k or either of the 2.6 or
      Mark> 3.0 maintenance branches.

      Seems to work on Sol10 for me:

      % ./python [Lib/test/regrtest.py](https://github.com/python/cpython/blob/main/Lib/test/regrtest.py) -v test_math 
      test_math
      testAcos (test.test_math.MathTests) ... ok
      testAcosh (test.test_math.MathTests) ... ok
      testAsin (test.test_math.MathTests) ... ok
      testAsinh (test.test_math.MathTests) ... ok
      testAtan (test.test_math.MathTests) ... ok
      testAtan2 (test.test_math.MathTests) ... ok
      testAtanh (test.test_math.MathTests) ... ok
      testCeil (test.test_math.MathTests) ... ok
      testConstants (test.test_math.MathTests) ... ok
      testCopysign (test.test_math.MathTests) ... ok
      testCos (test.test_math.MathTests) ... ok
      testCosh (test.test_math.MathTests) ... ok
      testDegrees (test.test_math.MathTests) ... ok
      testExp (test.test_math.MathTests) ... ok
      testFabs (test.test_math.MathTests) ... ok
      testFactorial (test.test_math.MathTests) ... ok
      testFloor (test.test_math.MathTests) ... ok
      testFmod (test.test_math.MathTests) ... ok
      testFrexp (test.test_math.MathTests) ... ok
      testFsum (test.test_math.MathTests) ... ok
      testHypot (test.test_math.MathTests) ... ok
      testIsinf (test.test_math.MathTests) ... ok
      testIsnan (test.test_math.MathTests) ... ok
      testLdexp (test.test_math.MathTests) ... ok
      testLog (test.test_math.MathTests) ... ok
      testLog10 (test.test_math.MathTests) ... ok
      testLog1p (test.test_math.MathTests) ... ok
      testModf (test.test_math.MathTests) ... ok
      testPow (test.test_math.MathTests) ... ok
      testRadians (test.test_math.MathTests) ... ok
      testSin (test.test_math.MathTests) ... ok
      testSinh (test.test_math.MathTests) ... ok
      testSqrt (test.test_math.MathTests) ... ok
      testTan (test.test_math.MathTests) ... ok
      testTanh (test.test_math.MathTests) ... ok
      test_exceptions (test.test_math.MathTests) ... ok
      test_testfile (test.test_math.MathTests) ... ok
      test_trunc (test.test_math.MathTests) ... ok
      Doctest: ieee754.txt ... ok
      
      \----------------------------------------------------------------------
      Ran 39 tests in 0.237s
      
      OK
      1 test OK.
      

      Skip

    26. MrJean1 commented on Dec 9, 2008

      MrJean1mannequin
      MannequinAuthor

      It looks like the patch did fix the problems. Attached are the results
      for 32- and 64-bit Python 2.6.1 with and without the patch, all built with
      SUN's compilers on Solaris 10 (Opteron).

      The math log tests failed with the 32-bit build before and passed after
      applying the patch. The 64-bit build passed before and still passes after
      the patch.

    27. mdickinson commented on Dec 11, 2008

      @mdickinson
      Member

      Thanks, both!

      Fixed in the trunk in r67707. I'll wait to be sure that the buildbots are
      happy, then merge to 2.6, 3.0, 3.1.

    28. mdickinson commented on Dec 11, 2008

      @mdickinson
      Member

      Buildbots seem content. Merged to 2.6, 3.0, 3.1.

    29. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    teststype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions