From: SourceForge.net <no...@so...> - 2006-08-19 22:20:51
|
Bugs item #1541009, was opened at 2006-08-16 01:07 Message generated for change (Settings changed) made by cyzsuraj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1541009&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: search and replace Group: severe bug >Status: Pending >Resolution: Remind Priority: 5 Submitted By: Suraj Kurapati (cyzsuraj) Assigned to: Marcelo Vanzin (vanza) Summary: 4.3pre6 regexp find: hangs + huge memory waste Initial Comment: When you do "Find" or "Find and Replace" or "Replace All" with the regular expression "$" (match end of line), 4.3pre6 just hangs while its memory-usage meter thing in the bottom-right-hand-side of its status bar shows memory usage increasing exponentially! Also, this happens regardless of whether the search is performed within a selection, the current buffer, all buffers, or within a directory. To reproduce this bug: 1. Make a new buffer with this content: foo bar baz 2. Select all the text (C-a) 3. Open search&replace dialog (C-f) 4. Type the following regexp in the "search for" field: $ 5. Enable the "regular expressions" check-box (A-x) 7. Press the "Find" or "Find and Replace" or "Replace All" button. 8. Observe that jEdit now hangs, and its memory usage is rapidly increasing (look at memory usage stats at bottom-right-hand-corner of status bar). The expected result is that jEdit should NOT hang and the search should be performed correctly. Thanks for your attention. ---------------------------------------------------------------------- >Comment By: Suraj Kurapati (cyzsuraj) Date: 2006-08-19 22:20 Message: Logged In: YES user_id=315014 A new problem has been created by the fix in svn #6702: the end-of-line is not being preserved when doing find & replace. For example, 1. Make a new buffer with this content: foo bar baz 2. Select all the text (C-a) 3. Open search&replace dialog (C-f) 4. Type the following regexp in the "search for" field: $ 6. Type the following text in the "replace with" field: | 7. Enable the "regular expressions" check-box (A-x) 8. Press the "Replace All" button. 8. Observe that the buffer now contains: foo|bar|baz| The expected result is that the buffer should contain: foo| bar| baz| Thanks for your attention. ---------------------------------------------------------------------- Comment By: Marcelo Vanzin (vanza) Date: 2006-08-19 21:53 Message: Logged In: YES user_id=75113 Fixed in SVN revision #6702. ---------------------------------------------------------------------- Comment By: Marcelo Vanzin (vanza) Date: 2006-08-19 20:54 Message: Logged In: YES user_id=75113 Seems to be a problem with a combination of HyperSearch and a side-effect of using "$" as the search regex. When using "$", the matcher will always match the same element. Meaning that it will first match the end of the line where the caret is, and subsequent calls to "PatternSearchMatcher.nextMatch()" will match the same end-of-line as the previous call. When doing an HyperSearch, the code will loop until "nextMatch()" returns a match that is at the end of the region being searched. Since nextMatch() will be stuck at the same spot, it will never reach the end of the region, and hypersearch will keep collecting the match results until we run out of memory. I'm trying to find a way to have the matcher go to the next line if the current position is at the end of the line, that should fix it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1541009&group_id=588 |