[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Trouble squashing Ruby bug

Joe Bacigalupa

8/11/2006 8:38:00 PM

I'm writing a c++ Ruby extension that seems to be running into some
kind of a memory issue. I'm getting "HEAP: free heap block modified
after it was freed" when I attempt to either allocate a new
array(rb_ary_new) or push onto a ruby array(rb_ary_push) at a certain
point in my program. I can't seem to find any buffer overflows - which
I believe is one cause for such an error. So it leads me to believe
that maybe my "marking" functionality may be flawed. But as far as I
can see I'm handling the marking properly - I mark anything that is not
a fixnum( arrays, other classes, etc). Are there any newbie marking
mistakes anyone knows of that could cause an issue like this?

This problem only happens when my extension uses a decent amount of
memory - so I'm not sure if there is some kind of a Ruby heap limit
that I'm going over.

I'm just curious if anyone has encountered a problem similar to this
that they have overcome? Its been almost a week where I have
essentially been at a standstill with development. I've even got an
evaluation of Insure++ to help me look for memory issues - all to no
avail.

Thanks, Let me know if there is any additional information I can
provide to clarify any details.

Joe

2 Answers

rickhg12hs

8/12/2006 4:36:00 PM

0

> I'm writing a c++ Ruby extension that seems to be running into some
> kind of a memory issue.

Whether you are using SWIG or not, their Ruby memory management
documentation may be helpful. It was for me.

http://www.swig.org/Doc1.3/Ruby.html...

Good luck!

Joe Bacigalupa

8/12/2006 10:26:00 PM

0


rickhg12hs wrote:
> > I'm writing a c++ Ruby extension that seems to be running into some
> > kind of a memory issue.
>
> Whether you are using SWIG or not, their Ruby memory management
> documentation may be helpful. It was for me.
>
> http://www.swig.org/Doc1.3/Ruby.html...
>
> Good luck!

Thanks - I'll check that out