Subject: Re: boehm-gc in dynamic libs
To: None <tech-pkg@netbsd.org>
From: Mario Kemper <magick@bundy.lip.owl.de>
List: tech-pkg
Date: 12/03/1999 13:42:11
[Posted and mailed]

In article <199912022346.IAA07038@azarin.localnet>,
	SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp> writes:
> magick@bundy.lip.owl.de (Mario Kemper) wrote:
> 
> Mario> ./test_cpp 1 2>/dev/null&&echo ok       
> Mario> Starting iteration 1 
> Mario> The test appears to have succeeded. 
> Mario> ok 
> 
> well it's ok.
> 
> Mario> But still no luck with oo2c.
> 
> How does it fail?  Any error message do you get?  Need more
> info...
> 
It hangs in an endless loop.

Some background: oo2c is an oberon to c compiler. Oberon is a
programming language by Wirth derived from ModulaII with object
oriented features. It makes heavy use of a garbage collector for
automatic deallocation of data structures.

I can build the system library (io functions and stuff) static. That
works but produces large binaries. Or i compile it using shared
libraries without the gc. This works too, but you run out of memory
fast as nothing gets freed.
The third version - shared lib with gc - hangs most of the time in an
endless loop or fails with a segfault. As the compiler is written in
oberon itself it makes use of the system lib and the gc.

If you're interested, oo2c is available from 
http://www.uni-kl.de/OOC/files/oo2c/

The following little test program i sufficent to trigger the problem:
----
MODULE Test; 
 
IMPORT Out; 
 
BEGIN 
  Out.String("Hello world");
  Out.WriteLn; 
END Test. 
----
to compile: oo2c --make Test

-- 
Mario Kemper
magick@bundy.lip.owl.de