On 11-Jun-2009, Rafael Laboissiere wrote: | * John W. Eaton <j...@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)
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 -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org