Skip to content

segfault using svm from e1071 (PR#1178)

5 messages · jan@rychter.com, Martin Maechler, David Meyer +1 more

#
This could be a bug in the e1071 svm code, but maybe not -- I guess I'll
send it here anyway. It's reproducible.
Process R segmentation fault at Tue Nov 20 23:34:19 2001
_                
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    3.1              
year     2001             
month    08               
day      31               
language R                

I used the Mandrake 8.0 RPM binaries from cran.r-project.org first, then
recompiled R myself and reinstalled e1071. Same results.

thanks,
--J.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
jan> This could be a bug in the e1071 svm code, but maybe
    jan> not -- I guess I'll send it here anyway. It's
    jan> reproducible.

not really reproducible:

1) If you use random data (which is perfect),
  you need an explicit  set.seed(.) statement to make it reproducible

2) I can evaluate the code below (intel-Linux as you)
    more than 100 times without a problem.

Martin

    >> x <- seq (0.1,5,by=0.05)
    >> y <- log(x) + rnorm (x, sd=0.2)
    >> library(e1071)
    >> m <- svm (x,y)

    jan> Process R segmentation fault at Tue Nov 20 23:34:19 2001

    >> version
    jan> _                
    jan> platform i686-pc-linux-gnu
    jan> arch     i686             
    jan> os       linux-gnu        
    jan> system   i686, linux-gnu  
    jan> status                    
    jan> major    1                
    jan> minor    3.1              
    jan> year     2001             
    jan> month    08               
    jan> day      31               
    jan> language R                

    jan> I used the Mandrake 8.0 RPM binaries from
    jan> cran.r-project.org first, then recompiled R myself and
    jan> reinstalled e1071. Same results.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
jan@rychter.com wrote:
Which version of e1071 are you using (Current: 1.2-1)? This package had
a bug fix release one month ago.

-d

  
    
#
David> jan@rychter.com wrote:
>>
 >> This could be a bug in the e1071 svm code, but maybe not -- I guess
 >> I'll send it here anyway. It's reproducible.

 David> Which version of e1071 are you using (Current: 1.2-1)? This
 David> package had a bug fix release one month ago.

e1071_1.2-1.tar.gz

--J.

 > x <- seq (0.1,5,by=0.05) y <- log(x) + rnorm (x, sd=0.2)
 > library(e1071) m <- svm (x,y)
 >>
 >> Process R segmentation fault at Tue Nov 20 23:34:19 2001
 >>
 > version
 >> _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686,
 >> linux-gnu status major 1 minor 3.1 year 2001 month 08 day 31
 >> language R
 >>
 >> I used the Mandrake 8.0 RPM binaries from cran.r-project.org first,
 >> then recompiled R myself and reinstalled e1071. Same results.
 >>

[...]


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
2 days later
#
David> jan@rychter.com wrote:
>>
 >> This could be a bug in the e1071 svm code, but maybe not -- I guess
 >> I'll send it here anyway. It's reproducible.

 David> Which version of e1071 are you using (Current: 1.2-1)? This
 David> package had a bug fix release one month ago.

To follow up on this (yes, I'm using 1.2-1), here is the backtrace. Hope
it helps.
Program received signal SIGSEGV, Segmentation fault.
0x4011ffe8 in realloc () from /lib/libc.so.6
(gdb) bt
#0  0x4011ffe8 in realloc () from /lib/libc.so.6
#1  0x403859ea in Cache::get_data (this=0x8b01d00, index=145759521, data=0xbfffd9b4, 
    len=99) at svm.cpp:126
#2  0x4038b239 in SVR_Q::get_Q (this=0xbfffdb00, i=100, len=198) at svm.cpp:1223
#3  0x4038658d in Solver::Solve (this=0xbfffdb50, l=198, Q=@0xbfffdb00, b_=0x8b01148, 
    y_=0x8b01780 '\001' <repeats 99 times>, 'ÿ' <repeats 99 times>, alpha_=0x8b00b10, 
    Cp=1, Cn=1, eps=0.001, si=0xbfffdc20, shrinking=1) at svm.cpp:534
#4  0x40388249 in solve_epsilon_svr (prob=0xbfffde40, param=0xbfffde50, alpha=0x8b007f0, 
    si=0xbfffdc20) at svm.cpp:1195
#5  0x40388aac in svm_train_one (prob=0xbfffde40, param=0xbfffde50, Cp=0, Cn=0)
    at svm.cpp:1505
#6  0x40388c54 in svm_train (prob=0xbfffde40, param=0xbfffde50) at svm.cpp:1584
#7  0x40384202 in svmtrain () from /local/lib/R/library/e1071/libs/e1071.so
#8  0x0808ccd9 in do_dotCode ()
#9  0x08093e23 in Rf_eval ()
#10 0x0809546a in do_set ()
#11 0x08093c6e in Rf_eval ()
#12 0x08094db9 in do_begin ()
#13 0x08093c6e in Rf_eval ()
#14 0x08094238 in Rf_applyClosure ()
#15 0x080b423b in applyMethod ()
#16 0x080b47ce in Rf_usemethod ()
#17 0x080b49dd in do_usemethod ()
#18 0x08093c6e in Rf_eval ()
#19 0x08094238 in Rf_applyClosure ()
#20 0x08093eaa in Rf_eval ()
#21 0x0809546a in do_set ()
#22 0x08093c6e in Rf_eval ()
#23 0x080a906b in R_ReplConsole ()
#24 0x080a980a in run_Rmainloop ()
#25 0x080ff8e8 in main ()
#26 0x400bb5b0 in __libc_start_main () from /lib/libc.so.6
(gdb) 


--Jan

 > x <- seq (0.1,5,by=0.05) y <- log(x) + rnorm (x, sd=0.2)
 > library(e1071) m <- svm (x,y)
 >>
 >> Process R segmentation fault at Tue Nov 20 23:34:19 2001
 >>
 > version
 >> _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686,
 >> linux-gnu status major 1 minor 3.1 year 2001 month 08 day 31
 >> language R
 >>
 >> I used the Mandrake 8.0 RPM binaries from cran.r-project.org first,
 >> then recompiled R myself and reinstalled e1071. Same results.
 >>
 >> thanks, --J.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._