[Top][All Lists]

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

Re: [Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB

From: Chet Ramey
Subject: Re: [Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB
Date: Wed, 24 Apr 2019 08:59:42 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/24/19 5:01 AM, Dmitrii Pasechnik wrote:

>>>>> Why is this done? This is error-prone, as the linking application has to
>>>>> figure out which termcap library was meant to be used with the readline;
>>>>> one cannot assume that a random one would work just fine.
>>>> A "random" termcap library should be just fine, as long as it provides
>>>> the correct symbols. Readline is not "meant to be used" with any
>>>> particular termcap implementation; as long as it provides good information,
>>>> you can use anything.
>>> With underlinking like this, one has too little control over the origin
>>> of symbols used by readline.  There is no guarantee that out there in
>>> the flat namespace there is e.g. an UP symbol that has nothing to do
>>> with termcap.  With underlinking, the process using readline would start
>>> and carry on, and then crash, or worse.
>> Any application that links with curses or termcap is going to have this
>> possibility. You can't guarantee that a symbol UP defined in an application
>> linked with readline will not override the one in the library.
> while it differs from one platform to another (e.g. Solaris' direct
> binding would make it totally impossible),  underlinking
> prevents meaningful testing and quality assurance---one cannot test
> readline for every termcap library that might appear on the box, and
> once the tests are done, it's reasonable that the record of the termcap
> used is branded onto the library, e.g. in the case of ELF
> in the form of NEEDED record, seen by e.g. readelf -d:

I'm skeptical of this reasoning, but let's see the patches and see how
it goes.

>>> If everyone patches your code at some place then you ought to consider that 
>>> it
>>> might have a bug there :-)
>> Maybe, but nobody has reported anything to this point.
> As far as I can tell, there are more than this particular 5 y.o. thread
> around pointing at this underlinking issue, forcing everyone to patch or
> adding `-ltinfo` or whatever to every place readline is linked in. One
> can do better than this.

Send your patches along and let's take a look.

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

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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