I’m reading binary data out of the /proc//as file on Solaris, and
I’m hitting a curious overflow error on one process in particular:
With IO#sysread
irb(main):010:0> File.open("/proc/383/as"){ |fh| fh.sysread(4) }
Errno::EOVERFLOW: Value too large for defined data type - /proc/383/as
from (irb):10:in sysread' from (irb):10 from (irb):10:inopen’
from (irb):10
With IO#read
rb(main):010:0> File.open("/proc/383/as"){ |fh| fh.read(4) }
Errno::EOVERFLOW: Value too large for defined data type - /proc/383/as
from (irb):10:in read' from (irb):10 from (irb):10:inopen’
from (irb):10
Where pid 383 is:
UID PID PPID C STIME TTY TIME CMD
root 383 1 0 07:14:42 ? 0:01 /usr/sfw/sbin/snmpd
This is the only pid in particular where this error occurs (out of
about 80).
Dies here with: Value too large for defined data type
/dan needs more coffee
As far as I can gather it’s a 32-bit largefile issue. The short
version is that a 32-bit Ruby (or Perl, or Python) will simply not be
able to read that file. The same code using a 64-bit Ruby works fine.
Well, except the part where my io-extra library segfaults on IO.pread
in 64-bit mode, but nevermind that.
Regards,
Dan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.