[comp.sys.isis] Modula-3 and Isis, memory smashes

smgf@cl.cam.ac.uk (Steve Freeman) (05/14/91)

For reasons best left unspoken, I have been trying to use Isis from 
Modula-3. Unfortunately, after O(a couple of hundred) messages I get a 
memory smash during Modula-3 (v 1.6) garbage collection. This only seems to 
happen when I accept Isis messages - I can, for example, send messages to 
another process written in C without difficulty. I know that this is not a 
lot to go on, but has anyone got any ideas about places to look? Otherwise, 
I guess it's back to C :-\.

Thanks,

  -- Steve
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Steve Freeman, Computer Lab, University of Cambridge, UK
Steve.Freeman@computer-lab.cambridge.ac.uk

"The science of medicine is founded on conjecture and improved by murder"
   Sir Astley Cooper.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Steve Freeman, Computer Lab, University of Cambridge, UK
Steve.Freeman@computer-lab.cambridge.ac.uk

ken@CS.Cornell.EDU (Ken Birman) (05/15/91)

In article <1991May14.115813.1349@cl.cam.ac.uk> smgf@cl.cam.ac.uk (Steve Freeman) writes:
>For reasons best left unspoken, I have been trying to use Isis from 
>Modula-3. Unfortunately, after O(a couple of hundred) messages I get a 
>memory smash during Modula-3 (v 1.6) garbage collection. This only seems to 
>happen when I accept Isis messages - I can, for example, send messages to 
>another process written in C without difficulty. I know that this is not a 
>lot to go on, but has anyone got any ideas about places to look? Otherwise, 
>I guess it's back to C :-\.
>

This sounds really interesting!  I think Modula 3 is a great language and
we would be happy to help you get this working if you will post a patch
list to comp.sys.isis later so that other can benefit.  

Offline, how about sending me a short description of how you got the
interfaces to work and how the Modula-3 dynamic memory allocator actually
works.  Perhaps ISIS needs to negotiate with Modula 3 for the memory
it allocates, or perhaps some sort of argument passing problem is
causing us to misinterpret certain of the arguments passed from
Modula 3 into ISIS.  A third and forth problem to consider would be
that our tasking scheme is a problem (in Modula, we should probably
map the ISIS task primitives to the Modula task primitives) or that
"varargs" isn't working.

Anyhow, I am sure I can figure this out.  You seem to have gotten
pretty far.

-- 
Kenneth P. Birman                              E-mail:  ken@cs.cornell.edu
4105 Upson Hall, Dept. of Computer Science     TEL:     607 255-9199 (office)
Cornell University Ithaca, NY 14853 (USA)      FAX:     607 255-4428

ken@CS.Cornell.EDU (Ken Birman) (05/26/91)

In article <1991May14.115813.1349@cl.cam.ac.uk> smgf@cl.cam.ac.uk (Steve Freeman) writes:
> ... memory smash after O(hundreds of messages) ...

I talked to some people at DEC SRC and the problem is likely to be
in the way that M3 garbage collects.  To make a long story short,
you need to get ISIS to use the M3 tasking primitives.  Although
ISIS may seem to work when its own threads are combined with the
M3 scheme, M3 won't know that ISIS has pointers to your dynamically
allocated M3 objects on its stacks and hence may not relocate things
correctly.

On the other hand, you should NOT change ISIS to use the M3 allocator
instead of malloc.

The SRC M3 people can help you do the mapping (in cl_task.h, .c) if
you have problems.  See the CTHREADS example...

-- 
Kenneth P. Birman                              E-mail:  ken@cs.cornell.edu
4105 Upson Hall, Dept. of Computer Science     TEL:     607 255-9199 (office)
Cornell University Ithaca, NY 14853 (USA)      FAX:     607 255-4428