[Pkgoctavedevel] Bug#532656: Bug#532656: Bug#532656: Bug#532656: Bug#532656: Bug#532656: octave3.2_3.2.01(mips/unstable): FTBFS on mips. Segfault in regression test.
John W. Eaton
jwe at octave.org
Thu Jun 11 19:42:13 UTC 2009
On 11Jun2009, Rafael Laboissiere wrote:
 * John W. Eaton <jwe at bevo.che.wisc.edu> [20090611 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)
Did you compile the simpler program with the same options used to
build Octave?
Can you run Octave under gdb and find where it hangs, either by
running
log2 (complex (0, inf))
and interrupting it when the hang happens and getting a stack trace,
or by stepping through the log2 function (and the functions it calls)
to find where it hangs?
jwe
More information about the Pkgoctavedevel
mailing list