Bug #6267

Segmentation fault when exponentiating complex number

Added by Pablo Herrero almost 3 years ago. Updated almost 3 years ago.

[ruby-core:44170]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux] Backport:

Description

A segfault is raised when running the following script, with any exponent greater or equal to 5:

require "mathn/complex"
Complex(0,1)**5

It only seems to happen when exponentiating pure imaginary numbers and if 'mathn/coplex' is loaded, otherwise it works just fine.

segfaul.backtrace - backtrace (7.49 KB) Pablo Herrero, 04/07/2012 08:15 AM

Associated revisions

Revision 35262
Added by Yui NARUSE almost 3 years ago

  • complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum with mathn. [Bug #6267]

Revision 35262
Added by Yui NARUSE almost 3 years ago

  • complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum with mathn. [Bug #6267]

History

#1 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35262.
Pablo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum with mathn. [Bug #6267]

#2 Updated by tadayoshi funaba almost 3 years ago

  • Status changed from Closed to Open

the following still does

Complex(0,1)**2

#3 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Open to Closed

tadf fixed it at r35265.

Also available in: Atom PDF