bugGNU nano - Bugs: bug #46778, segfault when opening as second...

 
 

bug #46778: segfault when opening as second argument a directory that was tried before

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 29 Dec 2015 05:31:41 PM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 30 Dec 2015 10:28:38 AM UTC, comment #4:

I can't figure out what it interacts with, but it doesn't matter, the fix is simple: don't attempt to position the cursor when no buffer was actually opened.

Fixed in SVN, r5514.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 30 Dec 2015 09:24:04 AM UTC, comment #3:

The bug has appeared with r5304. The strange thing is that that same commit is in 2.4.3, but that version works okay. So it is not the commit in itself that is wrong -- it is the interaction with some earlier commit that is not included in 2.4.3.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 29 Dec 2015 09:12:59 PM UTC, comment #2:

Okay, fine -- it has something to do with the contents of ~/.nano/filepos_history. Even though doc/syntax is a directory, it still has an entry in that file: /home/ben/Repositories/ANYTHING/doc/syntax/ 1 78. How it got there, I don't know... Deleting it requires starting nano with --ignore. Once deleted, things start to work normally again.

However, searching for "/ " in the filepos_history file, shows up many more occurrences -- I've apparently accidentily tried many times to open a directory. If I do that now again, with the name of such a directory as second file argument, nano will segfault.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 29 Dec 2015 08:44:56 PM UTC, comment #1:

I am perplexed. I cannot reproduce it in a fresh checkout, but can reproduce it consistently in the source tree that I normally work in.

Somehow it has something to do with the actual doc/syntax directory in that source tree: when I run a nano from a fresh checkout and give it as second file argument the mentioned doc/syntax in my normal source tree, it segfaults. A 2.4.3 is fine, anything before it too, but a 2.5.0 and later segfault.

Even 'rm -rf doc' and restoring it with 'svn up' does not remove the anomaly...

Hrm! It has to do with the name of that normal source tree -- when I change it to anything else, things work fine. Now the question is: why may that thing not be called ANYTHING (literally)?

When I move this ANYTHING out of the way, and rename the fresh checkout to ANYTHING, it fails there too: 'src/nano doc doc/syntax' segfaults. Give it any other name, it works fine. Pffft!

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 29 Dec 2015 05:31:41 PM UTC, original submission:

To reproduce, run 'src/nano doc doc/syntax'.

Result: Segmentation fault.

Bug seems present only in SVN, not in 2.5.0, nor before.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Jan 2016 04:38:25 PM UTCbensOpen/ClosedOpen=>Closed
    Wed 30 Dec 2015 10:28:38 AM UTCbensStatusNone=>Fixed
    Wed 30 Dec 2015 09:24:04 AM UTCbensSummarynano segfaults when trying to open a directory that was tried before=>segfault when opening as second argument a directory that was tried before
    Tue 29 Dec 2015 09:12:59 PM UTCbensSummarynano segfaults when trying to open two directories=>nano segfaults when trying to open a directory that was tried before

    Back to the top


    Powered by Savane 3.1-cleanup1