jajuk-team / jajuk

Advanded jukebox for users with large or scattered music collections
49 stars 19 forks source link

Freeze under Linux #2016

Open bflorat opened 6 years ago

bflorat commented 6 years ago

For some reasons, any jvm (1.7, 1.8,1.9) freezes under Linux on the KDE check (doing a ps ) :

In UtilSystem :

 if (isUnderLinux()) {
      BufferedReader stdInput = null;
      try {
        ProcessBuilder pb = new ProcessBuilder("ps", "-eaf");
        Process proc = pb.start();
        stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        proc.waitFor();
        String s;
        while ((s = stdInput.readLine()) != null) {
          if (s.matches(".*ksmserver.*")) {
            underKDE = true;
            break;
          }
        }

disabling selinux doesn't seem to change anything.

centic9 commented 4 years ago

Commit 1b0af0e453129f96d3637cd44a7c49395da0343c introduced a timeout of 5 seconds to not hang on this, but just delay a bit until startup continues.

centic9 commented 3 years ago

Fixed via https://github.com/jajuk-team/jajuk/commit/74b45c55a123beebcf1817ed7d3b46785262a2d8, the code should first read the output and then wait for the process to finish!