perhaps your linux version is buggy. if so bug the developers - mmap is
such a fundemental operation (programs are always mmap'd when run by the
kernel) that it's astounding that bugs like this get released.
- did you install ruby via some package manager but compile the mmap dist?
if you i'd (always) compile ruby vs. trusting the binary dists and compile
mmap using this ruby, then see if the problem persists.
other than that i can tell you i'm abusing mmap in the most sinister ways with
no crashes or data corruption on a variety of linux dists.
hth.
-a
···
On Sun, 11 Sep 2005, Guillaume Marcais wrote:
[gus@hibernatus Bifurcation]$ cat mmap-abort.rb
require 'mmap'
mm = Mmap.new("test-mmap", "w")
10.times { |i| p i; mm << "\0" * 1024 }
[gus@hibernatus Bifurcation]$ ls -ls test-mmap
4 -rw-rw-r-- 1 gus gus 4096 Sep 10 07:45 test-mmap
[gus@hibernatus Bifurcation]$ uname -a
Linux hibernatus.gus.marcais.net 2.6.11-6mdksmp #1 SMP Tue Mar 22 15:40:42 CET 2005 i686 Pentium Pro unknown GNU/Linux
The same behavior was showned on two different Linux machines (same distribution though).
Any idea why it crashes?
--
email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna
Yes, as suggested by Guy, using "rw" instead of "w" fixes the problem, however weird that may seem. His patch in ruby-talk:155557 fixed the problem too.
thoughts:
- redhat has had many bugs with there mmap code. a short while ago i
reported a simple c program that would hang the kernel
perhaps your linux version is buggy. if so bug the developers - mmap is
such a fundemental operation (programs are always mmap'd when run by the
kernel) that it's astounding that bugs like this get released.
I am not using RedHat but Mandrake (note that I am not claiming anything about the quality of one over the other).
- did you install ruby via some package manager but compile the mmap dist?
if you i'd (always) compile ruby vs. trusting the binary dists and compile
mmap using this ruby, then see if the problem persists.
Correct, it is the distro binary of ruby and a self compile mmap.
other than that i can tell you i'm abusing mmap in the most sinister ways with
no crashes or data corruption on a variety of linux dists.
Well, your recent posts on the subject have been inspirational... I have crashed ruby using mmap after forking (haven't nailed down the bug yet). I'll recompile ruby to see if that's the problem.