On Thu, Jun 15, 2006 at 09:20:19PM +0900, Will Yeoh wrote:
> The problem is, I seem to see memory getting corrupted when running the 
> Ruby program which calls the C++ library. When the Ruby program is run 
> on standalone, there are no problems. When the C++ dynamic library is 
> run with an equivalent C++ program, there are no problems. This leads me 
> to believe that there are some "interactions" between Ruby and the C++ 
> library. Also, the Ruby program runs on a different thread than the C++.

You can try running ruby under valgrind to find the problem.  You will
need to use a suppressions file, which you can find in [ruby-talk:52065]
or at http://rubystuff.org/ruby.supp .

Paul