Skip to content

Package tseries: crash for Windows version (PR#2302)

5 messages · Kenneth Cabrera, Peter Dalgaard, Brian Ripley +1 more

#
ripley at stats.ox.ac.uk wrote:

            
I did (both R and tseries).
I build the tseries packages with the "Rcmd" command and also with "make 
pkg-tseries" command.
I now check the package (so maybe the problem is in the package) with:
"make pkgcheck-tseries"
And the execution crashes with this output (tseries-Ex.Rout file)  on 
the garch example:

 > ###--- >>> `garch' <<<----- Fit GARCH Models to Time Series
 >
 >     ## alias     help(garch)
 >
 > ##___ Examples ___:
 >
 > n <- 1100
 > a <- c(0.1, 0.5, 0.2)  # ARCH(2) coefficients
 > e <- rnorm(n) 
 > x <- double(n)
 > x[1:2] <- rnorm(2, sd = sqrt(a[1]/(1.0-a[2]-a[3])))
 > for(i in 3:n)  # Generate ARCH(2) process
+ {
+   x[i] <- e[i]*sqrt(a[1]+a[2]*x[i-1]^2+a[3]*x[i-2]^2)
+ }
 > x <- ts(x[101:1100])
 > x.arch <- garch(x, order = c(0,2))  # Fit ARCH(2)

 ***** ESTIMATION WITH ANALYTICAL GRADIENT *****


     I     INITIAL X(I)        D(I)

     1     0.334425E+00     0.100E+01
     2     0.500000E-01     0.100E+01
     3     0.500000E-01     0.100E+01

    IT   NF       F        RELDF    PRELDF    RELDX   STPPAR   D*STEP   
NPRELDF

     0    1 -0.119E+03
     1    3 -0.174E+03  0.32E+00  0.40E+00  0.1E+00  0.7E+04  0.1E+00  
0.14E+04
     2    5 -0.221E+03  0.21E+00  0.24E+00  0.2E+00  0.8E+01  0.1E+00  
0.14E+04
     3    6 -0.240E+03  0.80E-01  0.14E+00  0.2E+00  0.6E+01  0.1E+00  
0.44E+02
     4    7 -0.243E+03  0.13E-01  0.12E+00  0.1E+00  0.2E+01  0.1E+00  
0.13E+02
     5    8 -0.261E+03  0.69E-01  0.68E-01  0.1E+00  0.2E+01  0.1E+00  
0.25E+01
     6    9 -0.262E+03  0.22E-02  0.24E-01  0.1E+00  0.3E+01  0.1E+00  
0.58E+00
     7   10 -0.265E+03  0.12E-01  0.32E-01  0.4E-01  0.2E+01  0.5E-01  
0.54E+00
     8   11 -0.266E+03  0.36E-02  0.50E-02  0.4E-01  0.2E+01  0.5E-01  
0.10E+00
     9   14 -0.266E+03  0.38E-03  0.84E-03  0.5E-02  0.3E+01  0.7E-02  
0.26E+00
    10   15 -0.266E+03  0.69E-03  0.83E-03  0.5E-02  0.2E+01  0.7E-02  
0.10E+00
    11   16 -0.266E+03  0.58E-03  0.87E-03  0.1E-01  0.2E+01  0.1E-01  
0.52E-01
    12   17 -0.266E+03  0.23E-03  0.15E-02  0.2E-01  0.2E+01  0.3E-01  
0.96E-02
    13   18 -0.267E+03  0.11E-02  0.14E-02  0.3E-01  0.2E+01  0.3E-01  
0.75E-02
    14   19 -0.267E+03  0.97E-04  0.19E-03  0.2E-01  0.0E+00  0.2E-01  
0.19E-03
    15   22 -0.267E+03  0.44E-04  0.76E-04  0.1E-02  0.4E+01  0.1E-02  
0.25E-03
    16   24 -0.267E+03  0.16E-04  0.16E-04  0.3E-02  0.6E+00  0.3E-02  
0.21E-04
    17   25 -0.267E+03  0.40E-05  0.45E-05  0.3E-02  0.0E+00  0.3E-02  
0.45E-05
    18   27 -0.267E+03  0.25E-06  0.39E-06  0.5E-03  0.1E+01  0.6E-03  
0.58E-06
    19   28 -0.267E+03  0.15E-07  0.16E-07  0.2E-03  0.0E+00  0.2E-03  
0.16E-07
    20   29 -0.267E+03  0.38E-10  0.38E-10  0.8E-05  0.0E+00  0.8E-05  
0.38E-10

 ***** RELATIVE FUNCTION CONVERGENCE *****

 FUNCTION    -0.266614E+03   RELDX        0.812E-05
 FUNC. EVALS      29         GRAD. EVALS      21
 PRELDF       0.384E-10      NPRELDF      0.384E-10

     I      FINAL X(I)        D(I)          G(I)

     1    0.935455E-01     0.100E+01    -0.107E-03
     2    0.505532E+00     0.100E+01    -0.676E-05
     3    0.212453E+00     0.100E+01    -0.114E-04

 >Your long-suffering Windows package compiler.

I hope I will not make you suffer too much  ;-)
#
Mehmet Balcilar <mbalcilar at manas.kg> writes:
Ah-ha! Could you redo that with R -d gdb, please? (use the "bt"
command at the segfault).

It's not happening to me with 1.7.0 under RH7.3, so I suppose it could
be something compiler specific, or maybe the random number generation
(I don't get the same results either).

  
    
#
Before we get too much of this, Duncan Murdoch has found that
predict.garch calls its C code with one too few arguments.  That would be
consistent with the crashes seen on some builds and not others.

I think it is in the maintainers' court.
On 18 Nov 2002, Peter Dalgaard BSA wrote:

            

  
    
#
I also have the same bug under Linux. As far as I know, this is not new. 
I it had for almost a year, with previous versions of R and tseries Here 
is the relevant information.

 > R.version
         _               
platform i686-pc-linux-gnu
arch     i686            
os       linux-gnu       
system   i686, linux-gnu 
status                   
major    1               
minor    6.1             
year     2002            
month    11              
day      01              
language R               
 > Sys.info()
                           sysname                            release
                           "Linux"                     "2.4.19-16mdk"
                           version                           nodename
"#1 Fri Sep 20 18:15:05 CEST 2002"                   "rifle.manas.kg"
                           machine                              login
                            "i686"                          "unknown"
                              user
                          "mehmet"

 > library(tseries)

    `tseries' version: 0.9-4
 
    `tseries' is a package for time series analysis
     and computational finance.
     See `library (help=tseries)' for details.

 > example(garch)

garch> n <- 1100

garch> a <- c(0.1, 0.5, 0.2)

garch> e <- rnorm(n)

garch> x <- double(n)

garch> x[1:2] <- rnorm(2, sd = sqrt(a[1]/(1 - a[2] - a[3])))

garch> for (i in 3:n) {
    x[i] <- e[i] * sqrt(a[1] + a[2] * x[i - 1]^2 + a[3] * x[i -
        2]^2)
}

garch> x <- ts(x[101:1100])

garch> x.arch <- garch(x, order = c(0, 2))

 ***** ESTIMATION WITH ANALYTICAL GRADIENT *****


     I     INITIAL X(I)        D(I)

     1     0.244460E+00     0.100E+01
     2     0.500000E-01     0.100E+01
     3     0.500000E-01     0.100E+01

    IT   NF       F        RELDF    PRELDF    RELDX   STPPAR   D*STEP   
NPRELDF

     0    1 -0.192E+03
     1    3 -0.228E+03  0.16E+00  0.19E+00  0.2E+00  0.4E+04  0.1E+00  
0.41E+03
     2    5 -0.241E+03  0.54E-01  0.59E-01  0.1E+00  0.5E+01  0.5E-01  
0.25E+02
     3    6 -0.250E+03  0.36E-01  0.49E-01  0.1E+00  0.4E+03  0.5E-01  
0.24E+03
     4    7 -0.252E+03  0.49E-02  0.38E-01  0.1E+00  0.5E+01  0.5E-01  
0.91E+00
     5    8 -0.257E+03  0.22E-01  0.33E-01  0.7E-01  0.2E+01  0.5E-01  
0.19E+00
     6    9 -0.259E+03  0.82E-02  0.86E-02  0.9E-01  0.2E+01  0.5E-01  
0.39E+00
     7   10 -0.260E+03  0.15E-02  0.12E-01  0.8E-01  0.2E+01  0.5E-01  
0.21E+00
     8   11 -0.264E+03  0.16E-01  0.20E-01  0.6E-01  0.2E+01  0.5E-01  
0.13E+01
     9   12 -0.264E+03  0.92E-03  0.43E-02  0.6E-01  0.2E+01  0.5E-01  
0.10E+00
    10   13 -0.265E+03  0.35E-02  0.43E-02  0.6E-01  0.2E+01  0.5E-01  
0.15E-01
    11   15 -0.265E+03  0.69E-03  0.12E-02  0.7E-02  0.1E+02  0.5E-02  
0.49E-01
    12   16 -0.265E+03  0.54E-03  0.55E-03  0.6E-02  0.3E+01  0.5E-02  
0.79E-02
    13   17 -0.266E+03  0.91E-03  0.97E-03  0.1E-01  0.2E+01  0.1E-01  
0.66E-02
    14   19 -0.266E+03  0.22E-02  0.28E-02  0.6E-01  0.7E+00  0.5E-01  
0.37E-02
    15   20 -0.266E+03  0.70E-03  0.16E-02  0.6E-01  0.1E+01  0.5E-01  
0.16E-02
    16   21 -0.266E+03  0.26E-03  0.24E-03  0.2E-01  0.0E+00  0.2E-01  
0.24E-03
    17   22 -0.266E+03  0.33E-05  0.35E-05  0.2E-02  0.0E+00  0.2E-02  
0.35E-05
    18   23 -0.266E+03  0.22E-07  0.21E-07  0.1E-03  0.0E+00  0.1E-03  
0.21E-07
    19   24 -0.266E+03  0.26E-09  0.25E-09  0.2E-04  0.0E+00  0.2E-04  
0.25E-09
    20   25 -0.266E+03  0.92E-12  0.91E-12  0.1E-05  0.0E+00  0.1E-05  
0.91E-12

 ***** RELATIVE FUNCTION CONVERGENCE *****

 FUNCTION    -0.266482E+03   RELDX        0.147E-05
 FUNC. EVALS      25         GRAD. EVALS      21
 PRELDF       0.910E-12      NPRELDF      0.910E-12

     I      FINAL X(I)        D(I)          G(I)

     1    0.103728E+00     0.100E+01     0.168E-04
     2    0.431380E+00     0.100E+01    -0.181E-06
     3    0.214628E+00     0.100E+01     0.110E-04

Segmentation fault (core dumped)
Kenneth Cabrera wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Here is what I ged from gdb:

 > R.version
         _               
platform i686-pc-linux-gnu
arch     i686            
os       linux-gnu       
system   i686, linux-gnu 
status                   
major    1               
minor    6.1             
year     2002            
month    11              
day      01              
language R               
 > Sys.info()
                           sysname                            release
                           "Linux"                     "2.4.19-16mdk"
                           version                           nodename
"#1 Fri Sep 20 18:15:05 CEST 2002"                   "rifle.manas.kg"
                           machine                              login
                            "i686"                          "unknown"
                              user
                          "mehmet"
 > library(tseries)

    `tseries' version: 0.9-4
 
    `tseries' is a package for time series analysis
     and computational finance.
     See `library (help=tseries)' for details.

 > example(garch)

garch> n <- 1100

garch> a <- c(0.1, 0.5, 0.2)

garch> e <- rnorm(n)

garch> x <- double(n)

garch> x[1:2] <- rnorm(2, sd = sqrt(a[1]/(1 - a[2] - a[3])))

garch> for (i in 3:n) {
    x[i] <- e[i] * sqrt(a[1] + a[2] * x[i - 1]^2 + a[3] * x[i -
        2]^2)
}

garch> x <- ts(x[101:1100])

garch> x.arch <- garch(x, order = c(0, 2))

 ***** ESTIMATION WITH ANALYTICAL GRADIENT *****


     I     INITIAL X(I)        D(I)

     1     0.388803E+00     0.100E+01
     2     0.500000E-01     0.100E+01
     3     0.500000E-01     0.100E+01

    IT   NF       F        RELDF    PRELDF    RELDX   STPPAR   D*STEP   
NPRELDF

     0    1  0.103E+01
     1    3 -0.404E+02  0.10E+01  0.14E+01  0.1E+00  0.6E+04  0.1E+00  
0.39E+04
     2    5 -0.785E+02  0.48E+00  0.51E+00  0.2E+00  0.1E+02  0.1E+00  
0.21E+04
     3    6 -0.906E+02  0.13E+00  0.67E+00  0.4E+00  0.5E+01  0.2E+00  
0.38E+02
     4    7 -0.115E+03  0.21E+00  0.87E+00  0.2E+00  0.2E+01  0.2E+00  
0.16E+02
     5    8 -0.138E+03  0.17E+00  0.18E+00  0.2E+00  0.2E+01  0.2E+00  
0.18E+01
     6   10 -0.141E+03  0.18E-01  0.28E-01  0.2E-01  0.6E+01  0.2E-01  
0.85E+00
     7   12 -0.141E+03  0.54E-04  0.11E-03  0.3E-02  0.2E+01  0.5E-02  
0.59E-02
     8   13 -0.141E+03  0.84E-04  0.88E-04  0.3E-02  0.2E+01  0.5E-02  
0.74E-03
     9   14 -0.141E+03  0.51E-04  0.17E-03  0.8E-02  0.2E+01  0.1E-01  
0.55E-03
    10   16 -0.141E+03  0.35E-04  0.66E-04  0.2E-02  0.1E+02  0.3E-02  
0.71E-02
    11   17 -0.141E+03  0.56E-04  0.62E-04  0.2E-02  0.2E+01  0.3E-02  
0.46E-03
    12   19 -0.141E+03  0.11E-03  0.12E-03  0.6E-02  0.2E+01  0.1E-01  
0.16E-03
    13   21 -0.141E+03  0.18E-04  0.42E-04  0.3E-02  0.1E+01  0.4E-02  
0.19E-03
    14   22 -0.141E+03  0.50E-05  0.58E-05  0.5E-03  0.0E+00  0.7E-03  
0.58E-05
    15   23 -0.141E+03  0.12E-06  0.12E-06  0.2E-03  0.0E+00  0.2E-03  
0.12E-06
    16   24 -0.141E+03  0.35E-11  0.35E-11  0.1E-05  0.0E+00  0.1E-05  
0.35E-11

 ***** RELATIVE FUNCTION CONVERGENCE *****

 FUNCTION    -0.140596E+03   RELDX        0.114E-05
 FUNC. EVALS      24         GRAD. EVALS      17
 PRELDF       0.352E-11      NPRELDF      0.352E-11

     I      FINAL X(I)        D(I)          G(I)

     1    0.104501E+00     0.100E+01    -0.197E-04
     2    0.617186E+00     0.100E+01     0.281E-05
     3    0.179484E+00     0.100E+01    -0.226E-05


Program received signal SIGSEGV, Segmentation fault.
pred_garch (y=0x8d8d330, h=0x8d8f298, n=0x8d8c1c8, par=0x8d8d2a0, 
p=0x8d8c1a8, q=0x8d8c188, genuine=0x6)
    at garch.c:245
245    garch.c: No such file or directory.
    in garch.c
(gdb) bt
#0  pred_garch (y=0x8d8d330, h=0x8d8f298, n=0x8d8c1c8, par=0x8d8d2a0, 
p=0x8d8c1a8, q=0x8d8c188, genuine=0x6)
    at garch.c:245
#1  0x08092497 in do_dotCode (call=0x8b1cffc, op=0x8d8c1c8, 
args=0x8d832b0, env=0x8d7179c) at dotcode.c:1311
#2  0x080a0f68 in Rf_eval (e=0x8b1cffc, rho=0x8d7179c) at eval.c:427
#3  0x080a2675 in do_set (call=0x8b1d06c, op=0x8d7179c, args=0x8b1d050, 
rho=0x8d7179c) at eval.c:1102
#4  0x080a0fd1 in Rf_eval (e=0x8b1d06c, rho=0x8d7179c) at eval.c:404
#5  0x080a1f52 in do_begin (call=0x8b28668, op=0x81d302c, 
args=0x8b1d088, rho=0x8d7179c) at eval.c:891
#6  0x080a0fd1 in Rf_eval (e=0x8b28668, rho=0x8d7179c) at eval.c:404
#7  0x080a1261 in Rf_applyClosure (call=0x85281ec, op=0x89b6140, 
arglist=0x8d718ec, rho=0x81e2fb0,
    suppliedenv=0x81cdb50) at eval.c:595
#8  0x080a0de7 in Rf_eval (e=0x85281ec, rho=0x81e2fb0) at eval.c:439
#9  0x080a2675 in do_set (call=0x8528294, op=0x81e2fb0, args=0x8528224, 
rho=0x81e2fb0) at eval.c:1102
#10 0x080a0fd1 in Rf_eval (e=0x8528294, rho=0x81e2fb0) at eval.c:404
#11 0x080a2f2e in do_eval (call=0x88b2208, op=0x81dc924, args=0x8d71a04, 
rho=0x8d71a58) at eval.c:1384
#12 0x080c6474 in do_internal (call=0x88b217c, op=0x81d4288, 
args=0x8d71a04, env=0x8d71a58) at names.c:1042
#13 0x080a0fd1 in Rf_eval (e=0x88b217c, rho=0x8d71a58) at eval.c:404
#14 0x080a1261 in Rf_applyClosure (call=0x88b645c, op=0x852d8f4, 
arglist=0x8d71b00, rho=0x852e6c8,
    suppliedenv=0x81cdb50) at eval.c:595
#15 0x080a0de7 in Rf_eval (e=0x88b645c, rho=0x852e6c8) at eval.c:439
#16 0x080a2675 in do_set (call=0x88b6408, op=0x852e6c8, args=0x88b6424, 
rho=0x852e6c8) at eval.c:1102
#17 0x080a0fd1 in Rf_eval (e=0x88b6408, rho=0x852e6c8) at eval.c:404
#18 0x080a1f52 in do_begin (call=0x88b3efc, op=0x81d302c, 
args=0x88b63ec, rho=0x852e6c8) at eval.c:891
#19 0x080a0fd1 in Rf_eval (e=0x88b3efc, rho=0x852e6c8) at eval.c:404
#20 0x080a1926 in do_for (call=0x88b7290, op=0x81cd530, args=0x88b72ac, 
rho=0x852e6c8) at eval.c:789
#21 0x080a0fd1 in Rf_eval (e=0x88b7290, rho=0x852e6c8) at eval.c:404
#22 0x080a1f52 in do_begin (call=0x88b209c, op=0x81d302c, 
args=0x88b7274, rho=0x852e6c8) at eval.c:891
#23 0x080a0fd1 in Rf_eval (e=0x88b209c, rho=0x852e6c8) at eval.c:404
#24 0x080a1261 in Rf_applyClosure (call=0x88c3500, op=0x88b70ec, 
arglist=0x852e284, rho=0x8599810,
    suppliedenv=0x81cdb50) at eval.c:595
#25 0x080a0de7 in Rf_eval (e=0x88c3500, rho=0x8599810) at eval.c:439
#26 0x080a1f52 in do_begin (call=0x88c01dc, op=0x81d302c, 
args=0x88c34e4, rho=0x8599810) at eval.c:891
#27 0x080a0fd1 in Rf_eval (e=0x88c01dc, rho=0x8599810) at eval.c:404
#28 0x080a1261 in Rf_applyClosure (call=0x859a45c, op=0x88c3404, 
arglist=0x8599634, rho=0x81e2fb0,
    suppliedenv=0x81cdb50) at eval.c:595
#29 0x080a0de7 in Rf_eval (e=0x859a45c, rho=0x81e2fb0) at eval.c:439
#30 0x080baa07 in Rf_ReplIteration (rho=0x81e2fb0, savestack=6, 
browselevel=0, state=0xbfffed70)
    at main.c:232
#31 0x080babc2 in R_ReplConsole (rho=0x81e2fb0, savestack=0, 
browselevel=0) at main.c:280
#32 0x080bb340 in run_Rmainloop () at main.c:579
#33 0x0811fbec in main (ac=1, av=0xbffff254) at system.c:99
#34 0x40171082 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)
Peter Dalgaard BSA wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._