Skip to content

crash with scan(..., what=list(,,)) (PR#802)

3 messages · Emmanuel Paradis, Duncan Murdoch, Peter Dalgaard

#
When reading a file with scan(), the following crashes R under Solaris and
WinNT 4.0 (versions below):
Would an error message be more logical? Note that the followings work (the
data file has 201 lines and 3 columns):
Read 603 lines
Read 201 lines
Read 302 lines
Warning message: 
line 1 did not have 2 elements
_              
platform i386-pc-mingw32
arch     x86            
os       Win32          
system   x86, Win32     
status                  
major    1              
minor    2.0            
year     2000           
month    12             
day      15             
language R
_
platform sparc-sun-solaris2.7
arch     sparc
os       solaris2.7
system   sparc, solaris2.7
status
major    1
minor    2.0
year     2000
month    12
day      15
language R


Emmanuel Paradis

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Fri, 5 Jan 2001 17:11:13 +0100 (MET), you wrote in message
<200101051611.RAA27177@pubhealth.ku.dk>:
I crash Win98 with the same sort of line; it's because list(,,) is the
same as list(), and scan isn't checking for this boundary case, I
guess...
While fixing this, wouldn't it be better to change this message to 

"Read 603 cases"

since in fact, only 201 lines were read, 3 cases per line?

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
paradis@isem.univ-montp2.fr writes:
Happens on Linux too. And you don't need a big file to provoke it:

$ cat > /tmp/junk
1 2 3
3 4 5
2 3 4
^D

...

Starting program: /usr/local/src/misc/r-release/BUILD/bin/R.bin --quiet
Program received signal SIGSEGV, Segmentation fault.
0x80d5160 in scanFrame (what=0x89e8260, maxitems=0, maxlines=0, flush=0, 
    fill=0, stripwhite=0x878b0f0, blskip=1) at ../../../R/src/main/scan.c:491
491     bch = fillBuffer(buffer, TYPEOF(VECTOR_ELT(ans, ii)), strip);