Menu

#26 GUI hangs

open
Swing GUI (5)
4
2008-11-27
2008-11-08
Anonymous
No

If I try to sync files.

The GUI does not do anything. The Procress bar stops at 0% and one CPU is completely used.

Is there a Debug switch to get more information ?

Discussion

  • Jens Heidrich

    Jens Heidrich - 2008-11-27
    • priority: 5 --> 4
    • assigned_to: nobody --> heidrich
     
  • Jens Heidrich

    Jens Heidrich - 2008-11-27

    All error messages can be found in the log file. While JFS hangs goto the .jfs directory of your home directory and copy file "Log.txt". You may of course look into that file using the GUI if the program does not hang ;-).

    Could you please provide a scenario of how to replicate the bug.

     
  • Nobody/Anonymous

    Hi, have the same problem. First start of jfs after upgrading to ubuntu 08.10 ibex.

    Starting jfs from selfmade starter button:
    GUI with all buttons appears.
    Buttons will not respond to clicks.
    Changing windows an comming back: Window is grey.

    Starting from terminal: grey

    Closing by "x" on the window: Application does not respond.

    Java 5 and 6 installed.

    On notebook with ibex: No problem

    Thought it might be the profils. Deleted the jfs folder and unzipped the package: Same problem.

    No log.txt in Folder or subfolders :(

     
  • Nobody/Anonymous

    I do have the same problem since I run ibex. Laptop runs fine but the GUI freezes on my main PC.

    Starting jfs
    All buttons on the jfs window are dead. Clicks will do nothing.

     
  • Marek

    Marek - 2009-05-01

    I have the same problem as the "nobodies" above.

    The GUI freezes occasionally when I start the compare or sync process. A popup window is showed and then you can do nothing more. No log.txt is produced!
    I'm working on a Kubuntu 9.04 machine, but I had the same problem on Kubuntu 8.10. I'm syncing an autofs folder with a samba folder with about 30 GB data in a lot of files and subfolders.

     
  • Nobody/Anonymous

    hi, new try after installing Jaunty.

    Then realize that it hangs with "futex_wait" in process list.
    Then installed jedit.
    AAARG Same Problem!
    Then deinstalled jre's ==> shit jfs starts still same problem ==> where does it get jre from???
    Then deinstalled java-common with all stuff, even dependencies like openoffice ==> no change?!?!

    So, it is a java problem. But where does it come from? Why does it still start and the freeze? I thought: No Java JRE, no Java?!?!

    I have to sleep on this!

     
  • Nobody/Anonymous

    add-on: I was Nobody from 2009-01-15 20:22

    And jyes, I even rebooted :(

     
  • Anonymous

    Anonymous - 2009-11-06

    I also get GUI / program freezes consistently in winxp and vista 32.

    Steps to reproduce:
    Set some folders with lots of files to be copied to another location on disk or external drive, force source structure.
    Run compare then run sync, ok. Now without closing the program run compare again.
    Or Run compare, then run another compare.

     
  • Andreas Strahm

    Andreas Strahm - 2009-12-28

    Hello. Thank you for providing this great tool JFileSync. I've been using it on Mac OS X for quite a while. But on Snow Leopard it doesn't work in 64 bit mode. It freezes when starting the comparision or the synchronizing action.

    Being a software developer, I started debugging this issue. I finally found an programming error in the class JFSProgressView:
    Both the methods compareInThread() and synchronizeInThread() are affected. Depending on the thread scheduling it is possible that the blocking JDialog.setVisible(true) is called before the newly started thread runs (the method run() is invoked). You should correct the code of both methods like this:

    /**
    * Performs the xxx as a separate thread.
    */
    public final void xxxInThread() {
    final JDialog dialog = this;

    // Create new thread:
    final Thread thread = new Thread() {
    public void run() {
    SwingUtilities.invokeLater(new Runnable() {
    public void run()
    {
    // Make dialog window visible:
    dialog.setVisible(true);
    }
    });

    // Wait for dialog to appear:
    while (!dialog.isVisible()) {
    try {
    Thread.sleep(1);
    }
    catch (InterruptedException exception) {
    // OK
    }
    }

    // xxx:
    ...

    // Hide dialog:
    dialog.setVisible(false);
    }
    };

    // Start thread:
    thread.start();
    }

     
  • Andreas Strahm

    Andreas Strahm - 2009-12-28

    My first solution doesn't really work (shame on me, I only tested compare but not synchronize). Better use a monitor to wait for the new thread starting before opening the modal dialog box.

    final Object monitor = new Object();

    In method run():
    synchronized(monitor) {
    monitor.notifyAll();
    }

    After starting the thread but before opening the dialog box:
    synchronized(monitor) {
    try {
    monitor.wait();
    }
    catch (InterruptedException exception) {
    }
    }

    You may delete the other code snippet.

     
  • Yuriy Tkach

    Yuriy Tkach - 2010-02-25

    Great application! Thanks. Use it very often in my daily work. I also experienced the UI hangs issues. Being a java developer myself, I solved the problem in the following way using CountDownLatch and switching that latch in the EDT:

    JFSProgressView:

    public final void compareInThread() {

    final CountDownLatch startLatch = new CountDownLatch(1);

    CompareThread thread = new CompareThread(startLatch, this);

    thread.start();

    // On the EDT putting latch to terminal condition,

    // so sync thread will start executing _after_ dialog appears

    SwingUtilities.invokeLater(new Runnable() {

    public void run() {

    startLatch.countDown();

    }

    });

    // Make dialog window visible:

    this.setVisible(true);

    }

    public final void synchronizeInThread() {

    final CountDownLatch startLatch = new CountDownLatch(1);

    SyncThread thread = new SyncThread(startLatch, this);

    thread.start();

    SwingUtilities.invokeLater(new Runnable() {

    public void run() {

    startLatch.countDown();

    }

    });

    this.setVisible(true);

    }

    /**

    * Thread, that waits for latch to reach terminal condition (this can be

    * dialog appear) and then executes something (defined in subclasses)

    */

    private abstract class AwaitThread extends Thread {

    private CountDownLatch latch = null;

    private JDialog dialog = null;

    public AwaitThread(CountDownLatch latch, JDialog dialog) {

    this.latch = latch;

    this.dialog = dialog;

    }

    public void run() {

    try {

    latch.await();

    executeInThread();

    dialog.setVisible(false);

    } catch (InterruptedException e) {

    e.printStackTrace();

    }

    }

    protected abstract void executeInThread();

    }

    private class SyncThread extends AwaitThread {

    public SyncThread(CountDownLatch latch, JDialog dialog) {

    super(latch, dialog);

    }

    protected void executeInThread() {

    JFSSynchronization.getInstance().synchronize();

    }

    }

    private class CompareThread extends AwaitThread {

    public CompareThread(CountDownLatch latch, JDialog dialog) {

    super(latch, dialog);

    }

    protected void executeInThread() {

    JFSComparison.getInstance().compare();

    }

    }

    I also want to add couple of new handy UI features to the program. I think they will be useful for many people. Is it possible for you to add me as a developer? Thanks.

     

Log in to post a comment.

MongoDB Logo MongoDB