Dl memory leak

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B

e$B%j%j!<%94V6a$G5$$,0z$1$^$9$,!"e(Bruby/dl e$B$,%a%b%j!<%j!<%/$re(B
e$B5/$3$7$F$$$^$9!#0J2<$O%Q%C%A$G$9!#e(B

Index: ptr.c

— ptr.c (revision 12047)
+++ ptr.c (working copy)
@@ -53,6 +53,8 @@
void
dlptr_free(struct ptr_data *data)
{

  • if (!data)
  • return;
    if (data->ptr) {
    DEBUG_CODE({
    printf(“dlptr_free(): removing the pointer `0x%x’ from the
    MemorySpace\n”,
    @@ -69,6 +71,7 @@
    if (data->stype) dlfree(data->stype);
    if (data->ssize) dlfree(data->ssize);
    if (data->ids) dlfree(data->ids);
  • dlfree(data);
    }

void
Index: sym.c

— sym.c (revision 12047)
+++ sym.c (working copy)
@@ -57,6 +57,8 @@
void
dlsym_free(struct sym_data *data)
{

  • if(!data)
  • return;
    if( data->name ){
    DEBUG_CODE({
    printf(“dlsym_free(): free(data->name:%s)\n”,data->name);
    @@ -69,6 +71,7 @@
    });
    free(data->type);
    }
  • dlfree(data);
    }

VALUE
Index: handle.c

— handle.c (revision 12047)
+++ handle.c (working copy)
@@ -10,9 +10,12 @@
void
dlhandle_free(struct dl_handle *dlhandle)
{

  • if (!dlhandle)
  • return;
    if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
  • dlclose(dlhandle->ptr);
  • dlclose(dlhandle->ptr);
    }
  • dlfree(dlhandle);
    }

VALUE

At Mon, 12 Mar 2007 23:41:59 +0900,
sheepman wrote:

リリース間近で気が引けますが、ruby/dl がメモリーリークを
起こしています。以下はパッチです。

 ありがとうございます。1.8.6リリースには入れませんでしたが、
後ほど対応します。


/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp

“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”