[#3419] Valgrind analysis of [BUG] unknown node type 0 — Andrew Walrond <andrew@...>

Hello list,

19 messages 2004/09/17
[#3422] Re: Valgrind analysis of [BUG] unknown node type 0 — ts <decoux@...> 2004/09/17

>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:

[#3423] Re: Valgrind analysis of [BUG] unknown node type 0 — Andrew Walrond <andrew@...> 2004/09/17

On Friday 17 Sep 2004 12:01, ts wrote:

[#3424] Re: Valgrind analysis of [BUG] unknown node type 0 — ts <decoux@...> 2004/09/17

>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:

[#3425] Re: Valgrind analysis of [BUG] unknown node type 0 — Andrew Walrond <andrew@...> 2004/09/17

On Friday 17 Sep 2004 12:37, ts wrote:

[#3426] Re: Valgrind analysis of [BUG] unknown node type 0 — ts <decoux@...> 2004/09/17

>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:

[#3428] Re: Valgrind analysis of [BUG] unknown node type 0 — Andrew Walrond <andrew@...> 2004/09/17

On Friday 17 Sep 2004 13:05, ts wrote:

[#3429] Re: Valgrind analysis of [BUG] unknown node type 0 — ts <decoux@...> 2004/09/17

>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:

Re: [PATCH] dir.c --- Dir.chdir error handling

From: ts <decoux@...>
Date: 2004-09-15 09:26:05 UTC
List: ruby-core #3403
>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

>> The problem with such examples is that only *one* person can reproduce
>> it. Difficult to say something about it.

H> Yes, I couldn't reproduce that in my gcc (2.9 in beos)...
H> And even this code didn't crash.


 It's a little more complex : I can give you an example with 1.8.0

 Look at [ruby-talk:80435] and try this script with 1.8.0

 ------------------------------------------------------------
   thread_block= Proc.new do
      1.upto(20000) do
         a = {1 => 2}
      end
      Thread.new &thread_block
   end

   1.upto(120) do
      Thread.new &thread_block
   end
   Thread.stop
 ------------------------------------------------------------

 Now if ruby crash, rewrite mark_locations_array() like this

 ------------------------------------------------------------
   static void
   mark_locations_array(x, n)
       register VALUE *x;
       register long n;
   {
       VALUE tmp;

       while (n--) {
        if (is_pointer_to_heap((void *)*x)) {
            tmp = *x;
            rb_gc_mark(tmp);
        }
        x++;
       }
   }
 ------------------------------------------------------------

 and you'll see that ruby work (normally)

 If you look at the patch to correct this problem, written by matz, you'll
 see that it has nothing to do with `volatile'

 Now if you want to know why I've introduced the variable `tmp', this is
 just to make in sort that the assembler was different and because the
 assembler was modified this hyde completely the bug.

 What I want to say is : when you have such a problem (bug that you can see
 only with some C flags like -O3) this don't means that it exist fatally a
 problem with `volatile' and worst you can make some subtle modifications
 (like add `volatile') and this will hide the real bug.



Guy Decoux



In This Thread