From 18fb9640ec642bc24da2c066845d9066a9a27f2b Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 24 Sep 2004 07:04:26 +0000 Subject: [PATCH] fixed windows dist.sh, also tweaks for a few message i/o bugs --- processing/app/PdeEditorConsole.java | 9 +-- processing/app/PdeMessageSiphon.java | 60 +++++------------- processing/app/PdeRuntime.java | 24 +++---- processing/build/windows/dist.sh | 28 ++++---- .../build/windows/launcher/launcher.cpp | 16 +++-- .../build/windows/launcher/processing.exe | Bin 33265 -> 33645 bytes processing/todo.txt | 20 ++++++ 7 files changed, 80 insertions(+), 77 deletions(-) diff --git a/processing/app/PdeEditorConsole.java b/processing/app/PdeEditorConsole.java index 201c4e9fb..f64ab0ff1 100644 --- a/processing/app/PdeEditorConsole.java +++ b/processing/app/PdeEditorConsole.java @@ -179,9 +179,6 @@ public class PdeEditorConsole extends JScrollPane { } */ - // to console display - appendText(what, err); - if (err) { systemErr.print(what); } else { @@ -196,10 +193,14 @@ public class PdeEditorConsole extends JScrollPane { systemOut.println(); } } + + // to console display + appendText(what, err); + // moved down here since something is punting } - private void appendText(String text, boolean err) { + synchronized private void appendText(String text, boolean err) { //if (true) return; try { diff --git a/processing/app/PdeMessageSiphon.java b/processing/app/PdeMessageSiphon.java index 57392442f..7c899d45d 100644 --- a/processing/app/PdeMessageSiphon.java +++ b/processing/app/PdeMessageSiphon.java @@ -2,10 +2,10 @@ /* PdeMessageSiphon - slurps up messages from compiler - Part of the Processing project - http://Proce55ing.net + Part of the Processing project - http://processing.org - Except where noted, code is written by Ben Fry and - Copyright (c) 2001-03 Massachusetts Institute of Technology + Earlier portions of this code are Copyright (c) 2001-04 MIT + Other parts are Copyright (c) 2004 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,73 +32,45 @@ class PdeMessageSiphon implements Runnable { public PdeMessageSiphon(InputStream stream, PdeMessageConsumer consumer) { - // we use a BufferedReader in order to be able to read a line - // at a time - // this.streamReader = new BufferedReader(new InputStreamReader(stream)); this.consumer = consumer; thread = new Thread(this); // don't set priority too low, otherwise exceptions won't - // bubble up in time (i.e. compile errors) + // bubble up in time (i.e. compile errors have a weird delay) //thread.setPriority(Thread.MIN_PRIORITY); thread.start(); } public void run() { - //while (Thread.currentThread() == thread) { - //System.err.print("p"); - //System.err.println(streamReader); - String currentLine; - try { // process data until we hit EOF; this will happily block // (effectively sleeping the thread) until new data comes in. - // when the program is finally done, + // when the program is finally done, null will come through. // + String currentLine; while ((currentLine = streamReader.readLine()) != null) { - //currentLine = streamReader.readLine(); - //if (currentLine != null) { consumer.message(currentLine); - //System.out.println("siphon wait"); } - /* - if (currentLine == null) { - System.out.println("PdeMessageSiphon: out"); - thread = null; - } - */ thread = null; - //System.err.println("PMS: " + currentLine); - //} } catch (NullPointerException npe) { - // ignore this guy, since it's prolly just shutting down - //npe.printStackTrace(); + // Fairly common exception during shutdown thread = null; } catch (Exception e) { - // on linux, a "bad file descriptor" message comes up when - // closing an applet that's being run externally. - // use this to cause that to fail silently since not important - //String mess = e.getMessage(); - //if ((PdeBase.platform != PdeBase.LINUX) || - //(e.getMessage().indexOf("Bad file descriptor") == -1)) { - if (e.getMessage().indexOf("Bad file descriptor") == -1) { - System.err.println("PdeMessageSiphon err " + e); + // On Linux and sometimes on Mac OS X, a "bad file descriptor" + // message comes up when closing an applet that's run externally. + // That message just gets supressed here.. + String mess = e.getMessage(); + if ((mess != null) && + (mess.indexOf("Bad file descriptor") != -1)) { + //if (e.getMessage().indexOf("Bad file descriptor") == -1) { + //System.err.println("PdeMessageSiphon err " + e); e.printStackTrace(); - thread = null; } + thread = null; } - - /* - //Thread.yield(); - try { - Thread.sleep(100); - } catch (InterruptedException e) { } - */ - //System.out.println("PdeMessageSiphon: out"); } - //System.err.println("siphon thread exiting"); } diff --git a/processing/app/PdeRuntime.java b/processing/app/PdeRuntime.java index 6a71b1924..8b76a2b61 100644 --- a/processing/app/PdeRuntime.java +++ b/processing/app/PdeRuntime.java @@ -407,13 +407,6 @@ public class PdeRuntime implements PdeMessageConsumer { } else { messageLineCount++; - // TODO this is insufficient. need to cycle through the - // different classes that are currently loaded and see if - // there is an error in one of them. - //String className = sketch.mainClassName; - - //\s+at\s([\w\d\._]+)\.([\<\w\d_]+)\(([\w\d_].java\:(\d+) - /* java.lang.NullPointerException at javatest.(javatest.java:5) @@ -548,19 +541,22 @@ java.lang.NullPointerException this.input = input; thread = new Thread(this); + // unless this is set to min, it seems to hork the app + // since it's in charge of stuffing the editor console with strings + // maybe it's time to get rid of/fix that friggin console thread.setPriority(Thread.MIN_PRIORITY); thread.start(); } public void run() { - byte boofer[] = new byte[1024]; + byte boofer[] = new byte[256]; - // read, block until something good comes through while (Thread.currentThread() == thread) { try { - //System.out.println("readin"); + // can't use a buffered reader here because incremental + // print statements are interesting too.. causes some + // disparity with how System.err gets spewed, oh well. int count = input.read(boofer, 0, boofer.length); - //System.out.println("readout " + count); if (count == -1) { thread = null; @@ -574,6 +570,12 @@ java.lang.NullPointerException //e.printStackTrace(System.out); //e.printStackTrace(); thread = null; + + } catch (Exception e) { + System.out.println("SystemOutSiphon: i just died in your arms tonight"); + e.printStackTrace(); + thread = null; + //System.out.println(""); } //System.out.println("SystemOutSiphon: out"); //thread = null; diff --git a/processing/build/windows/dist.sh b/processing/build/windows/dist.sh index 0fab00f6d..eb8486a75 100755 --- a/processing/build/windows/dist.sh +++ b/processing/build/windows/dist.sh @@ -13,9 +13,6 @@ rm -rf processing-* # use 'shared' files as starting point cp -r ../shared processing -# something like the following might be better: -# find / -name "*.mp3" -exec rm -f {}\; -# and same for cvsignore rm -rf processing/CVS rm -rf processing/lib/CVS rm -rf processing/lib/netscape/CVS @@ -28,10 +25,10 @@ rm -rf processing/sketchbook/default/CVS rm -f processing/sketchbook/default/.cvsignore # new style examples thing ala reas -cd processing/sketchbook +cd processing unzip -q examples.zip rm examples.zip -cd ../.. +cd .. # new style reference cd processing @@ -53,8 +50,9 @@ mkdir processing/lib/build # grab pde.jar and export from the working dir cp work/lib/pde.jar processing/lib/ -cp -r work/lib/export processing/lib/ -rm -rf processing/lib/export/CVS +cp work/lib/core.jar processing/lib/ +#cp -r work/lib/export processing/lib/ +#rm -rf processing/lib/export/CVS # get jikes and depedencies #gunzip < dist/jikes.gz > processing/jikes.exe @@ -67,16 +65,17 @@ cp dist/run.bat processing/ #cp dist/lib/pde_windows.properties processing/lib/ # get serial stuff from the bagel dir -cp ../../bagel/serial/comm.jar processing/lib/ -cp ../../bagel/serial/javax.comm.properties processing/lib/ -cp ../../bagel/serial/win32com.dll processing/ -chmod +x processing/win32com.dll +#cp ../../bagel/serial/comm.jar processing/lib/ +#cp ../../bagel/serial/javax.comm.properties processing/lib/ +#cp ../../bagel/serial/win32com.dll processing/ +#chmod +x processing/win32com.dll # convert notes.txt to windows LFs # the 2> is because the app is a little chatty unix2dos processing/readme.txt 2> /dev/null unix2dos processing/revisions.txt 2> /dev/null -unix2dos processing/lib/pde.properties 2> /dev/null +unix2dos processing/lib/preferences.txt 2> /dev/null +unix2dos processing/lib/keywords.txt 2> /dev/null #unix2dos processing/lib/pde_windows.properties 2> /dev/null # zip it all up for release @@ -101,3 +100,8 @@ rm -rf $P5/java zip -rq $P5-expert.zip $P5 echo Done. + + +# something like the following might be better: +# find / -name "*.mp3" -exec rm -f {}\; +# and same for cvsignore, ~ files, .DS_Store diff --git a/processing/build/windows/launcher/launcher.cpp b/processing/build/windows/launcher/launcher.cpp index 62a7a1370..309c8a400 100644 --- a/processing/build/windows/launcher/launcher.cpp +++ b/processing/build/windows/launcher/launcher.cpp @@ -163,10 +163,10 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) //"'" "%s" - "%s" - "%s" + //"%s" + //"%s" - "%s\\lib\\comm.jar;" + //"%s\\lib\\comm.jar;" "%s\\lib;" "%s\\lib\\build;" "%s\\lib\\pde.jar;" @@ -185,11 +185,15 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) // the first three %s args //local_jre_installed ? "java\\lib\\rt.jar;java\\lib\\jaws.jar;" : "", local_jre_installed ? "java\\lib\\rt.jar;" : "", - qtjava_path, - env_classpath, + //qtjava_path, + //env_classpath, // the next several %s args - loaddir, loaddir, loaddir, loaddir, loaddir, loaddir, loaddir); + loaddir, loaddir, loaddir, loaddir, + loaddir, loaddir, loaddir); + + //MessageBox(NULL, cp, + // "it's twoo! it's twoo!", MB_OK); if (!SetEnvironmentVariable("CLASSPATH", cp)) { MessageBox(NULL, "Could not set CLASSPATH environment variable", diff --git a/processing/build/windows/launcher/processing.exe b/processing/build/windows/launcher/processing.exe index 3c19b00d43d6be4015935faa6e3dce537cbeb701..3b8622f9d21687d4e731b39623daa98b08fe4f77 100755 GIT binary patch delta 4302 zcmaJ^3v5&86~5OvPaJHBlL86MB!*E+Thk?`w2|g$@h~k9LwKYm!FFEcVJD7rLxUDD zG!4V^0!~lIc#8mojjCI=OdWy>S)?UAw(@BA5L(-GLY-05DlnEI*4F#}d#`Ohy;NPd~DbMjlnW=gFD>N_l z@yr!j9M>~09E$y(UP@iaZ=hYND=C(GluEN_4@T0Anu4>LP_Um2+YO;Ilx9B}(wbug za9C^RY{>U>x|Ct%-Sl-ve((hF?or(^n3WvjO3X0>pi5Hs-zcwF``%^dfk>_-qUABX z6ib(RL!mCSmbw24HWP|Wvx!qUEssyg;~!%jy0|FXb4&j-TtfE4LNGmKG{;m3x#S|}H1L-`DpyGPR@{#qQBgx4MJxg~67g&9kw&<|^U2wQz`(<3kebbA% zv}|T?01DeLcRw@*pYMJ+Nxye1fbNHyt|cfy#{yu}JrH9BMPPg17ExqIiy4u*d(_Zd z_h39v)FohWnVz%c42&X;nzqc zpPT0aB!u_MWI-mclE){e70JS zQsz6yb}5u&!;^sN%@y^s6ME|vy$M>MPSCmzttSjU{0{o9!Nl9>mSKI+l#dPTI6G{A zrxb129%UwE|69Kq4jc>#y)2=B@1HNCf0WQ05<1eqP((izhehU){Z79HNXQ=RFB0u& z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fzP;6al6cy&QzM z#5A4fn=b2BCvCS#C;V4=f%BTrOlZnO0GIlr{I~!aT9_3AbP|}kRu@Z z3Y*`6@Rlg(BM|fuKHG1u1IzrMza-x?t+*U2Qvb)Rbew5|Lltub6o;buJC#m zgq7lfXLLavKn8_dH%N~nH1R-jGNc)q{qr*_y3un`Us_jJ>TPqET8eS`?9RrPPHzkS ne#bDKe?>p?&Q6;!lG!^$Amgsak;A)21#OetW0wvpK12Tlc@LYc diff --git a/processing/todo.txt b/processing/todo.txt index 1681701eb..a292ffc33 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -96,6 +96,26 @@ X errorMessage in PSerial/PClient/PServer are all using System.out X write handler for loop() error, warning user to rename loop to draw X c:/fry/processing/build/windows/work/lib/build/Temporary_1452_9170.java:29:6:29:11: Semantic Error: The method "void loop();" with default access cannot replace the accessible method "void loop();" with public access declared in type "processing.core.PApplet". +hanging bug +* it may be something to do with the editor consoles. try shutting off +output to the console and see if it'll still crash. +* most likely related to io streams to the external java process. when +run via a disconnected process, using "cmd /c start java", the thing +will never hang. in that instance, the process terminates almost +immediately, and no i/o needs to happen (since it's a cmd prompt that +never shows up). +* it could also be a graphics sync bug that just gets more testy +because the environment, a second java process, is running at the same +time. mis.newPixels() may hork since it's over in the applet's thread, +and it might be calling repaint() or Toolkit.sync() to update the +image on-screen. +* shows up on key presses.. not sure if this is because of the actual +key press, or if it's because they're often accompanied by a println() +* blank spaces in filenames/parent folder often cause trouble.. not +sure if related. same for PATH and CLASSPATH. +* some virus scanning software, particularly older NAV versions cause +the trouble. + _ be able to link against, but not export, certain parts of lib _ jsyn.jar not needed on export, netscape libs not needed on export _ netscape.javascript not properly working in 1.4