[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] Malloc from signal handler in readline
From: |
Brian Bloniarz |
Subject: |
Re: [Bug-readline] Malloc from signal handler in readline |
Date: |
Thu, 2 Aug 2012 11:50:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
On 08/02/2012 08:49 AM, Chet Ramey wrote:
> If you want to look at the fixed version, you can get it from the `devel'
> branch of the bash git tree on savannah (the relevant file is
> lib/readline/signals.c).
OK great, thanks for pointing me in the right direction. I don't quite
know how to compile a standalone readline from here to test the fix,
but I can at least read through the src.
Looking at the new sh_set_lines_and_columns, it avoids calling malloc
but will use setenv (or putenv) to update an environment variable.
Neither setenv nor putenv are signal-safe in POSIX, looks like. I looked at
the glibc implementation, there are setenv codepaths that malloc(). At least
putenv is documented to be reentrant (http://linux.die.net/man/3/putenv) on
linux.
So without knowing too much about the details & portability constraints, is it
possible that the new implementation may still have issues?
Thanks,
-Brian