Rainie3535 / sigil

Automatically exported from code.google.com/p/sigil
GNU General Public License v3.0
0 stars 0 forks source link

New Sigil Regex engine crashes when pressing "replace all", works fine on pushing "replace" over and over and over again #1188

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On the following (attached) code sample, replacing for the regex examples 
below
2a. Pressing the right arrow for "replace" will lead to the desired result
2b. Pressing  "All" for "replace all" will lead to Sigil crashing

What is the expected output?
Replace all should work like on the 0.4.2 and below and not result in a crash. 
;)

What version of the product are you using? On what operating system?
0.5.0 Win x32 and Mac Version tested.

SAMPLE REGEXes

&nbsp;(</span>){0,1}</p>\s*<p( 
class="){0,1}(p\d*){0,1}(\s*){0,1}(sgc-\d*){0,1}("){0,1}>(<a 
id="a\d*"></a>){0,1}
replace with
&nbsp;\1</p><p  class="p99 \5">\7

AND

<p((\s*){0,1}class="(p\d*)(\s*){0,1})">(<a id="a\d*"></a>){0,1}(<a 
id="a\d*"></a>){0,1}<span class="(t\d*)( sgc-\d*){0,1}">
replace with
<hr class="sigilChapterBreak" /><h2\1">\5\6<span class="\7\8">

pick whichever one you like, the result still is Sigil 0.5.0 crashing.

When I used the same regexes in Sigil 0.5.0 on a self created test example of 
only about 20 lines - with much reduced complexity, replace all would work. And 
Sigil would not crash. Filesize? Loops?

Original issue reported on code.google.com by sigilop...@gmail.com on 22 Jan 2012 at 11:40

Attachments:

GoogleCodeExporter commented 9 years ago
I experience the same sometimes. Sometimes after reloading and redo the replace 
it works. I have the feeling that it is a memory thing or something. I tend to 
load the book as one big HTML file and do some S&R on it before splitting. When 
crashes happen, they happen on the big files.

Original comment by toxa...@gmail.com on 26 Jan 2012 at 7:32

GoogleCodeExporter commented 9 years ago
Revision: bf3f6e242c0c.

Original comment by john@nachtimwald.com on 28 Jan 2012 at 2:57

GoogleCodeExporter commented 9 years ago
There still seems to be a crash issue - this with replace next not replace all 
so this may be different.  I get this on 0.5.0 Ubuntu 11.10 and on source 
compiled including the revision mentioned above.

File attached - very simple with a few files and very little text.

Open, go to Book View, Cursor at start
Open F&R, set Normal, Look in Current File, type Heading into the Find box, 
nothing in the replace box.

Click on Replace Next
->1st heading highlighted
Click on Replace Next
->1st heading is removed, second heading is chopped to just "ng 1.2" when it 
should have just been highlighted, and the 3rd heading is highlighted
Check on Replace Next
-> Crash

Haven't had a chance to try to debug (printf's until I find the spot...)

Open as a new issue, or mark this as Started?

Original comment by meme90...@gmail.com on 30 Jan 2012 at 12:54

Attachments:

GoogleCodeExporter commented 9 years ago
> Open as a new issue, or mark this as Started?

New issue would be preferable. The original issue was about replace all and 
this is about replace next.

Original comment by john@nachtimwald.com on 31 Jan 2012 at 12:27