bugKawa - Bugs: bug #18768, Problems with handling (require)...


bug #18768: Problems with handling (require) in the presence of (module-name)

Submitted by:  Margus Freudenthal <margus>
Submitted on:  Fri 12 Jan 2007 04:25:30 PM UTC  
Category: Code generationSeverity: 3 - Normal
Item Group: Compile-time exceptionStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 05 Feb 2007 06:03:46 PM UTC, comment #2:

Seems, that comments get "formatted" and spaces eaten.
Attaching diff this time.

(file #11921)

Madis Janson <mzz>
Mon 05 Feb 2007 06:00:01 PM UTC, comment #1:

Problem was caused by the fact that modules, that were availaible just by being a classes in CLASSPATH, did not have a sourceAbsPath in their ModuleInfo instances.

In current case this caused following:
Some module was compiled and kawa compiler implicitly created ModuleInfo for gnu.kawa.slib.srfi1 by calling ModuleManager.findWithClassName. This ModuleInfo got added as dependency to several modules that were to be compiled. Some time later when compiling other module, this srfi1 ModuleInfo dependency was checked to be current, and sourceAbsPath.getLastModified() thowed NullPointerException (since sourceAbsPath were null).

Following patch seems to fix the bug:

diff -ru kawa-1.9.1/gnu/expr/ModuleInfo.java kawa-1.9.1-cyber/gnu/expr/ModuleInfo.java
--- kawa-1.9.1/gnu/expr/ModuleInfo.java 2007-01-21 04:32:34.000000000 +0200
+++ kawa-1.9.1-cyber/gnu/expr/ModuleInfo.java 2007-02-05 19:35:11.000000000 +0200
@@ -349,6 +349,8 @@
if (lastCheckedTime + manager.lastModifiedCacheTime >= now)
return true;
+ if (sourceAbsPath == null)
+ return true; // this module has no source, so consider it current.
lastCheckedTime = now;
long lastModifiedTime = sourceAbsPath.getLastModified();
if (moduleClass == null && className != null)

Madis Janson <mzz>
Fri 12 Jan 2007 04:25:30 PM UTC, original submission:

Attached is set of modules that require each other (dependency graph is non-cyclical). Additionally they require 'list-lib and 'hash-table. I used (module-name) for assigning correct packages to these modules.

When compiling these, the compiler crashes:

java -cp .:/home/margus/java/kawa-svn/share/java/kawa.jar kawa.repl -C *.scm

(compiling accessors.scm to ee.cyber.iglu.model.states.accessors)
(compiling action-utils.scm to ee.cyber.iglu.model.states.actionutils)
(compiling compositestates.scm to ee.cyber.iglu.model.states.compositestates)
(compiling messages.scm to ee.cyber.iglu.model.states.messages)
(compiling tiractions.scm to ee.cyber.iglu.model.tirstates.tiractions)
internal error while compiling tiractions.scm
at gnu.expr.ModuleInfo.checkCurrent(ModuleInfo.java:351)
at gnu.expr.ModuleInfo.checkCurrent(ModuleInfo.java:405)
at kawa.standard.require.importDefinitions(require.java:210)
at kawa.standard.require.scanForDefinitions(require.java:185)
at kawa.lang.Syntax.scanForm(Syntax.java:65)
at kawa.lang.Translator.scanForm(Translator.java:952)
at gnu.kawa.lispexpr.LispLanguage.parse(LispLanguage.java:69)
at gnu.expr.Compilation.process(Compilation.java:1850)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:300)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:285)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:285)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:285)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:285)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:285)
at kawa.repl.compileFiles(repl.java:773)
at kawa.repl.processArgs(repl.java:426)
at kawa.repl.main(repl.java:828)

I am using the latest SVN sources. This bug was not in the 1.8.91 version and appeared in 1.8.95.

Margus Freudenthal <margus>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #11921:  kawa.diff added by mzz (602B - application/octet-stream - fix)
file #11733:  files.zip added by margus (2KiB - application/zip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mzz (Posted a comment)
  • -unavailable- added by margus (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 05 Feb 2007 06:03:46 PM UTCmzzAttached File-=>Added kawa.diff, #11921
    Fri 12 Jan 2007 04:25:30 PM UTCmargusAttached File-=>Added files.zip, #11733

    Back to the top

    Powered by Savane 3.1-cleanup1