bugGNU nano - Bugs: bug #56434, in current git, some syntaxes...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56434: in current git, some syntaxes cause a crash

Submitter:  Benno Schulenberg <bens>
Submitted:  Mon 03 Jun 2019 05:35:07 PM UTC
   
 
Severity:  5 - Blocker Status:  Fixed
Assigned to:  None Open/Closed:  Closed

Tue 04 Jun 2019 10:50:34 AM UTC, comment #5: 

Fixed in git, commit fb10a94f.  Thanks for the patch.

And closing because unreleased.

(The error message for a missing syntax command I will let be -- when people make a new syntax, they most likely copy an existing file, so the basic commands will be present.)

Benno Schulenberg <bens>
Group administrator
Tue 04 Jun 2019 03:03:47 AM UTC, comment #4: 

The third issue is because the syntax file never reads the color command. There is no syntax command so the file can never be fully parsed. This patch prints an error message if an included file has no syntax command. But an invalid color command will still only fail when actually loaded for a buffer.

(file #47024)

Brand Huntsman <brand>
Mon 03 Jun 2019 10:45:48 PM UTC, comment #3: 

Patch fixes the first issue. It also fixes the second issue if you were testing it with an empty buffer.

(file #47021)

Brand Huntsman <brand>
Mon 03 Jun 2019 05:57:27 PM UTC, comment #2: 

When the content is changed to just:

  color boo

nano starts up fine, but... without any error message.  One would expect at least one message: color command requires preceding syntax command, and maybe: unknown color name "boo".

Benno Schulenberg <bens>
Group administrator
Mon 03 Jun 2019 05:42:32 PM UTC, comment #1: 

It happens also when the entire content of python.nanorc is:

  syntax boo

:|

The offending commit is cba9d8d0, the delayed syntax parsing.

Benno Schulenberg <bens>
Group administrator
Mon 03 Jun 2019 05:35:07 PM UTC, original submission:  

To reproduce, change your ~/.nanorc to contain just this line:

  include "/path/to/syntaxes/python.nanorc"

where /path/to/syntaxes/ is the path to your local syntax/ folder in git.

Then run 'src/nano'.  Result: crash.

It happens also with, for example, c.nanorc and texinfo.nanorc, but not with default.nanor nor nanorc.nanorc.

Valgrind says this:

==27387== Invalid read of size 8
==27387==    at 0x4066AE: color_update (color.c:277)
==27387==    by 0x408414: open_buffer (files.c:492)
==27387==    by 0x414D0F: main (nano.c:2645)
==27387==  Address 0x8 is not stack'd, malloc'd or (recently) free'd

Benno Schulenberg <bens>
Group administrator

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by brand (Updated the item)
  • -email is unavailable- added by bens
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-04 bens StatusNone Fixed
        Open/ClosedOpen Closed
        Summarynano crashes with certain syntaxes in current git, some syntaxes cause a crash
    2019-06-04 brand Attached File- Added rcfile-show-error-if-a-syntax-file-is-missing-a-syntax-command.patch, #47024
    2019-06-03 brand Attached File- Added 0001-prevent-a-crash-if-no-syntax-or-default-syntax-is-fo.patch, #47021
    2019-06-03 bens Carbon-Copy- Added brand

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code