[Top][All Lists]

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

Re: [Bug-readline] calling setenv/putenv from SIGWINCH signal handler --

From: Chet Ramey
Subject: Re: [Bug-readline] calling setenv/putenv from SIGWINCH signal handler -- in readline-6.3, too
Date: Thu, 22 May 2014 14:58:47 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 5/22/14, 2:09 PM, Lőrinczy Zsigmond wrote:
> On 2013-10-18 15:39, Chet Ramey wrote:
>> On 10/17/13 9:49 AM, Lőrinczy Zsigmond wrote:
>>> Hello,
>>> my bash-3.2.48 (uses readline-6.2) on AIX computer produces stange errors,
>>> that I could trace back:
>> Readline-6.3 has undergone fairly extensive changes to signal handling,
>> and does minimal work in the signal handler itself.  The real work is now
>> deferred until it's `safe' to do it.  Bash-4.3 has the same sort of
>> changes.
>> Chet
> Hello again,
> I've checked readline-6.3, but the problem still exists:
> signals.c:rl_sigwinch_handler ->

This doesn't call rl_resize_terminal; it sets a flag and calls the
application's SIGWINCH handler, if one is installed.

This flag gets checked at appropriate places in the readline code, and
if it's set, rl_resize_terminal eventually gets called via _rl_signal_handler.

Now, if an application's SIGWINCH handler calls rl_resize_terminal, there's
not really anything readline can do about that.

> terminal.c:rl_resize_terminal ->
> terminal.c:_rl_get_screen_size ->
> shell.c:sh_set_lines_and_columns ->
> libc:setenv ->
> libc:putenv ->
> libc: realloc

All of these functions eventually get called, but not from a signal handler


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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