Opened 5 weeks ago

Last modified 3 weeks ago

#1506 new defect

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.0rc1
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 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/
[klm@kth test]$ csc -static test.scm && ./test

Change History (2)

comment:1 Changed 4 weeks ago by sjamaan

  • Version changed from 5.0 to 5.0.0rc1

comment:2 Changed 3 weeks ago by sjamaan

  • Milestone changed from 5.0 to 5.1
  • Summary changed from chicken-install produces dependency cycles to module 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.scm
Note: See TracTickets for help on using tickets.