I have a single application which will cause eclipse itself to hang when run via eclipse. If I export this application as a jar and run it it works fine. But if I run (or debug) it the application will appear to start (according to ps) and run; but eclipse itself will hang, and is reported as a 'stopped' program with no CPU or memory usage. I've placed a breakpoints on the first line of this application and it doesn't even get there before eclipse ends up stopped. If I forcefully wake eclipse out of stopped state it will work; but it will also lose it's connection with the program I started. My program I want to debug will continue running but eclipse can't control or kill it after I resume the stopped eclipse.
我有一个应用程序,它将导致eclipse本身在通过eclipse运行时挂起。如果我将此应用程序导出为jar并运行它,它可以正常工作。但是如果我运行(或调试)它,应用程序似乎将启动(根据ps)并运行;但是eclipse本身会挂起,并被报告为没有CPU或内存使用的“已停止”程序。我在这个应用程序的第一行放置了一个断点,它甚至没有在eclipse结束停止之前到达那里。如果我强行将eclipse从停止状态唤醒,它将起作用;但它也会失去与我开始的程序的联系。我想要调试的程序将继续运行,但是在我恢复停止的日食之后,eclipse无法控制或杀死它。
I can run plenty of other applications without issue from eclipse. Oddly I had this issue before, then I could run my application for a day, and now I'm back to the original issue. I don't know what changed between those that would matter.
我可以在没有eclipse问题的情况下运行大量其他应用程序。奇怪的是我之前遇到过这个问题,然后我可以运行我的应用程序一天,现在我又回到原来的问题了。我不知道那些重要的事情之间发生了什么变化。
Can anyone suggest what may cause this or how to repair it?
任何人都可以建议可能导致此问题或如何修复它?
UPDATE:
更新:
I did some more linux magic. It seems that eclipse is stopped while waiting for the command: sh -c stty -lcanon min 1
我做了更多Linux魔术。似乎eclipse在等待命令时停止:sh -c stty -lcanon min 1
It also seems that before that there was a sh (defunct) command which also hung without being reaped for a few minutes which I think was keeping eclipse from running properly; the sh (defunct) finally goes away if I wait long enough; but then the sh command I just linked comes up. I don't know what the original defunct SH command was; I can't do ps fast enough to catch it before it goes defunct. Both issues occur only with eclipse; as a jar file this program runs perfectly fine.
在此之前,似乎还有一个sh(已解散)的命令,该命令也在没有被收获几分钟的情况下挂起,我认为这样可以防止日食正常运行;如果我等了足够久,sh(已解散)最终会消失;但是我刚刚联系的sh命令出现了。我不知道原来已经解散的SH命令是什么;我不能做得足够快,以便在它消失之前抓住它。这两个问题只发生在日食中;作为一个jar文件,这个程序运行得很好。
My running assumption is that eclipse isn't getting or handling the sigchild correctly? that would explain the sh (defunct) application at least. It doesn't explain the current SH command which doesn't show as defunct; despite it being something that should execute in seconds?
我的运行假设是eclipse无法正确获取或处理sigchild?这至少可以解释sh(废弃)的应用。它没有解释当前的SH命令没有显示为已不存在;尽管它应该在几秒钟内执行?
UPDATE 2.0:
更新2.0:
I found this link: http://linux.about.com/od/srl_howto/a/hwtsrl13t04_3.htm basically stty is known to hang when it uses the < /dev/tty syntax; which is why the syntax is deprecated and replaced with a newer syntax. I'm pretty sure this is the problem. Sadly I have no way of figuring out what library is using the deprecated command. I think this all started with the ConsoleReader being constructed; but who knows what code actually ran the command that freezes? also, it seems if this was that broken anyone running consoleReader from eclipse on a linux environment would have the same problem; which I think is safe to assume isn't the case or it would be documented all over the net; so maybe my understanding is still off?
我发现这个链接:http://linux.about.com/od/srl_howto/a/hwtsrl13t04_3.htm基本上stty在使用
3 个解决方案
#1
3
It is related to the configuration of the stty process that is created to attach the console and hence will occur only on UNIX like systems. Seems fixed on current 2.11 jline version.
它与为附加控制台而创建的stty进程的配置有关,因此仅在类似UNIX的系统上发生。似乎固定在当前的2.11 jline版本上。
To bypass the problem you can disable the special unix-terminal capabilities using:
要绕过此问题,您可以使用以下命令禁用特殊的unix-terminal功能:
-Djline.terminal=none
-Djline.terminal =无
as VM argument on the eclipse launch configuration.
作为eclipse启动配置的VM参数。
#2
0
Try increasing -Xms<abc>m/-Xmx<efg>m
(depending on the system memory) on eclipse.ini
in the root directory of eclipse installation.
尝试在eclipse安装的根目录中的eclipse.ini上增加-Xms
#3
0
The problem was that we were using an older version of 'jline' which used deprecated functionality. The new jline jar fixed the problem, as it no longer used the deprecated stty calls. I'm not quite certain why eclipse caused this to happen every time; it seems as if it should be an intermittent error, but jline was definitely the cause.
问题是我们使用旧版本的'jline',它使用了不推荐使用的功能。新的jline jar解决了这个问题,因为它不再使用已弃用的stty调用。我不太确定为什么日食每次都会发生这种情况;似乎它应该是一个间歇性的错误,但jline肯定是原因。
#1
3
It is related to the configuration of the stty process that is created to attach the console and hence will occur only on UNIX like systems. Seems fixed on current 2.11 jline version.
它与为附加控制台而创建的stty进程的配置有关,因此仅在类似UNIX的系统上发生。似乎固定在当前的2.11 jline版本上。
To bypass the problem you can disable the special unix-terminal capabilities using:
要绕过此问题,您可以使用以下命令禁用特殊的unix-terminal功能:
-Djline.terminal=none
-Djline.terminal =无
as VM argument on the eclipse launch configuration.
作为eclipse启动配置的VM参数。
#2
0
Try increasing -Xms<abc>m/-Xmx<efg>m
(depending on the system memory) on eclipse.ini
in the root directory of eclipse installation.
尝试在eclipse安装的根目录中的eclipse.ini上增加-Xms
#3
0
The problem was that we were using an older version of 'jline' which used deprecated functionality. The new jline jar fixed the problem, as it no longer used the deprecated stty calls. I'm not quite certain why eclipse caused this to happen every time; it seems as if it should be an intermittent error, but jline was definitely the cause.
问题是我们使用旧版本的'jline',它使用了不推荐使用的功能。新的jline jar解决了这个问题,因为它不再使用已弃用的stty调用。我不太确定为什么日食每次都会发生这种情况;似乎它应该是一个间歇性的错误,但jline肯定是原因。