This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Nov 18, 2009, at 2:15 AM, Per Bothner wrote:
Not sure what's going on. What happens with a shared repl is that it creates a (thread-specific) environment, and then sets that to share (indirect to) the parent environment. I suspect the problem is that the "parent environment" in our case ends up being something unsuitable (for a reason I'm not clear on).
That's (more or less) what I figured. I'm still trying to grok what exactly goes on behind the scenes with repls and Environments and Threads (oh my!).
Perhaps creating a fresh environment before you start, and then passing that for each shared REPL would work. Right now I'm a bit swamped with my day job, but I'll try to look at it when I get a chance.
OK, thanks, I know how that is. Luckily(?) for me, this *is* my day job right now (well, part of it, anyway). If I make any discoveries I'll be sure to post.
Exception occurred: java.lang.NullPointerException (to be caught at: gnu.mapping.RunnableClosure.run(), line=107 bci=91)"thread=Thread-6", kawa.Shell.getOutputConsumer(), line=126 bci=20
Thread-6[1] where
[1] kawa.Shell.getOutputConsumer (Shell.java:126)
[2] kawa.Shell.run (Shell.java:181)
[3] kawa.Shell.run (Shell.java:165)
[4] mil.navy.nrl.apps.util.scheme.JRHReplDocument$2.apply0 (JRHReplDocument.java:109)
[5] gnu.mapping.RunnableClosure.run (RunnableClosure.java:105)
[6] gnu.mapping.Future.run (Future.java:40)
return Language.getDefaultLanguage().getOutputConsumer(out);
thread = new Future( new kawa.repl(language) { public Object apply0 () { Language.setDefaults( language ); // THIS IS TO AVOID A NPE Shell.run( language, Environment.getCurrent() ); SwingUtilities.invokeLater( new Runnable() { public void run() { JRHReplDocument.this.fireDocumentClosed(); }}); return Values.empty; } }, penvironment, in_p, out_stream, err_stream );
Exception occurred: gnu.mapping.UnboundLocationException (to be caught at: kawa.Shell.run(), line=280 bci=305)"thread=Thread-6", gnu.mapping.Location.get(), line=67 bci=23
Thread-6[1] where
[1] gnu.mapping.Location.get (Location.java:67)
[2] gnu.expr.Compilation.getCurrent (Compilation.java:2,855)
[3] gnu.kawa.lispexpr.LispLanguage.parse (LispLanguage.java:51)
[4] gnu.expr.Language.parse (Language.java:503)
[5] kawa.Shell.run (Shell.java:244)
[6] kawa.Shell.run (Shell.java:184)
[7] kawa.Shell.run (Shell.java:165)
[8] mil.navy.nrl.apps.util.scheme.JRHReplDocument$2.apply0 (JRHReplDocument.java:109)
[9] gnu.mapping.RunnableClosure.run (RunnableClosure.java:105)
[10] gnu.mapping.Future.run (Future.java:40)
Compilation save_comp = Compilation.getCurrent();Apparently, Compilation.setCurrent() had not yet been called, and so that Location was unbound. Since save_comp is only used to restore the state after parse() finishes its work, the value didn't strike me as being very important. So, I made sure to call Compilation.setCurrent() before Shell.run():
thread = new Future( new kawa.repl(language) {
public Object apply0 () {
Language.setDefaults( language ); // <- otherwise, occasional NPE
Compilation.setCurrent( null ); // <- otherwise, consistent ULE
Shell.run( language, Environment.getCurrent() );
SwingUtilities.invokeLater( new Runnable() {
public void run() {
JRHReplDocument.this.fireDocumentClosed();
}});
return Values.empty;
}
}, penvironment, in_p, out_stream, err_stream );
-- Jamison Hope The PTR Group www.theptrgroup.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |