Robbin,

You certainly should try Sylvain's suggestion, but I'm not sure it will fix
the problem.
Whether or not it does, could you send me the assembler output of your 
older opteron compiler so I might see where the stack clearing patch is
getting
confused?

Here's how to get gcc to generate this file:

  CFLAGS="whatever flags you used for your Ruby make"
  gcc -S  $CFLAGS  eval.c

This will produce eval.s, the assembler source code.

If you want something much smaller that would probably contain the
information I need,
try generating the eval.s file first before making the change rubysig.h that
Sylvain suggests,
save that file, change rubysig.h, generate eval.s again, then diff the two
versions of
eval.s and send me just that diff (or post it to this list).

  gcc -S  $CFLAGS  eval.c
  mv eval.s eval.s.b4
  {edit rubysig.h}
  gcc -S  $CFLAGS  eval.c
  diff -u eval.s.b4  eval.s  >eval.s.diff

After we fix this, I'd be very interested to see whether MBARI7 manages
to keep the memory size in Rails as low as MBARI6 did.

- brent


Bugzilla from sylvain.joyeux / m4x.org wrote:
> 
> 
>   in rubysig.h, replace __builtin_frame_address by alloca() in the
> following
>   four lines:
> 
> # else  /* slower, but should work everywhere gcc does */
> #  define _set_sp(sp)  VALUE *sp = _get_tos();
> NOINLINE(static VALUE *_get_tos(void)) {return
> __builtin_frame_address(0);}
> # endif
> #else  /* slowest, but should work everwhere */
> 
> so that they look like that:
> 
> # else  /* slower, but should work everywhere gcc does */
> #  define _set_sp(sp)  VALUE *sp = _get_tos();
> NOINLINE(static VALUE *_get_tos(void)) {return alloca(0);}
> # endif
> #else  /* slowest, but should work everwhere */
> 
> My guess is that __builtin_frame_address does not work as expected on your
> GCC
> version (it works fine on an amd64 with gcc 4.3)
> 
> Sylvain
> 
> 

-- 
View this message in context: http://www.nabble.com/-ruby-core%3A19846---Bug--744--memory-leak-in-callcc--tp20447794p21358062.html
Sent from the ruby-core mailing list archive at Nabble.com.