This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241728 - Netbeans causes Linux to freeze when it runs an executable
Summary: Netbeans causes Linux to freeze when it runs an executable
Status: REOPENED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-12 01:44 UTC by yeti
Modified: 2017-06-17 03:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeti 2014-02-12 01:44:32 UTC
For a detailed description and possibly answers, see: https://stackoverflow.com/questions/21716898/certain-code-in-java-in-netbeans-freezes-gnome-in-linux

Content of question:

If I run any process, be it a shell script through Ant, or ssh which requires user-interaction. Then when started from Netbeans, this freezes my Gnome GUI. I am only able to move around the mouse but it does not respond to anything. I can still CTRL+ALT+Fx to another TTY and my PC still behaves normally (no infinite loop or so --> CPU usage is nearly 0%).

When I try to kill a process, then it says in the ps listing and N/A in the System Monitor. Even with kill -9 PID this won't work. The only way I found to fix this is by a reboot.

I made a simple test-case, and the crash is really consistent. Always when I run this code from Netbeans (running the jar from outside Netbeans works perfectly fine), the freeze occurs:

package javaapplication1;

/**
 *
 * @author yeti
 */
public class JavaApplication1
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        // This code freezes gnome
        try
        {
            Runtime.getRuntime().exec("ssh yeti@127.0.0.1");
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

}
To make the test-case work, you will need to run a sshd service with default settings. It will ask for password and rsa-key-fingerprint check, thus this is user-interaction. E.g. echo "Hello world." will not cause any problems!

But also running a shell-script in Ant after compilation - with the <exec> tag - will result in the same problem.

I have no useful log-information, because around the time that the problem occurs there are no system logs. I am running Arch Linux distribution, and checked Xorg and journalct logs, but there's nothing in it that is out of the ordinary.
Comment 1 yeti 2014-02-12 22:08:52 UTC
I see the 'component' is being changed, but beware, this happens if Netbeans starts any executable through both Ant and Java give the same behaviour! So both through <exec /> and Runtime.getRuntime() but also through Apache Commons Exec library. When I tried to make a ssh/rsync-plugin for Netbeans, using an external executable same thing occured.
Anybody been able to replicate this on another machine?
Comment 2 Milos Kleint 2014-02-13 12:00:33 UTC
can you attach the netbeans log file? (http://wiki.netbeans.org/FaqLogMessagesFile)

please note that your main class is likely executed via <exec> ant task as well (from within the IDE's JVM). Please also turn debug logging on in the ant build and attach it to the issue.

which jdk version are we talking about? is it oracle's jdk? in general I'm inclined to think that a java program per se cannot do what you describe, it's mostly the VM's fault.
Comment 3 Milos Kleint 2014-02-13 13:45:57 UTC
another interesting experiment would be to run the said program in a maven project. Maven project builds execute in separate JVM, unlike ant projects.
Comment 4 Tomas Stupka 2014-09-12 11:27:16 UTC
any update on this?
Comment 5 multi_coder 2017-06-17 03:00:17 UTC
This is still an issue in 2017. I created a maven project, and this failed as well. Just passing on the information to you all. A work around I am going to use is to run those commands in C++ code instead of java, and just call the code from java with command line options there.

Live Long and Prosper!