help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to debug this strange load problem


From: Przemek Klosowski
Subject: Re: how to debug this strange load problem
Date: Tue, 29 Aug 2006 15:19:15 -0400 (EDT)

I compared what happens on my system when I try to read Frank's file
containing the string "103\n104\n105" (three numbers on three lines,
with no terminating newline) with Frank's strace results:


-------------my system-----------------------        
------------Frank---------------------------

open("/tmp/d", O_RDONLY)                = 3           open("test2.txt", 
O_RDONLY|O_LARGEFILE) = 3       
close(3)                                = 0           close(3)                  
              = 0       
futex(0x3b8b31fc60, FUTEX_WAKE, 2147483647) = 0      
brk(0x19f3000)                          = 0x19f3000  
open("/tmp/d", O_RDONLY)                = 3          
fstat(3, {st_mode=S_IFREG|0664, st_size=11, ...}) = 0
lseek(3, 0, SEEK_SET)                   = 0          
read(3, "103\n104\n", 8)                = 8          
close(3)                                = 0          
open("/tmp/d", O_RDONLY)                = 3           open("test2.txt", 
O_RDONLY|O_LARGEFILE) = 3         
read(3, "103\n104\n105", 8191)          = 11          read(3, "103\n104\n105", 
8191)          = 11        
lseek(3, 0, SEEK_SET)                   = 0           _llseek(3, 0, [0], 
SEEK_SET)            = 0         
read(3, "103\n104\n105", 8191)          = 11          read(3, "103\n104\n105", 
8191)          = 11        
read(3, "", 8191)                       = 0           read(3, "", 8191)         
              = 0         
lseek(3, 0, SEEK_SET)                   = 0           _llseek(3, 0, [0], 
SEEK_SET)            = 0         
lseek(3, 124, SEEK_SET)                 = 124         _llseek(3, 124, [124], 
SEEK_SET)        = 0         
read(3, "", 8191)                       = 0           read(3, "", 8191)         
              = 0         
lseek(3, 0, SEEK_SET)                   = 0           _llseek(3, 0, [0], 
SEEK_SET)            = 0         
read(3, "103\n104\n105", 8191)          = 11          read(3, "103\n104\n105", 
8191)          = 11        
read(3, "", 8191)                       = 0           read(3, "", 8191)         
              = 0         
close(3)                                = 0           close(3)                  
              = 0     
open("/tmp/d", O_RDONLY)                = 3
read(3, "103\n104\n105", 8191)          = 11
close(3)                                = 0
open("/tmp/d", O_RDONLY)                = 3
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "103\n104\n105", 8191)          = 11
read(3, "", 8191)                       = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "103\n104\n105", 8191)          = 11
read(3, "", 8191)                       = 0
close(3)                                = 0
read(0, "", 4096)                       = 0            

Clearly, the I/O libraries are different, but the behavior seems to be similar, 
except for the
third seek (lseek(3, 124, SEEK_SET)) which for some weird reason seeks to 
position 124 in this
11-byte file. On Frank's system it seems to result in going to offset 0 but the 
subsequent read
returns an empty string (compare with the next two lines, where it asks to go 
to zero, returns
zero and reads the whole file again.

Frank---what is your Linux flavor/version  again? 

Also, Frank---if the 'load test2.txt' read worked, it would have created an 
octave variable test2:

octave:1> load test2.txt
octave:2> test2
test2 =

  103
  104
  105

Did you check that particular variable name?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]