bugGNU nano - Bugs: bug #54499, after filtering, an external...

 
 

bug #54499: after filtering, an external spellcheck fails to execute

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 12 Aug 2018 08:56:56 AM UTC  
 
Severity:  4 - Important Status:  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.

 

Tue 21 Aug 2018 05:18:59 PM UTC, comment #4:

Fixed in git, commit ec339d3b, with help from Marco Mesquita.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 19 Aug 2018 10:50:05 AM UTC, comment #3:

Just removing the fork() is not a solution: it will cause nano to hang when trying to filter a large file. The fork() is needed so that feeding text to the external program and reading its output can happen in parallel, so that things do not get stuck because of limited sizes of IO buffers.

The problem is that the child is not waited for, so it becomes a zombie that somehow hugs some file descriptor.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 12 Aug 2018 03:13:02 PM UTC, comment #2:

Replacing the part:

if (fork() == 0) {
close(to_fd[0]);
send_data(cutbuffer != NULL ? cutbuffer : openfile->fileage, to_fd[1]);
close(to_fd[1]);
exit(0);
}

by:

send_data(cutbuffer != NULL ? cutbuffer : openfile->fileage, to_fd[1]);

Fixes the problem.

The reason for this fork is to avoid it getting stuck with io buffers: the out part is done in another process. But it looks like it is messing up some file descriptor.

We already have a fix but I'm not sure if it is ideal. I'll try to investigate a bit more.

Anonymous
Sun 12 Aug 2018 02:26:14 PM UTC, comment #1:

The "Error: Could not open the file "/tmp/nano.9CWbFh" for reading" message comes from stderr since after it a ^L removes it.

I try to investigate more to find the root cause of the problem but, for now, it is a step.

Anonymous
Sun 12 Aug 2018 08:56:56 AM UTC, original submission:

To reproduce, run:

src/nano +29,29 NEWS --ignore --speller="aspell -c -x -l en"

Then type: ^R ^X |wc <Enter> ^T
See how an error message gets written into the edit window:

Error: Could not open the file "/tmp/nano.9CWbFh" for reading

And see that on the status bar it says "[ Finished checking spelling ]", as if all went well. Then type ^T again. The temp file name in error message in the edit window gets changed

Error: Could not open the file "/tmp/nano.plw79B" for reading

but now nano beeps and reports in white/red on the status bar:

[ Spell checking failed: Error invoking "aspell -c -x -l en" ]

Expected behavior: the spell checking should not fail at all. And if, it should never write its message into the edit window.

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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-10 bens Open/ClosedOpen => Closed
    2018-08-21 bens StatusIn Progress => Fixed
    2018-08-19 bens StatusNone => In Progress
        Assigned toNone => bens

    Back to the top


    Powered by Savane 3.3