[Pkg-octave-devel] Bug#532656: Bug#532656: Bug#532656: Bug#532656: Bug#532656: octave3.2_3.2.0-1(mips/unstable): FTBFS on mips. Segfault in regression test.

Rafael Laboissiere rafael at debian.org
Thu Jun 11 18:49:16 UTC 2009


* John W. Eaton <jwe at bevo.che.wisc.edu> [2009-06-11 11:27]:

> So first, can you determine precisely where Octave is actually
> hannging?  Does the following program work, or does it also hang in
> the same way?
> 
>   #include <cmath>
>   #include <complex>
>   #include <iostream>
> 
>   typedef std::complex<double> Complex;
> 
>   Complex
>   xlog2 (const Complex& x)
>   {
>   #if defined (M_LN2)
>     static double ln2 = M_LN2;
>   #else
>     static double ln2 = log (2);
>   #endif
> 
>     return std::log (x) / ln2;
>   }
> 
>   int
>   main (void)
>   {
>     std::complex<double> inf_i (0.0, 1.0/0.0);
>     std::cerr << inf_i << std::endl;
>     std::complex<double> result = xlog2 (inf_i);
>     std::cerr << result << std::endl;
>     return 0;
>   }
> 
> I expect this program to print:
> 
>   (0,inf)
>   (inf,2.26618)
> 
> but if it hangs, then I think the problem is in the C++ or C library
> functions, not Octave.

No, it does not hang, but produces the following:

    (0,inf)
    (nan,nan)

On my Debian sid chroot on amd64, it produces:

    (0,inf)
    (inf,nan)

-- 
Rafael





More information about the Pkg-octave-devel mailing list