[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: someone could port libgc

Roland McGrath wrote:

> There are some potential problems with your patch.  It doesn't look to me
> like it would really work.  I think it is a bit premature to send patches
> like this upstream when you have not been able to adequately test them.

Yes, but at least the maintainer knows, (on previous packages I have been
shouted at for this).

I will try to write a test program for this.  It is all part my learning process
for Hurd and the packages it uses.  Any hints gratefully received.


> The type of signal handlers on the Hurd is BSD-style:
>         void (*handler) (int sig, int code, struct sigcontext *scp)
> For SIGSEGV, the code will be the fault address.
> There is no need to reset signal handlers every time on the Hurd (or on
> linux with glibc).

Many thanks,  this change incorporated, (for the Hurd).

> As to the stack bounds, the problem here is that it's not a fixed range of
> addresses.  The value you got (0x101a000) will not necessarily be the same
> with other executables, or in theory from run to run, it's just not
> something you can rely on statically.

This implies that to use libgc, every program would need, (cut from config.h):

*     Client code may set GC_stackbottom before calling any GC_ routines.
 *    If the author of the client code controls the main program, this is
 *    easily accomplished by introducing a new main program, setting
 *    GC_stackbottom to the address of a local variable, and then calling
 *    the original main program.  The new main program would read something
 *    like:
 *              # include "gc_private.h"
 *              main(argc, argv, envp)
 *              int argc;
 *              char **argv, **envp;
 *              {
 *                  int dummy;
 *                  GC_stackbottom = (ptr_t)(&dummy);
 *                  return(real_main(argc, argv, envp));
 *              }

Will this solve the problem of 'variable' stack bottom?

Thanks for your comments, will probably carry on experimenting with libgc.  If
any experts want to take over, at least I could supply a starter patch.


> --
> To UNSUBSCRIBE, email to debian-hurd-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: