Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select All followed by Replace All sometimes causes infinite loop #16

Closed
molsonkiko opened this issue Dec 15, 2023 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@molsonkiko
Copy link

As shown below, this is on Columns++ v1 (not your newer v1.0.1).

To replicate:

  1. Create a file with the text
foo
  bar
   baz blood
 dog godly
     dude   due
  1. Search for \b\w{3}\b (with Search...) to select all (the option under the Count button) the three-char words.
  2. Click anywhere in the document (I think it has to be somewhere in the middle, not at the beginning or end) so the text of interest is marked but not selected.
  3. Find/replace (still with the Search... GUI) d with xy to attempt to convert all the d chars in the selected text only into xy. Sometimes (again, I haven't had the time to diagnose exactly what causes it), this will cause an infinite loop and I will need to hard-shutdown NPP.

In any case, the desired result of this process is the following:

foo
  bar
   baz blood
 xyog godly
     dude   xyue

Here's my debug info (I also have JsonTools, but I disabled it to test if it was involved in this, and it wasn't)

Notepad++ v8.5.8   (64-bit)
Build time : Oct 15 2023 - 21:43:56
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 22H2
OS Build : 19045.3803
Current ANSI codepage : 1252
Plugins : 
    ColumnsPlusPlus (1)
    ComparePlus (1.1)
    CSVLint (0.4.6.5)
    EnhanceAnyLexer (1.1.3)
    HexEditor (0.9.12)
    HTMLTag (1.4.1)
    HugeFiles (0.4.1)
    mimeTools (2.9)
    NavigateTo (2.6.5.1)
    NppConverter (4.5)
    NppExport (0.4)
    NppLspClient (0.0.13)
    PythonScript (3.0.16)
    QuickText (0.2.5.1)
    XMLTools (3.1.1.13)
@Coises Coises added bug Something isn't working question Further information is requested labels Dec 15, 2023
@Coises
Copy link
Owner

Coises commented Dec 15, 2023

@molsonkiko Step three in your instructions for replication confuses me.

If you click in the document, the selection will be removed but the indicated region will be unchanged. To set the indicated region to the result of the Select All, you would need either to have clicked the Set button before you clicked anywhere in the document, or (with Auto set checked) proceeded to the next search without clicking inside the document.

@Coises
Copy link
Owner

Coises commented Dec 28, 2023

@molsonkiko Do you have any additional information? I can’t reproduce this. I don’t see the state you describe in step three unless I do something between steps two and three that you did not list (e.g., click the Set button; or repeat the Select All; or Count). Using Notepad++ 8.4.8 x64 and Columns++ 1.0, even with one of these additions, I’m not seeing a hang.

I’d like to fix this, but I have no clue what to fix.

@molsonkiko
Copy link
Author

Now that you mention it, I can't replicate this anymore when I try it again. I really have no idea what the differences would be. Possibly an interaction with the Hex Editor plugin that I uninstalled since then?

In any case, here's my new debug info, now that I can't reproduce it anymore.

I'm not going to close this myself, but you can if you want.

Notepad++ v8.5.8   (64-bit)
Build time : Oct 15 2023 - 21:43:56
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 22H2
OS Build : 19045.3803
Current ANSI codepage : 1252
Plugins : 
    ColumnsPlusPlus (1)
    ComparePlus (1.1)
    CSVLint (0.4.6.5)
    EnhanceAnyLexer (1.1.3)
    HTMLTag (1.4.1)
    HugeFiles (0.4.1)
    JsonTools (6.0.0.11)
    mimeTools (2.9)
    NavigateTo (2.7)
    NppConverter (4.5)
    NppExport (0.4)
    NppLspClient (0.0.13)
    PythonScript (3.0.16)
    QuickText (0.2.5.1)
    XMLTools (3.1.1.13)

@Coises Coises added the stale unclear if there is still a problem label Dec 28, 2023
@Coises
Copy link
Owner

Coises commented Dec 28, 2023

Closing as stale. We can reopen this if a way to reproduce it is found. Anyone else experiencing a similar problem should probably open a new issue.

@Coises Coises closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
@Coises
Copy link
Owner

Coises commented Jan 4, 2024

@molsonkiko I have stumbled across this bug myself, now, in an easily reproducible form:

  1. Open a new tab and enter abcde (nothing else, no end of line).
  2. Open Columns++ | Search..., set up a regular expression search to find bcd and replace with x, and click Replace All.

This will hang Columns++ (and hence Notepad++).

This is a serious bug, since a hang results in loss of unsaved changes in all open tabs.

I believe I see the cause, and it appears to be a simple oversight on my part, so hopefully it won’t take long to post an updated version.

@Coises Coises reopened this Jan 4, 2024
@Coises Coises removed question Further information is requested stale unclear if there is still a problem labels Jan 4, 2024
Coises added a commit that referenced this issue Jan 4, 2024
…ular expression replace all/before/after decreases the length of the document. Addresses Issue #16 .
@Coises Coises closed this as completed Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants