From: mental@... Date: 2005-11-22T02:20:10+09:00 Subject: Re: valgrind and embedded ruby Quoting Heiko Leberer : > If I use valgrind to check for memory leaks, all is OK. If I now > change the loop count from 1000LL to 10000LL, valgrind throws > errors: > > ==7903== Conditional jump or move depends on uninitialised > value(s) > ==7903== at 0x806C904: gc_mark_children (gc.c:758) > ==7903== by 0x806C88F: gc_mark (gc.c:731) > ==7903== by 0x806C6C2: mark_locations_array (gc.c:626) > ==7903== by 0x806C6EF: rb_gc_mark_locations (gc.c:639) > > (in total 496 errors from 39 contexts) This is probably the consequence of the "conservative" portion of Ruby's garbage collector, which scans the stack and some other areas which could be uninitialized. You'll see similar warnings from valgrind in the presence of other conservative GCs (for example, the boehm collector for C). This is a consequence of the fact that a conservative collector must scan memory without knowing whether it is initialized/valid in advance or not. Conservative collectors are designed to be robust in the face of garbage pointers, however, so this is perfectly safe. -mental