From benjamin.leblanc at igh.cnrs.fr  Mon May 14 14:35:25 2007
From: benjamin.leblanc at igh.cnrs.fr (benjamin.leblanc at igh.cnrs.fr)
Date: Mon, 14 May 2007 14:35:25 +0200 (CEST)
Subject: [Rd] Calling erf function in package NORMT3 produce a R crash on
	Linux/AMD opteron (PR#9683)
Message-ID: <20070514123525.BDB1047CB7@slim.kubism.ku.dk>

Full_Name: Benjamin Leblanc
Version: 2.4.1 and 2.5.0
OS: Ubuntu Linux 7.04 AMD64
Submission from: (NULL) (195.83.84.213)


Here is an example script that may crash under R with Linux AMD 64 bit
platforms

library('NORMT3')
a <- 1:1000/1000
erf(a)

I did several tests:
- opensuse 10.2 x86_64 with R 2.4.1 and R 2.5.0, produce systematically a frozen
R session
- ubuntu 7.04 AMD64, R 2.4.1 and R version 2.5.0 (2007-04-23), produce a memory
corruption

Here is an example with core dump on ubuntu 7.04 AMD64, R version 2.5.0
(2007-04-23):

> a <- 1:100/200
> erf(a)


*** glibc detected *** /usr/lib/R/bin/exec/R: malloc(): memory corruption:
0x0000000001308500 ***
======= Backtrace: =========
/lib/libc.so.6[0x2b0cc3b9f1d1]
/lib/libc.so.6(__libc_malloc+0x7d)[0x2b0cc3ba098d]
/usr/lib/R/lib/libR.so(Rf_allocVector+0x4cc)[0x2b0cc36e9c3c]
/usr/lib/R/lib/libR.so[0x2b0cc368d42b]
/usr/lib/R/lib/libR.so(Rf_eval+0x6ea)[0x2b0cc36bfb6a]
/usr/lib/R/lib/libR.so[0x2b0cc36c2370]
/usr/lib/R/lib/libR.so(Rf_eval+0x48b)[0x2b0cc36bf90b]
/usr/lib/R/lib/libR.so[0x2b0cc36c0ca2]
/usr/lib/R/lib/libR.so(Rf_eval+0x48b)[0x2b0cc36bf90b]
/usr/lib/R/lib/libR.so(Rf_applyClosure+0x286)[0x2b0cc36c2be6]
/usr/lib/R/lib/libR.so(Rf_eval+0x2f4)[0x2b0cc36bf774]
/usr/lib/R/lib/libR.so[0x2b0cc36c0618]
/usr/lib/R/lib/libR.so(Rf_eval+0x552)[0x2b0cc36bf9d2]
/usr/lib/R/lib/libR.so(Rf_applyClosure+0x286)[0x2b0cc36c2be6]
/usr/lib/R/lib/libR.so(Rf_eval+0x2f4)[0x2b0cc36bf774]
/usr/lib/R/lib/libR.so(Rf_ReplIteration+0x2de)[0x2b0cc36e2f4e]
/usr/lib/R/lib/libR.so(run_Rmainloop+0xc2)[0x2b0cc36e3112]
/usr/lib/R/bin/exec/R(main+0x1b)[0x40088b]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2b0cc3b4c8e4]
/usr/lib/R/bin/exec/R[0x4007aa]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:02 8669401                           
/usr/lib/R/bin/exec/R
00500000-00501000 rw-p 00000000 08:02 8669401                           
/usr/lib/R/bin/exec/R
00501000-01b4b000 rw-p 00501000 00:00 0                                  [heap]
2b0cc33e2000-2b0cc33fe000 r-xp 00000000 08:02 14549011                  
/lib/ld-2.5.so
2b0cc33fe000-2b0cc3401000 rw-p 2b0cc33fe000 00:00 0 
2b0cc35fd000-2b0cc35ff000 rw-p 0001b000 08:02 14549011                  
/lib/ld-2.5.so
2b0cc35ff000-2b0cc384b000 r-xp 00000000 08:02 8669405                   
/usr/lib/R/lib/libR.so
2b0cc384b000-2b0cc394b000 ---p 0024c000 08:02 8669405                   
/usr/lib/R/lib/libR.so
2b0cc394b000-2b0cc395e000 rw-p 0024c000 08:02 8669405                   
/usr/lib/R/lib/libR.so
2b0cc395e000-2b0cc39f8000 rw-p 2b0cc395e000 00:00 0 
2b0cc39f8000-2b0cc3a23000 r-xp 00000000 08:02 8669404                   
/usr/lib/R/lib/libRblas.so
2b0cc3a23000-2b0cc3b22000 ---p 0002b000 08:02 8669404                   
/usr/lib/R/lib/libRblas.so
2b0cc3b22000-2b0cc3b23000 rw-p 0002a000 08:02 8669404                   
/usr/lib/R/lib/libRblas.so
2b0cc3b23000-2b0cc3b24000 r--p 00000000 08:02 8028234                   
/usr/lib/locale/fr_FR.utf8/LC_MESSAGES/SYS_LC_MESSAGES
2b0cc3b24000-2b0cc3b2b000 r--s 00000000 08:02 9273579                   
/usr/lib/gconv/gconv-modules.cache
2b0cc3b2f000-2b0cc3c76000 r-xp 00000000 08:02 14549029                  
/lib/libc-2.5.so
2b0cc3c76000-2b0cc3e76000 ---p 00147000 08:02 14549029                  
/lib/libc-2.5.so
2b0cc3e76000-2b0cc3e79000 r--p 00147000 08:02 14549029                  
/lib/libc-2.5.so
2b0cc3e79000-2b0cc3e7b000 rw-p 0014a000 08:02 14549029                  
/lib/libc-2.5.so
2b0cc3e7b000-2b0cc3e80000 rw-p 2b0cc3e7b000 00:00 0 
2b0cc3e80000-2b0cc3f19000 r-xp 00000000 08:02 11288626                  
/usr/lib/libgfortran.so.1.0.0
2b0cc3f19000-2b0cc4118000 ---p 00099000 08:02 11288626                  
/usr/lib/libgfortran.so.1.0.0
2b0cc4118000-2b0cc411a000 rw-p 00098000 08:02 11288626                  
/usr/lib/libgfortran.so.1.0.0
2b0cc411a000-2b0cc411b000 rw-p 2b0cc411a000 00:00 0 
2b0cc411b000-2b0cc419c000 r-xp 00000000 08:02 14549060                  
/lib/libm-2.5.so
2b0cc419c000-2b0cc439b000 ---p 00081000 08:02 14549060                  
/lib/libm-2.5.so
2b0cc439b000-2b0cc439d000 rw-p 00080000 08:02 14549060                  
/lib/libm-2.5.so
2b0cc439d000-2b0cc43aa000 r-xp 00000000 08:02 14549054                  
/lib/libgcc_s.so.1
2b0cc43aa000-2b0cc45aa000 ---p 0000d000 08:02 14549054                  
/lib/libgcc_s.so.1
2b0cc45aa000-2b0cc45ab000 rw-p 0000d000 08:02 14549054                  
/lib/libgcc_s.so.1
2b0cc45ab000-2b0cc45e1000 r-xp 00000000 08:02 14549102                  
/lib/libreadline.so.5.2
2b0cc45e1000-2b0cc47e1000 ---p 00036000 08:02 14549102                  
/lib/libreadline.soAbandon (core dumped)



[Rd] Calling erf function in package NORMT3 produce a R crash on Linux/AMD opteron (PR#9683)
benjamin.leblanc at igh.cnrs.fr