From bug-octave-request at bevo dot che dot wisc dot edu Sat Sep 26 00:37:27 1998 Subject: Unpleasant behavior of bessely From: "John W. Eaton" To: ldoolitt at jlab dot org Cc: bug-octave at bevo dot che dot wisc dot edu Date: Sat, 26 Sep 1998 00:35:39 -0500 (CDT) On 5-Sep-1998, ldoolitt at jlab dot org wrote: | Helpful octave maintainers: | | [larry at traveller coax]$ octave | Octave, version 2.0.13 (i586-pc-linux-gnulibc1). | Copyright (C) 1996, 1997, 1998 John W. Eaton. | This is free software with ABSOLUTELY NO WARRANTY. | For details, type `warranty'. | | octave:1> bessely([0 1],1) | ans = | | 0.088257 -0.781213 | | octave:2> bessely([0],1) | error: Segmentation fault -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | | Segmentation fault (core dumped) | [larry at traveller coax]$ | | The problem is pretty clear, if you look at libcruft/specfun/rybesl.f. | That code writes a result into BY(2) without bothering to check if | NB .GT. 1. Sorry I wasn't able to respond until now. My fix was to modify rybesl.f: *** libcruft/specfun/rybesl.f 1997/11/30 21:17:04 1.4 --- libcruft/specfun/rybesl.f 1998/06/23 03:47:31 1.5 *************** *** 406,415 **** C Now have first one or two Y's C---------------------------------------------------------------------- BY(1) = YA ! BY(2) = YA1 ! IF (YA1 .EQ. ZERO) THEN ! NCALC = 1 ! ELSE AYE = ONE + ALPHA TWOBYX = TWO/EX NCALC = 2 --- 406,415 ---- C Now have first one or two Y's C---------------------------------------------------------------------- BY(1) = YA ! NCALC = 1 ! IF (NB .GT. 1) THEN ! BY(2) = YA1 ! IF (YA1 .NE. ZERO) THEN AYE = ONE + ALPHA TWOBYX = TWO/EX NCALC = 2 *************** *** 425,430 **** --- 425,431 ---- AYE = AYE + ONE NCALC = NCALC + 1 400 CONTINUE + END IF END IF 450 DO 460 I = NCALC+1, NB BY(I) = ZERO Thanks, jwe