bugKawa - Bugs: bug #49943, kawa (command-line program) hangs...

 
 

bug #49943: kawa (command-line program) hangs when importing library twice

Submitter:  Sudarshan S Chawathe <chaw>
Submitted:  Wed 28 Dec 2016 12:44:40 AM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Unexpected result Status:  Confirmed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 02 Jan 2017 12:22:06 AM UTC, comment #3: 

When you do (include "128.sld") it parses "128.sld" and creates the (srfi 128) module. The "module file" is the file that does the including, not the file being included.  So the source file name of the (srfi 128) is something like "/dev/pts/0".  This confuses Kawa when it tried to re-import (srfi 128): It tries re-opening and re-reading /dev/pts/0.

As a work-around, you could use require instead of import:

(require srfi.128 "128.sld")

Per Bothner <bothner>
Group administrator
Wed 28 Dec 2016 03:35:45 PM UTC, comment #2: 

Another quick update: I recompiled Kawa with JLine3 support and the problem reported below still occurs, except now it is the fifth or sixth time (import (srfi 128)) is evaluated that causes kawa to hang.

I installed JLine itself by compiling it from its current git source.


Sudarshan S Chawathe <chaw>
Wed 28 Dec 2016 02:33:01 PM UTC, comment #1: 

An update to my earlier report:  I just 'git clone'd, built, and installed Kawa afresh and the problem seems to still exist. (The installation itself was without problems, including passing 'make check'.)

chaw@vereq:~/res/scheme/local-libs$ kawa --version
Kawa 2.2.1 (git describe: import-from-subversion-39-g7c1aba1-dirty)
Copyright (C) 2016 Per Bothner

chaw@vereq:~/res/scheme/local-libs$ kawa
#|kawa:1|# (include "128.sld")
/home/chaw/res/scheme/local-libs/128.body1.scm:241:9: warning - no use of norp?
#|kawa:2|# (import (srfi 128))
#|kawa:3|# (import (srfi 128))
^C
[*** hangs above *]

chaw@vereq:~/res/scheme/local-libs$ uname -a
Linux vereq.eip10.org 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) i686 GNU/Linux

chaw@vereq:~/res/scheme/local-libs$ java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK Server VM (build 25.111-b14, mixed mode)


Sudarshan S Chawathe <chaw>
Wed 28 Dec 2016 12:44:40 AM UTC, original submission:  

When I import a library multiple times, the kawa command-line program (simple REPL-in-a-terminal) hangs:

chaw@vereq:~/res/scheme/local-libs$ kawa
#|kawa:1|# (include "128.sld")
/home/chaw/res/scheme/local-libs/128.body1.scm:241:9: warning - no use of norp?
#|kawa:2|# (import (srfi 128))
#|kawa:3|# (import (srfi 128))

[... hangs here ...]

The "128.sld" file is from the sample implementation of SRFI 128.

I came across this problem when running a Kawa REPL within emacs and then distilled it down to the above in the plain kawa program (run from a terminal window).  Of course, I don't really need to import (srfi 128) twice, but it was the simplest way I found of getting the hanging behavior.  In my actual code, SRFI 128 is imported indirectly by a library I'm importing and then again directly (and that causes the Kawa REPL to hang).

I am not sure how reproducible this is for other setups, but figure it may be worthwhile reporting it nonetheless.  I am using Kawa 2.2 (revision 9049M) on a 32-bit Debian setup with OpenJDK 8 and I have been able to always reproduce it in my tests so far.  In a few cases, kawa did not hang on the second import, but did on the third or fourth.




 

Sudarshan S Chawathe <chaw>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by chaw (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
    2017-01-02 bothner StatusNone Confirmed
        Assigned toNone bothner

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code