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

 
 

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

Submitter:  Margus Freudenthal <margus>
Submitted:  Fri 12 Jan 2007 04:25:30 PM UTC
   
 
Category:  Code generation Severity:  3 - Normal
Item Group:  Compile-time exception Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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
java.lang.NullPointerException
        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 Files:
   
   
Comment:
   

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
  • -email is unavailable- added by mzz (Posted a comment)
  • -email is unavailable- added by margus (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-05 mzz Attached File- Added kawa.diff, #11921
    2007-01-12 margus Attached File- Added files.zip, #11733

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code