Terminator double-launches (64bit Win7, 32-bit Java 1.7.21, Cygwin 1.7.17); java-launcher.exe fails to exit

265 views
Skip to first unread message

jclerman0

unread,
Apr 22, 2013, 2:04:44 PM4/22/13
to terminat...@googlegroups.com
Hi,

In recent fresh installs of Cygwin & Terminator, I've found that Terminator runs fine under the latest Cygwin, and I don't need to roll back to the "last known good" Cygwin documented on the website.

However, on a new laptop using latest Cygwin and Terminator, I've been experiencing an annoying issue, which manifests in 2 ways:
 1. After launching Terminator and exiting the program, java-launcher.exe fails to exit, and hangs around in the process table.
 2. Subsequent launches of Terminator (UNLESS I have manually killed any stray java-launcher.exe processes first) cause two windows to open - apparently, two instances of Terminator are starting.

After launching such a "N+1" Terminator, I see that two separate "terminator-N.log" files have been edited.  Here are the contents of both of them:

########################  First Log File #############################################################
2013-04-22T10:34:01.252-0700 Terminator: Java 1.7.0_21 (VM 23.21-b01, runtime 1.7.0_21-b11)
2013-04-22T10:34:01.253-0700 Terminator: Windows 7 6.1/x86 x8
2013-04-22T10:34:01.253-0700 Terminator: CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin 4.5.3-4) (GCC) ) 2012-10-19 14:39
2013-04-22T10:34:01.253-0700 Terminator: Revision 1640 (3261)
2013-04-22T10:34:01.254-0700 Terminator: Built 2011-10-25T09:22:02-07:00
2013-04-22T10:34:01.590-0700 Terminator: Created PtyProcess[pid=7912,fd=3,pty="/dev/pty2"] and logging to C:\cygwin\home\jlerman\.terminator\logs\2013-04-22T103401.539-0700-%2Fbin%2Ftcsh.txt
2013-04-22T10:34:01.949-0700 Terminator: echo localhost:61678 > C:\cygwin\home\jlerman\.terminator\terminator-server-port
2013-04-22T10:34:07.75-0700 Terminator: Problem reading output from PtyProcess[pid=7912,fd=3,pty="/dev/pty2"]
Associated exception:
java.io.IOException: Underlying input stream returned zero bytes
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at terminator.terminal.TerminalControl$ReaderRunnable.run(TerminalControl.java:152)
    at java.lang.Thread.run(Unknown Source)
2013-04-22T10:34:07.75-0700 Terminator: calling waitFor on PtyProcess[pid=7912,fd=3,pty="/dev/pty2"]
2013-04-22T10:34:07.77-0700 Terminator: waitFor returned on PtyProcess[pid=7912,fd=-1,pty="/dev/pty2",didExitNormally,exitValue=0]
2013-04-22T10:45:55.160-0700 Terminator: Created PtyProcess[pid=5756,fd=3,pty="/dev/pty2"] and logging to C:\cygwin\home\jlerman\.terminator\logs\2013-04-22T104555.010-0700-%2Fbin%2Ftcsh.txt
########################  End of First Log File #############################################################


(Above, note the last line of the file - that is where the first new Terminator window is apparently created).

About 5 seconds pass, then another window opens:

########################  Second Log File #############################################################
2013-04-22T10:46:02.415-0700 Terminator: Java 1.7.0_21 (VM 23.21-b01, runtime 1.7.0_21-b11)
2013-04-22T10:46:02.416-0700 Terminator: Windows 7 6.1/x86 x8
2013-04-22T10:46:02.416-0700 Terminator: CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin 4.5.3-4) (GCC) ) 2012-10-19 14:39
2013-04-22T10:46:02.417-0700 Terminator: Revision 1640 (3261)
2013-04-22T10:46:02.417-0700 Terminator: Built 2011-10-25T09:22:02-07:00
2013-04-22T10:46:02.714-0700 Terminator: Created PtyProcess[pid=7616,fd=3,pty="/dev/pty3"] and logging to C:\cygwin\home\jlerman\.terminator\logs\2013-04-22T104602.664-0700-%2Fbin%2Ftcsh.txt
2013-04-22T10:46:03.168-0700 Terminator: echo localhost:61886 > C:\cygwin\home\jlerman\.terminator\terminator-server-port
########################  End of Second Log File #############################################################

...after exiting (via "exit" in the Cygwin shell) all of the open Terminator windows, the 2nd log file (actually, all of the log files) contains some additional lines:

2013-04-22T10:55:51.397-0700 Terminator: Problem reading output from PtyProcess[pid=7616,fd=3,pty="/dev/pty3"]
Associated exception:
java.io.IOException: Underlying input stream returned zero bytes
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at terminator.terminal.TerminalControl$ReaderRunnable.run(TerminalControl.java:152)
    at java.lang.Thread.run(Unknown Source)
2013-04-22T10:55:51.397-0700 Terminator: calling waitFor on PtyProcess[pid=7616,fd=3,pty="/dev/pty3"]
2013-04-22T10:55:51.399-0700 Terminator: waitFor returned on PtyProcess[pid=7616,fd=-1,pty="/dev/pty3",didExitNormally,exitValue=0]


...by now I am left with a bunch of java-launcher.exe instances hanging around.  I kill all of them and launch a new Terminator, wait a few seconds, and "exit" from the shell:

2013-04-22T11:02:47.109-0700 Terminator: Java 1.7.0_21 (VM 23.21-b01, runtime 1.7.0_21-b11)
2013-04-22T11:02:47.110-0700 Terminator: Windows 7 6.1/x86 x8
2013-04-22T11:02:47.111-0700 Terminator: CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin 4.5.3-4) (GCC) ) 2012-10-19 14:39
2013-04-22T11:02:47.111-0700 Terminator: Revision 1640 (3261)
2013-04-22T11:02:47.111-0700 Terminator: Built 2011-10-25T09:22:02-07:00
2013-04-22T11:02:47.415-0700 Terminator: Created PtyProcess[pid=6048,fd=3,pty="/dev/pty1"] and logging to C:\cygwin\home\jlerman\.terminator\logs\2013-04-22T110247.358-0700-%2Fbin%2Ftcsh.txt
2013-04-22T11:02:47.667-0700 Terminator: echo localhost:61960 > C:\cygwin\home\jlerman\.terminator\terminator-server-port
2013-04-22T11:03:01.420-0700 Terminator: Problem reading output from PtyProcess[pid=6048,fd=3,pty="/dev/pty1"]
Associated exception:
java.io.IOException: Underlying input stream returned zero bytes
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at terminator.terminal.TerminalControl$ReaderRunnable.run(TerminalControl.java:152)
    at java.lang.Thread.run(Unknown Source)
2013-04-22T11:03:01.421-0700 Terminator: calling waitFor on PtyProcess[pid=6048,fd=3,pty="/dev/pty1"]
2013-04-22T11:03:01.427-0700 Terminator: waitFor returned on PtyProcess[pid=6048,fd=-1,pty="/dev/pty1",didExitNormally,exitValue=0]

...once again the java-launcher.exe is still hanging around.

Any ideas??

Thanks,
--Jeff

Martin Dorey

unread,
Apr 29, 2013, 1:43:10 AM4/29/13
to terminator-users
That was intriguing enough to drive me back to my Windows installation, which limps onward, earlier reports of its imminent demise seemingly exaggerated.  I was running Cygwin 1.7.7 and some old version of Terminator.  On quitting it, java-launcher.exe and rubyw.exe and ruby-launcher.exe hung around in the process table.  jstack on the java-launcher pid worked, suggesting that Java doesn't want to quit, rather than some horrible Cygwin-related deadlock.  I don't (yet) know why.

I upgrade Cygwin to the latest and, lo, it seemed to work for me again.  Wow, big news.  I could even do jobs as complicated as building Terminator though, when I did so, it didn't then work.  I've committed a fix for what was stopping it from working completely.  Now the self-built version is just flaky, getting fork failures when I do things like "ls".  Humph.

Before upgrading, I think it must have been, I tried to sort out the nightly build, which hadn't worked for some months.  I ran it once manually and it uploaded https://code.google.com/p/jessies/downloads/detail?name=terminator-26.178.6834.msi&can=2&q=.  Coincidentally, modern Cygwin seems to have Ruby 1.9 and I'd just this week updated my desktop Linux installation to use the same major release.  I found several problems in our code, fixes for which I've committed this week.  https://code.google.com/p/jessies/source/detail?r=6831 springs to mind as possibly relevant.  When you double-click the Terminator icon, it tries to communicate with any running Terminator to tell that instance to open a new window.  The bug meant that the code was failing to grok the response.  Even if it succeeded, it would think it had failed.  In case of failure, it starts a second Java VM to open that new window.  This sounds like your symptom, so I think you might be in luck with the aforementioned 26.178.6834 version.

If the nightly build works tomorrow, then I expect it will upload a flakier version, so you might want to exercise more than usual caution in choosing your next Terminator download.  I'd be interested in your mileage with whatever you're willing to try.

Sorry for the lag,




--
You received this message because you are subscribed to the Google Groups "terminator-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terminator-use...@googlegroups.com.
To post to this group, send email to terminat...@googlegroups.com.
Visit this group at http://groups.google.com/group/terminator-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Martin Dorey

unread,
May 1, 2013, 12:56:58 AM5/1/13
to terminator-users
I finally got cron working for today's build.  To my surprise, it appears to work.  java-launcher.exe still doesn't quit, but will open a new window for a new double click on the Terminator icon gracefully.  I was unable to crash it with ls, find or building itself.  Starting it from rxvt worked fine too.  I almost think I imagined my problems from two days ago.

jclerman0

unread,
May 3, 2013, 3:15:17 PM5/3/13
to terminat...@googlegroups.com
Wow, that sounds pretty good; thanks for your work!  I haven't been checking the group daily and must not have it set to email me responses to my posts, so I just saw this today.  I will have to download and test sometime soon (no time today).  From your description, sounds like java-launcher.exe is still failing to quit, though for all we know that problem could be longstanding, and I guess it's minor so long as it doesn't result in the double-launches.

Thanks,
--Jeff

Martin Dorey

unread,
May 4, 2013, 12:03:57 PM5/4/13
to terminat...@googlegroups.com
Starting to get to grips with how it all works, I find I've lost
jstack and jps visibility of java-launcher, perhaps with a JRE
upgrade. A JDK upgrade, to Java 7, matching the JRE, didn't help
that, but did gift me lots of warnings. I similarly didn't get
anything out of jconsole, which I was hoping to use to interrogate
HungAwtExitMBean. I changed the code to call HungAwtExit from
TerminatorFrame. There are never any displayable frames and, if you
pane-close rather than type "exit", then there are sometimes no
timers. Even the timers that are sometimes there are one-shot,
short-duration ones. If I double click again, then close the new
frame, HungAwtExit says that there are 2 frames, neither of which is
displayable. If I do it again, then the count is 3. I don't know for
sure what that means, but I suspect it means that HungAwtExit doesn't
know why Swing hasn't quit. It's kind-of good, from the end-user
perspective, because it's then quicker to reopen. I don't like not
understanding how it's behaving.

On 5/3/13, jclerman0 <jcle...@gmail.com> wrote:
> Wow, that sounds pretty good; thanks for your work! I haven't been
> checking the group daily and must not have it set to email me responses to
> my posts, so I just saw this today. I will have to download and test
> sometime soon (no time today). From your description, sounds like
> java-launcher.exe is still failing to quit, though for all we know that
> problem could be longstanding, and I guess it's minor so long as it doesn't
>
> result in the double-launches.
>
> Thanks,
> --Jeff
>
> On Tuesday, April 30, 2013 9:56:58 PM UTC-7, mad wrote:
>>
>> I finally got cron working for today's build. To my surprise, it appears
>>
>> to work. java-launcher.exe still doesn't quit, but will open a new window
>>
>> for a new double click on the Terminator icon gracefully. I was unable to
>>
>> crash it with ls, find or building itself. Starting it from rxvt worked
>> fine too. I almost think I imagined my problems from two days ago.
>>
>>
>> On Sun, Apr 28, 2013 at 10:43 PM, Martin Dorey
>> <marti...@gmail.com<javascript:>
>>> <jcle...@gmail.com<javascript:>
>>> > wrote:
>>>
>>>> Hi,
>>>>
>>>> In recent fresh installs of Cygwin & Terminator, I've found that
>>>> Terminator runs fine under the latest Cygwin, and I don't need to roll
>>>> back
>>>> to the "last known good" Cygwin documented on the website.
>>>>
>>>> However, on a new laptop using latest Cygwin and Terminator, I've been
>>>> experiencing an annoying issue, which manifests in 2 ways:
>>>> 1. After launching Terminator and exiting the program,
>>>> java-launcher.exe fails to exit, and hangs around in the process table.
>>>> 2. Subsequent launches of Terminator (UNLESS I have manually killed any
>>>>
>>>> stray java-launcher.exe processes first) cause two windows to open -
>>>> apparently, two instances of Terminator are starting.
>>>>
>>>> After launching such a "N+1" Terminator, I see that two separate
>>>> "terminator-N.log" files have been edited. Here are the contents of
>>>> both
>>>> of them:
>>>>
>>>> ######################## First Log File
>>>> #############################################################
>>>> 2013-04-22T10:34:01.252-0700 Terminator: Java 1.7.0_21 (VM 23.21-b01,
>>>> runtime 1.7.0_21-b11)
>>>> 2013-04-22T10:34:01.253-0700 Terminator: Windows 7 6.1/x86 x8
>>>> 2013-04-22T10:34:01.253-0700 Terminator: CYGWIN_NT-6.1-WOW64 version
>>>> 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de <javascript:>) (gcc
>>>> 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de <javascript:>) (gcc
>>>> 1.7.17(0.262/5/3) (cor...@calimero.vinschen.de <javascript:>) (gcc
>>>> an email to terminator-use...@googlegroups.com <javascript:>.
>>>> To post to this group, send email to
>>>> terminat...@googlegroups.com<javascript:>
>>>> .
>>>> Visit this group at
>>>> http://groups.google.com/group/terminator-users?hl=en.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "terminator-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to terminator-use...@googlegroups.com.
> To post to this group, send email to terminat...@googlegroups.com.
> Visit this group at http://groups.google.com/group/terminator-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

--
Sent from my mobile device

Martin Dorey

unread,
May 6, 2013, 9:31:56 PM5/6/13
to terminator-users
Still no jps, but I eventually found my way to http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=16f2669c3444e367183c2ebd45cf?bug_id=6313817, which taught me not to give Cygwin pids to jstack, whereupon I can get this after closing the only frame:

martind@vm-martind ~
$ /cygdrive/c/Program\ Files/Java/jdk1.7.0_21/bin/jstack 2136 | grep prio | grep -v daemon
"AWT-EventQueue-1" prio=6 tid=0x0f974c00 nid=0x73c waiting on condition [0x10eda000]
"main" prio=6 tid=0x00daa400 nid=0x840 waiting on condition [0x00000000]
"VM Thread" prio=10 tid=0x02f3d800 nid=0x9b0 runnable 
"VM Periodic Task Thread" prio=10 tid=0x0f868000 nid=0x1b4 waiting on condition 

martind@vm-martind ~

Contrast on Linux, with a frame open (and openjdk6):

mad@shuttle:~$ jstack 9252 | grep prio | grep -v daemon
"DestroyJavaVM" prio=10 tid=0x00007fe8942d4800 nid=0x2425 waiting on condition [0x0000000000000000]
"AWT-EventQueue-0" prio=10 tid=0x00007fe894115800 nid=0x2438 in Object.wait() [0x00007fe8935f2000]
"AWT-Shutdown" prio=10 tid=0x00007fe894115000 nid=0x2437 in Object.wait() [0x00007fe8934f1000]
"VM Thread" prio=10 tid=0x00000000007db000 nid=0x2428 runnable 
"GC task thread#0 (ParallelGC)" prio=10 tid=0x0000000000781000 nid=0x2426 runnable 
"GC task thread#1 (ParallelGC)" prio=10 tid=0x0000000000783000 nid=0x2427 runnable 
"VM Periodic Task Thread" prio=10 tid=0x00007fe894007000 nid=0x242f waiting on condition 
mad@shuttle:~$ 

I get the non-quitting behavior on Windows even when running terminator --help, which never opens a frame.  This fails to find e/utils/StringUtilities.class (because there's no salma-hayek classes.jar and it doesn't know to look in terminator) but quits cleanly:


~/software.jessies.org/work/salma-hayek/bin/fatbits works and quits cleanly, despite using the Cygwin java-launcher.  When its frame is up, I see:

martind@vm-martind ~
$ /cygdrive/c/Program\ Files/Java/jdk1.7.0_21/bin/jstack 1880 | grep prio | grep -v daemon
"AWT-EventQueue-0" prio=6 tid=0x0db6ec00 nid=0xc6c waiting on condition [0x0eeda000]
"AWT-Shutdown" prio=6 tid=0x0db69400 nid=0x778 in Object.wait() [0x0ea1a000]
"main" prio=6 tid=0x00da9400 nid=0xa20 waiting on condition [0x00000000]
"VM Thread" prio=10 tid=0x02f3cc00 nid=0xad0 runnable 
"VM Periodic Task Thread" prio=10 tid=0x0da67400 nid=0xef8 waiting on condition 

martind@vm-martind ~

Terminator with one frame:

martind@vm-martind ~
$ /cygdrive/c/Program\ Files/Java/jdk1.7.0_21/bin/jstack 1512 | grep prio | grep -v daemon
"AWT-EventQueue-0" prio=6 tid=0x0f3eb000 nid=0x9c0 waiting on condition [0x0f98a000]
"AWT-Shutdown" prio=6 tid=0x0f3eac00 nid=0xb30 in Object.wait() [0x0ec1a000]
"AWT-EventQueue-1" prio=6 tid=0x0db6d800 nid=0xb28 waiting on condition [0x0f0da000]
"main" prio=6 tid=0x00daa400 nid=0x9d0 waiting on condition [0x00000000]
"VM Thread" prio=10 tid=0x02f3dc00 nid=0x8b8 runnable 
"VM Periodic Task Thread" prio=10 tid=0x0da70400 nid=0x6b8 waiting on condition 

With that frame closed:

martind@vm-martind ~
$ /cygdrive/c/Program\ Files/Java/jdk1.7.0_21/bin/jstack 1512 | grep prio | grep -v daemon
"AWT-EventQueue-1" prio=6 tid=0x0db6d800 nid=0xb28 waiting on condition [0x0f0da000]
"main" prio=6 tid=0x00daa400 nid=0x9d0 waiting on condition [0x00000000]
"VM Thread" prio=10 tid=0x02f3dc00 nid=0x8b8 runnable 
"VM Periodic Task Thread" prio=10 tid=0x0da70400 nid=0x6b8 waiting on condition 

martind@vm-martind ~

The problem still presents if main() returns immediately, so it's probably something in what a C++ programmer would call "global constructors".

Running the FatBits main class from bin/terminator quits OK.  Commenting out everything from terminator.Terminator quits OK.  Class.forName("terminator.Terminator") from FatBits's constructor quits OK but loading it from the start of FatBits.main doesn't.  After EventQueue.invokeLater, it works.

...

Huh, nailed it.  Check-in on the way...

jclerman0

unread,
May 9, 2013, 11:26:09 PM5/9/13
to terminat...@googlegroups.com
Sounds like you got it.  I went to download the updated version tonight and realized that I can't find it.  When I download the MSI file posted in the Downloads section at http://software.jessies.org/terminator/#downloads, I get a file dated in October 2011.  Looks like it hasn't changed in quite some time.  Is there a better place to go?

Thanks,
--Jeff

Martin Dorey

unread,
May 10, 2013, 4:39:51 AM5/10/13
to terminator-users
https://code.google.com/p/jessies/downloads/list

(I expected software.jessies.org to have disappeared some months ago.)
Reply all
Reply to author
Forward
0 new messages