bug-readline
[Top][All Lists]
Advanced

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

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


From: Lorinczy Zsigmond
Subject: Re: [Bug-readline] calling setenv/putenv from SIGWINCH signal handler
Date: Thu, 17 Oct 2013 16:51:52 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

On 2013-10-17 15:49, 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:

SIGWINCH->
signals.c:rl_sigwinch_handler ->
terminal.c:rl_resize_terminal ->
terminal.c:_rl_get_screen_size ->
shell.c:sh_set_lines_and_columns ->
libc:setenc ->
libc:putenv ->
libc: realloc

And finally realloc overwrites an unrelated data area (bash's variables.c:export_env),
which causes bash to get SIGSEGV

My documentations suggest that one shouldn't call (directly or indirectly) malloc/free/realloc from signal handler, so I think there should be a way to let these setenv/putenv calls to be delayed until the next readline-operation.

Yours: Lőrinczy Zsigmond

I hacked a quick-fix, that works for me: it checks the existence of LINES and COLUMNS before changing them.

Attachment: shell.patch
Description: Text Data


reply via email to

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