bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bugs #11862] can't open file input ports except on Kawa main


From: Steve Yegge
Subject: [Bug-kawa] [bugs #11862] can't open file input ports except on Kawa main thread
Date: Sat, 5 Feb 2005 16:46:14 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11862>

                 Summary: can't open file input ports except on Kawa main
thread
                 Project: Kawa
            Submitted by: stevey
            Submitted on: Sat 02/05/2005 at 16:46
                Category: Scheme library
                Severity: 5 - Average
              Item Group: Run-time exception
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

I've found that I can't read data from files using Scheme input ports on any
thread other than Kawa's main interpreter thread.  This causes problems for
me in Swing applications, since Swing events happen on a separate dedicated
thread.



This use case demonstrates the problem:



(invoke

 (make <java.lang.Thread>

   (object (<java.lang.Runnable>)

           ((run) :: <void>

            (let ((p (open-input-file "very-small-test.scm")))

              (let f ((x (read-line p)))

                (if (eof-object? x)

                    (begin

                      (close-input-port p)

                      '())

                    (cons x (f (read-line p)))))))))

 'start)

java.lang.NullPointerException

        at gnu.mapping.InPort.openFile(InPort.java:97)

        at gnu.mapping.InPort.openFile(InPort.java:91)

        at kawa.lib.ports.openInputFile(ports.scm:2)

        at atInteractiveLevel$275$object.run(<stdin>:1844)

        at java.lang.Thread.run(Thread.java:534)



If you run the let-expression without wrapping in a thread, it works fine.



It's hard to tell from the stack trace, but some poking around showed that
CallContext.getInstance() or CallContext.getInstance.getEnvironment() was
null, can't remember which anymore.  



This problem only appears to happen in 1.7.91, not in 1.7, and it happens
using Sun JDK 1.4.2 and also 1.5.0 (on Linux and Cygwin/XP).






    _______________________________________________________

This item URL is:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11862>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]