[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] Window resize handling

From: Mahyar Abbaspour
Subject: Re: [Nano-devel] [PATCH] Window resize handling
Date: Sun, 3 May 2015 23:53:02 +0430

Hi Benn,

On Wed, Apr 29, 2015 at 11:27 PM, Benno Schulenberg <address@hidden> wrote:

It mostly works.  But sometimes, when in the file browser and
having done a ^W, moving back and forth the right window border
will briefly show the text of the current file instead of the file list.
And once it segfaulted on me.  I still remembered what I did, but
couldn't reproduce.  But after patiently jiggling the window border
for three minutes, it stumbled and threw out this:

*** glibc detected *** src/nano: corrupted double-linked list: 0x09ad1ad0 ***

After careful examination, I found out that this is due to use of non-reentrant functions
such as newwin() which uses malloc() under the hood in the signal handler. (I was aware
of this but somehow I didn't want to heavily change the signal handler design). So I decided
to move the content of the hanlde_sigwinch() function to another function and make
handle_sigwinch() just a notifier. Having done this, I also decided to block SIGWINCH in
the entire program and handle it at one certain point. This makes me able to invoke the
non-reentrant routines that are required to regenerate the screen outside of the signal handler.
By doing this, I got no more segfaults (as far as I tested).

[...] But the text of the file appearing in about one out of fifty jigs, is
not good.

This patch should fix this too.



Attachment: treat-winch-better-2.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]