Subject: self-referential alien struct crashes compiler
From: Kalle Olavi Niemitalo <[email-masked]>
To: Debian Bug Tracking System <[email-masked]>
Date: 29 Sep 2001 21:18:09 +0300

Package: cmucl
Version: 3.0.3
Severity: normal

In the home directory, make a file "alien.lisp" that contains:

(alien:def-alien-type nil
  (alien:struct problematic
    (eof (* (function c-call:void (* (alien:struct problematic)))))))

Then start CMUCL with the normal or safe core and compile the
file twice:

* (compile-file "home:alien.lisp")

Python version 1.0, VM version Intel x86 on 29 SEP 01 08:47:44 pm.
Compiling: /home/kalle/alien.lisp 29 SEP 01 08:40:57 pm

Byte Compiling Top-Level Form: 

home:alien.x86f written.
Compilation finished in 0:00:00.

#p"/home/kalle/alien.x86f"
NIL
NIL
* (compile-file "home:alien.lisp")

Python version 1.0, VM version Intel x86 on 29 SEP 01 08:48:06 pm.
Compiling: /home/kalle/alien.lisp 29 SEP 01 08:40:57 pm

[GC threshold exceeded with 2,010,544 bytes in use.  Commencing GC.]
[GC completed with 1,666,704 bytes retained and 343,840 bytes freed.]
[GC will next occur when at least 3,666,704 bytes are in use.]
[GC threshold exceeded with 3,675,664 bytes in use.  Commencing GC.]
[GC completed with 3,675,664 bytes retained and 0 bytes freed.]
[GC will next occur when at least 5,675,664 bytes are in use.]
[GC threshold exceeded with 5,686,800 bytes in use.  Commencing GC.]
[GC completed with 5,688,752 bytes retained and -1,952 bytes freed.]
[GC will next occur when at least 7,688,752 bytes are in use.]
[GC threshold exceeded with 7,703,984 bytes in use.  Commencing GC.]

In the second pass, CMUCL keeps allocating bytes until it has
approximately 44 million (or 24 million with the safe core), then
gets a segmentation fault.  Needless to say, I would like the
second compilation to finish successfully like the first one.

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux Astalo 2.4.10-kon.astalo.2 #1 ke syys   26 21:16:50 EEST 2001 i686 unknown

Versions of the packages cmucl depends on:
ii  common-lisp-co 2.7            This is a common lisp source and compiler ma
ii  libc6          2.2.3-9        GNU C Library: Shared libraries and Timezone