Blank Load on Ubuntu

Issue #547 closed
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Open a large file on Ubuntu

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

  1. Run an Ubuntu VM with 4G memory
  2. Run treeview (latest master as or 5/26/2017)
  3. Open the large_6kx6k_average_4.cdt file (with atr and gtr files next to it)
  4. Open the small_133x133.txt file
  5. Open the large_6kx6k_average_4.cdt file again

CURRENT BEHAVIOR

The first time you run treeview, step 3 results in a blank white matrix loading and only the row row and left-most column's label is shown on hover. Step 4 produces a normal matrix with no problems. Step 5 again loads a blank matrix, but the label panes work normally and you can select, navigate and zoom.

blank_load.pngblank_load_import.png1label.png

Also, the following is printed in the terminal:

Checking if preferences exist for the new file.
Target node not found. Could not copy data.
Using import dialog.
Painting repaint call 2324
Resetting model.
Adding data to model...
Calculating mean.
Calculating median.
Truncating sorted data array.
Resetting MapContainers and DendroView components.
Could not find or create MapContainer node because parentNode was null.
Could not find or create MapContainer node because parentNode was null.
Could not find or create MapContainer node because parentNode was null.
Could not find or create MapContainer node because parentNode was null.
Could not find or create ColorPresets node because parentNode was null.
Could not find or create MatrixViewController node because parentNode was null.
Error: Could not find or create ArrayameViewnode because parentNode was null.
Error: Could not find or create ColumnLabelView node because parentNode was null.
No old node was found when trying to copy old preferences. Aborting import attempt.
Found Existing node in MRU list for /home/robleach/host/large_6kx6k_average_4.cdt
Creating subNode File1495837871278
Creating new fileset /home/robleach/host/large_6kx6k_average_4.cdt
Restoring components states.
Successfully loaded: /home/robleach/host/large_6kx6k_average_4.cdt

EXPECTED BEHAVIOR

File opens as normal.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

I'm not sure what's happening here, so I'm not sure where to start. Since it complains about preferences nodes, I tried resetting preferences. I tried moving the jar and the files out of the shared folder from the host system.

FILES AFFECTED (where the changes will be implemented) - developers only

unknown

LEVEL OF EFFORT - developers only

medium

COMMENTS

Comments (5)

  1. Robert Leach reporter

    On the first open of a file (which has actually been opened before but for which prefs weren't [fully?] saved):

    Checking if preferences exist for the new file.
    Target node not found. Could not copy data.
    Using import dialog.
    Resetting model.
    Adding data to model...
    Calculating mean.
    Calculating median.
    Truncating sorted data array.
    Resetting MapContainers and DendroView components.
    New ColorSet: Red-Green
    New ColorSet: Yellow-Blue
    Registering Plugin Dendrogram
    ColorSet could not be returned because no Preferences node was defined. Returned default Red-Green.
    Could not find or create MapContainer node because parentNode was null.
    Could not find or create MapContainer node because parentNode was null.
    Could not find or create MapContainer node because parentNode was null.
    Could not find or create MapContainer node because parentNode was null.
    Could not find or create ColorPresets node because parentNode was null.
    Could not find or create MatrixViewController node because parentNode was null.
    Error: Could not find or create ArrayameViewnode because parentNode was null.
    Error: Could not find or create ColumnLabelView node because parentNode was null.
    Could not store state for RowSummary because configNode was null.
    Could not store state for ColSummary because configNode was null.
    Warning: Encountered invalid/negative firstVisible value: [-1].  Resetting.
    Warning: Encountered invalid/too-small numVisible value: [0].  Resetting.
    Warning: Encountered invalid/negative firstVisible value: [-1].  Resetting.
    Warning: Encountered invalid/too-small numVisible value: [0].  Resetting.
    No old node was found when trying to copy old preferences. Aborting import attempt.
    Found Existing node in MRU list for /home/robleach/Desktop/large_6kx6k_average_4.cdt
    Creating subNode File1496850434734
    Creating new fileset /home/robleach/Desktop/large_6kx6k_average_4.cdt
    Restoring components states.
    Unable to get stored MapContainer state. ConfigNode was null.
    Unable to get stored MapContainer state. ConfigNode was null.
    Unable to get stored MapContainer state. ConfigNode was null.
    Unable to get stored MapContainer state. ConfigNode was null.
    Could not synchronize state for null because configNode was null.
    Could not synchronize state for null because configNode was null.
    Successfully loaded: /home/robleach/Desktop/large_6kx6k_average_4.cdt
    Could not find scale. No preferences node defined for edu.stanford.genetics.treeview.plugin.dendroview.MapContainer
    Could not find scale. No preferences node defined for edu.stanford.genetics.treeview.plugin.dendroview.MapContainer
    Could not find scale. No preferences node defined for edu.stanford.genetics.treeview.plugin.dendroview.MapContainer
    Could not find scale. No preferences node defined for edu.stanford.genetics.treeview.plugin.dendroview.MapContainer
    
  2. Robert Leach reporter

    This resolves issue 547 - blank load on Ubuntu for large data files.

    There were 2 issues:

    1. An out of memory exception was silently occurring in a SwingWorker thread and the main thread proceeded without realizing that the data was not fully loaded.

    2. 2 copies of the large data matrix were being created, which was unnecessary. While it may be unnecessary to create any copies, I eliminated the need for the second copy by retrieving the array index of the first occurrence of a NaN or infinite value and then using that value to get the median from the un-truncated array.

    I also noted that when the failure occurs, the user is "returned" to the openFile dialog, even if they used the "Open Last File" button. I will create an issue for that.

    → <<cset a9965a3735f7>>

  3. Robert Leach reporter

    The problem turned out to be an exception happening in a swingworker that slips by completely unnoticed. The parent thread moves on without ever knowing that the load failed. I added a flag in TVController that the worker sets to true as it's last line of code and that allows the main thread to know something went wrong (if it's not true).

    I also reduced the amount of memory needed for finding the median which avoids the exception all together, resulting in a successful load.

    Also included a warning to the user.

    I will be adding a catch for the exception.

  4. Log in to comment