Seg. fault with roots(b)
Sergei Steshenko
sergstesh at yahoo.com
Tue May 5 05:47:05 CDT 2009
--- On Mon, 5/4/09, John W. Eaton <jwe at octave.org> wrote:
> From: John W. Eaton <jwe at octave.org>
> Subject: Re: Seg. fault with roots(b)
> To: "Sergei Steshenko" <sergstesh at yahoo.com>
> Cc: "Robert Jenssen" <robertjenssen at ozemail.com.au>, "Ben Abbott" <bpabbott at mac.com>, bug-octave at octave.org
> Date: Monday, May 4, 2009, 12:23 PM
> On 27-Apr-2009, Sergei Steshenko
> wrote:
>
> | Segfaults on my self-built 3.0.3 and 3.0.4 - 32
> bits Linux. Atlas version
> | is 3.8.2.
> |
> | "
> | panic: Segmentation fault -- stopping myself...
> | attempting to save variables to `octave-core'...
> | save to `octave-core' complete
> | ".
>
> So is this a bug in ATLAS 3.8.x or a change in the
> interface to some
> LAPACK subroutine, or what?
>
> It might help if someone who can reproduce the problem
> would run
> Octave under GDB and find precisely where the crash occurs,
> and maybe
> diagnose why the crash is happening. Are we calling
> an LAPACK
> function incorrectly? Not passing sufficient
> workspace? What?
>
> jwe
>
I am illiterate WRT gdb - have been able to find and fix my bugs using
diagnostic print statements, bu here is an additional piece of info:
"
octave:1> roots(rand(1, 11))
ans =
0.86681 + 0.42220i
0.86681 - 0.42220i
0.45553 + 0.83569i
0.45553 - 0.83569i
-0.13974 + 1.04788i
-0.13974 - 1.04788i
-1.04699 + 0.28372i
-1.04699 - 0.28372i
-0.63653 + 0.55502i
-0.63653 - 0.55502i
octave:2> roots(rand(1, 12))
ans =
0.66823 + 0.81868i
0.66823 - 0.81868i
0.80950 + 0.46852i
0.80950 - 0.46852i
-0.00880 + 1.08928i
-0.00880 - 1.08928i
-0.63962 + 0.93444i
-0.63962 - 0.93444i
-0.74431 + 0.40461i
-0.74431 - 0.40461i
-0.83676 + 0.00000i
octave:3> roots(rand(1, 13))
panic: Segmentation fault -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete
".
I.e. it appears the crash occurs from polynomial degree 12 and above.
I do not know what the interface to ATLAS is, but it doesn't look likely
there is a change at 12.
By the way, 'help' example works:
"
octave:4> help roots
-- Function File: roots (V)
For a vector V with N components, return the roots of the
polynomial
v(1) * z^(N-1) + ... + v(N-1) * z + v(N)
As an example, the following code finds the roots of the quadratic
polynomial
p(x) = x^2 - 5.
c = [1, 0, -5];
roots(c)
=> 2.2361
=> -2.2361
Note that the true result is +/- sqrt(5) which is roughly +/-
2.2361.
See also: compan.
Overloaded function:
groots (galois, ...)
roots is a built-in function
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help at octave.org
mailing list.
octave:5> c = [1, 0, -5];
octave:6> roots(c)
ans =
-2.2361
2.2361
octave:7>
".
Regards,
Sergei.
More information about the Bug-octave
mailing list