Coder Social home page Coder Social logo

Comments (7)

sasumner avatar sasumner commented on May 18, 2024 1

It's an issue concerning Scintilla

The symptoms sound like Notepad++ isn't catching an exception that it should (see #4761 (comment)).

Anyway, if it is really thought to be a Scintilla issue, why not update Scintilla and see if it remains. :-)

from notepad-plus-plus.

tommilligan avatar tommilligan commented on May 18, 2024

Interesting bug. Replicated easily (v6.7.7). Confirmed that only happens after exactly 380 characters. Bug not present if () removed; (a)*b gives bug but a*b does not even after 200,000 characters.

Suspect memory/storage issue of () capturing group?

from notepad-plus-plus.

 avatar commented on May 18, 2024

Oddly enough I get the bug after 270 characters.

from notepad-plus-plus.

Zantier avatar Zantier commented on May 18, 2024

It appears to be an issue with Scintilla, as I was able to reproduce a similar behaviour in SciTE by dropping in SciLexer.dll v3.3.4 (which Notepad++ v6.7.7 is using) in place of v3.5.5.

When I place SciLexer.dll v3.5.5 in the same directory as Notepad++, I no longer see the issue, even with 200,000 "a"s in a row. Not that SciLexer.dll v3.5.5 is perfect though, as it seems to fail to match (a)*, or a more useful regex such as (a|b)* in both Notepad++ and SciTE...


Edit: Note I don't know whether SciLexer.dll v3.5.5 was built with boost for PCRE support. I simply took SciLexer.dll from the SciTE binary download. I don't have time to check right now.

from notepad-plus-plus.

guy038 avatar guy038 commented on May 18, 2024

Hello Zantier, tommilligan, jonandr and All,

I did some tests, on a 6.7.9 version, with its native plugins, and I found out a strange rule about that regex issue ! Follow the few steps below, to reproduce it :

  • Let's suppose that you write, in a new tab, a line with several lower letters a ( let's say, for instance, between 10 and 20 )
  • Then, just add some lines, even empty, before and after this line of a's letters, with the two following conditions :
  1. They don't contain any lower letter a or b

  2. If your select all the contents of that test file, you get, exactly, 285 characters

  • Go back to the very beginning of the file ( CTRL + Origin )
  • Open the Find dialog
  • Check the Match case option and the Regular expression radio button
  • Uncheck the option Wrap around
  • Type the Zantier's regex ([^b])*b in the Find what zone

=> When clicking on the Find Next button, you wrongly get the entire contents of this test file :-(

Now, :

  • Close the Find dialog , hitting the ESC key
  • Delete ONE character ONLY, in a line, located before, or even after, the line of a's ( so, if you hit CTRL-A, you get, exactly, a 284 characters selection )
  • Go back, again, to the very beginning of the file, with the CTRL + Origin shortcut
  • Type on the F3 key to repeat the same regex search ([^b])*b

=> This time, the regex engine, doesn't find, as expected, any matched string ( as the file contains NO lower letter b )

So, for some odd reasons, this regex doesn't work, as soon as the size of the file is > 284 bytes ???

Then, I replace, successively, the SciLexer.dll v3.5.6 file by :

  • The last version of SciLexer.dll v3.3.4 ( which came with N++ 6.7.3 ) => Same limit, between 284 and 285
  • The last version of SciLexer.dll v2.2.7 ( which came with N++ 6.3.0 ) => The limit is between 269 and 270

BTW, the regex ([^b])+b produces the same issue, but, luckily, the regexes ([^b]*)b ( that, however, creates a different group 1 ) and the regex [^b]*b, do work, in all cases, independently of the file"'s size !

Best regards,

guy038

from notepad-plus-plus.

robert-andrzejuk avatar robert-andrzejuk commented on May 18, 2024

Has anyone reported this on the Scintilla bug system?

from notepad-plus-plus.

donho avatar donho commented on May 18, 2024

It's an issue concerning Scintilla.

from notepad-plus-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.