Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#92 IDE hangs when pasting text to the find-textfield

Moderate
closed-fixed
NetBeans (62)
7
2009-02-22
2008-12-04
No

When you invoke the "/" command (incremental search) and than, in the text-field that appears at the bottom of the editor, you past the search term from the clipboard, you get a SecurityException and the IDE hangs.

I am attaching the full exception description with callstack and a full thread-dump describing the IDE hang.

Discussion

  • Marián Petráš

    SecurityException with full call-stack

     
  • Marián Petráš

    File Added: nbvi-search-bug-thread-dump.txt

     
  • Marián Petráš

    • milestone: 101033 --> Moderate
    • priority: 5 --> 7
     
  • Ernie Rael

    Ernie Rael - 2009-01-06

    I can't reproduce this; it works ok on windows. What version of jVi?
    To test it I did
    - go to beginning of a line and do: "*y$
    to copy the line to the clipboard
    - bring up the search dialog with: /
    - do: ^v
    and it gets copied to the search dialog,
    also with incremental search the matching line is highlighted
    (the highlight is what is failing)

    BTW, looking at the exception

    java.lang.SecurityException: All swing access to clipboard should be redirected to ExClipboard
    at org.netbeans.TopSecurityManager.checkWhetherAccessedFromSwingTransfer(TopSecurityManager.java:617)
    at org.netbeans.TopSecurityManager.checkPermission(TopSecurityManager.java:384)
    at java.lang.SecurityManager.checkSystemClipboardAccess(SecurityManager.java:1377)
    at sun.awt.X11.XToolkit.getSystemSelection(XToolkit.java:904)
    at org.netbeans.editor.BaseCaret.getSystemSelection(BaseCaret.java:716)
    at org.netbeans.editor.BaseCaret.updateSystemSelection(BaseCaret.java:707)
    at org.netbeans.editor.BaseCaret.fireStateChanged(BaseCaret.java:764)
    at org.netbeans.editor.BaseCaret.moveDot(BaseCaret.java:1103)
    at org.netbeans.editor.BaseCaret.moveDot(BaseCaret.java:1066)
    at org.netbeans.modules.jvi.NbCaret.moveDot(NbCaret.java:178)
    at com.raelity.jvi.swing.TextView.setSelect(TextView.java:453)

    It is doing a moveDot on the caret, and I guess the awt toolkit is sync'ing
    the clipboard and this is failing. The reason for the movDot is part of
    selecting the text that matches for incremental search; probably matching
    acc'd to what was just pasted.

    The problem may depend on where/how the string that is being copied from the
    clipboard got put into the clipboard. Does it fail if the copy comes from jVi?
    Does it fail if it is from a OS console window? Some other NB window? Other?
    Is this a new issue, did it used to work?

    This looks like a sunOS/JVM (or NB) issue. Notice the exception is in a NB
    method. If the clipboard text was set by jVi
    action, there may be some other way to do it and I can do that for a
    workaround. But I'm stuck at this point.

     
  • Ernie Rael

    Ernie Rael - 2009-01-06

    I guess my biggest question is whether this problem:
    java.lang.SecurityException: swing ... clipboard ... ExClipboard

    can only happen from the moveDot. If that is the case, then I can
    filter the situation; though I think I'll look around and maybe place
    some strategic catch statements to avoid anything that might cause the
    dialog to hang.

    I am curious how far this general problem with the clipboard goes.
    Does general use of the '*' (clipboard) register have the problem
    "*y
    "*p
    register (not with the dialog) show the problem?

    I guess this is SunOS. I wonder if linux has an issue?

    After I look around and get a bit more info, I'll probably file a NB
    issue and see if anyone over there has some insight to what's really
    going on. Most of the action, including throwing the exception comes
    from NB code.

     
  • Marián Petráš

    This is on Linux (Ubuntu 8.04 32-bit).
    NetBeans 6.5 or NetBeans 7.0 dev.
    jVi 1.2.1.alpha1 (NetBeans module ver. 1.2.1.12)
    JDK 1.6.0_11 (aka JDK 6u11)

    It is 100% reproducible.

     
  • Marián Petráš

    I do these steps to reproduce:

    1) Select some text in the editor with a mouse.
    2) Press Ctrl-C to copy it to the clipboard.
    3) bring up the search dialog with: /
    4) do Ctrl-V - I get the exception and the whole IDE is frozen

     
  • Ernie Rael

    Ernie Rael - 2009-01-31

    Hi Marián,

    Did you have the opportunity to try the version of jVi that I sent you?

    There is also a question raised about this in the NB issue which you might be able to answer.

     
  • Ernie Rael

    Ernie Rael - 2009-02-22

    Fixed in 1.2.2.

    NB bug closed as WONTFIX. Using suggested workaround.

     
  • Ernie Rael

    Ernie Rael - 2009-02-22
    • assigned_to: nobody --> err
    • status: open --> closed-fixed
     

Log in to post a comment.