#1506 closed defect (fixed)

module importing itself does not result in an error

Reported by: kristianlm Owned by:
Priority: major Milestone: 5.1
Component: core tools Version: 5.0.0
Keywords: Cc:
Estimated difficulty:


Doing this hangs csc forever:

[klm@kth test]$ chicken-install check-errors
building check-errors
  installing check-errors
[klm@kth test]$ echo '(import type-errors-numbers) (print "ok")' > test.scm
[klm@kth test]$ csc test.scm && ./test
[klm@kth test]$ csc -static test.scm && ./test

I think the cause has something to do with the static dependency list of check-error's type-errors-numbers module:

[klm@kth test]$ cat ~/.chickens/5.0.0rc1/lib/chicken/9/type-errors-numbers.link 
(type-errors-numbers type-errors-basic)
[klm@kth test]$ # this shouldn't contain itself, should it?
[klm@kth test]$ # this seems to be a reasonable workaround:
[klm@kth test]$ echo '(type-errors-basic)' > ~/.chickens/5.0.0rc1/lib/chicken/9/type-errors-numbers.link
[klm@kth test]$ csc -static test.scm && ./test

Change History (5)

comment:1 Changed 20 months ago by sjamaan


comment:2 Changed 19 months ago by sjamaan

Milestone: 5.05.1
Summary: chicken-install produces dependency cyclesmodule importing itself does not result in an error

It looks like a bug in the egg: The implementation of type-errors-numbers imports its own module!

The weird thing is that we don't get a warning or error while compiling this module. The compiler should give an error about that I think. It's not really a new bug, though. It's not necessary to fix this for 5.0.

A simplified reproduction case:

(module foo () (import foo))

And then

csc -J -c -static -emit-link-file foo.link foo.scm

comment:3 Changed 17 months ago by sjamaan

Version: 5.0.0rc15.0.0

comment:4 Changed 17 months ago by sjamaan


comment:5 Changed 12 months ago by evhan

Resolution: fixed
Status: newclosed

Fixed by 2b4ded59.

Note: See TracTickets for help on using tickets.