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

 
 

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

Submitted by:  Sudarshan S Chawathe <chaw>
Submitted on:  Wed 28 Dec 2016 12:44:40 AM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Unexpected resultStatus: Confirmed
Privacy: PublicAssigned to: Per Bothner <bothner>
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 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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by chaw (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 02 Jan 2017 12:22:06 AM UTCbothnerStatusNone=>Confirmed
      Assigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1