bugGNU nano - Bugs: bug #26977, nano 2.1.9 freezes with PKGBUILD...

 
 

bug #26977: nano 2.1.9 freezes with PKGBUILD syntax highlighting

Submitted by:  tigrmesh <tigrmesh>
Submitted on:  Wed 08 Jul 2009 02:01:02 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Need Info
Privacy: PublicAssigned to: Benno Schulenberg <bens>
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 22 Feb 2014 08:08:56 PM UTC, comment #7:

Could you try the patch (building nano from source) and report whether it then works for you with the complicated syntax?

Benno Schulenberg <bens>
Project MemberIn charge of this item.
Wed 18 Sep 2013 09:57:33 AM UTC, comment #6:

Attached patch fixes the problem for me. If you could try it, that would be nice. (It is just a temporary repair -- if it is the fully correct fix, then a pair of braces can be removed and a whole lot of text unindented.)

What remains, however, is that your original regexp is an absolute corner case, and kind of strange: it uses the multi-line matching syntax when all it wants to do is colour every line green. This one can also do with the single-line syntax I proposed: "^.*$".

Your multi-line variant is strange also in a second way: it doesn't actually match any characters. As soon it does, for example by adding a period after the ^ or before the $, also the unpatched nano does not hang any more. Using « color green start="^." end="$" » works fine here, patched and unpatched; the variant « color green start="^" end=".$" », however, does not colour everyhting green in the unpatched nano, but works fine in the patched version, just like your original very hungry regexp.

(file #29172)

Benno Schulenberg <bens>
Project MemberIn charge of this item.
Tue 17 Sep 2013 07:08:20 PM UTC, comment #5:

As I look again, I think this bug (bug #26977) is a duplicate of bug #29014: Failure to open when editing certain files named as PKGBUILD

tigrmesh <tigrmesh>
Tue 17 Sep 2013 06:43:16 PM UTC, comment #4:

I think this bug (#26977) and bug #29014 are related.

bug #29014: Failure to open when editing certain files named as PKGBUILD
https://savannah.gnu.org/bugs/?29014

tigrmesh <tigrmesh>
Tue 17 Sep 2013 06:32:42 PM UTC, comment #3:

I removed the problem line and added the line you had suggested. This works wonderfully. Thank you.

tigrmesh <tigrmesh>
Sat 14 Sep 2013 08:37:30 AM UTC, comment #2:

The first time I tried this on your files, with debugging enabled, I got "match found at pos 70... end found on this line" rolling on and on over the screen. Subsequent runs, however, hung silently.

But why use the syntax «color green start="^" end="$"» to colour everything at first? When reworded as «color green "^.*$"», the colouring works fine.

Benno Schulenberg <bens>
Project MemberIn charge of this item.
Thu 23 Jul 2009 05:31:17 AM UTC, comment #1:

After having conferred with Those Who Know More, it has been determined that the title of this bug is misleading. It should read: "nano 2.1.9 freezes with PKGBUILD syntax highlighting".

Also, it has been discovered that if you comment out the first color line (green) in the nanorc, it works. I was unable to find any information on how to do syntax highlighting in nano. Maybe the end syntax has changed. Please let me know. Thanks.

tigrmesh <tigrmesh>
Wed 08 Jul 2009 02:01:02 AM UTC, original submission:

Using nano 2.1.9, trying to open a PKGBUILD* with syntax highlighting, nano uses between 88 and 94 percent of my CPU. No file ever opens, and I have a completely blank terminal.

Perl, python and bash syntax files all open fine with syntax highlighting in 2.1.9.

2.0.9 used this syntax highlighting with no problems.

I have attached the pkgbuild.nanorc and a PKGBUILD for you to test.

*A PKGBUILD is an Arch Linux package making script.

tigrmesh <tigrmesh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #29172:  stop-hanging-and-DO-colour.patch added by bens (837B - text/x-patch - stops nano from hanging on an anchors-only regexp, and does colour it)
file #18381:  pkgbuild.nanorc added by tigrmesh (826B - application/octet-stream - pkgbuild.nanorc and a PKGBUILD)
file #18380:  PKGBUILD added by tigrmesh (856B - application/octet-stream - pkgbuild.nanorc and a PKGBUILD)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by tigrmesh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 22 Feb 2014 08:08:56 PM UTCbensStatusNone=>Need Info
      Assigned toNone=>bens
      SummaryPossible memory leak with nano 2.1.9 syntax highlighting=>nano 2.1.9 freezes with PKGBUILD syntax highlighting
    Wed 18 Sep 2013 09:57:33 AM UTCbensAttached File-=>Added stop-hanging-and-DO-colour.patch, #29172
    Wed 08 Jul 2009 02:01:03 AM UTCtigrmeshAttached File-=>Added pkgbuild.nanorc, #18381
    Wed 08 Jul 2009 02:01:02 AM UTCtigrmeshAttached File-=>Added PKGBUILD, #18380

    Back to the top


    Powered by Savane 3.1-cleanup