Proposal: remove unreliable "abused getenv" test and related code #45
Replies: 4 comments 5 replies
-
Ah, sorry for merging that Debian stuff without actually checking what it was doing, and thanks for doing the analysis here. Do I understand correctly though that this is currently broken on NetBSD/FreeBSD? Or has the core dumping problem gone away for other reasons? |
Beta Was this translation helpful? Give feedback.
-
(I apologize for my earlier misleading remark. The Debian patch actually was not the cause, so merging it was fine. The Debian package maintainer noticed that What I'm suggesting is that the abused getenv test is no longer reliable, failing on systems where A bit of history... The function Now here's the other part of the problem: on Debian, OpenBSD, and other systems where I suppose you might say that it's working as intended on FreeBSD/NetBSD as Passing the correct value of |
Beta Was this translation helpful? Give feedback.
-
Amusingly, readline also uses putenv to set LINES/COLUMNS, so to really support it... |
Beta Was this translation helpful? Give feedback.
-
Well, it seems I was partially mistaken. The abused Also, I want to point out that the getenv-fix removes the abused Edit: I have added a few more commits since I first posted this comment. To avoid confusion in the future, this link will always display the changes between the master repo and my getenv-fix branch: Comparing wryun:master...memreflect:getenv-fix |
Beta Was this translation helpful? Give feedback.
-
Unlike some older versions, es no longer replaces the system
getenv
implementation unless the configure test determinesgetenv
is "abused" by the system. As I understand it, this test previously made sense because esdump would dump core as a result of es having its owngetenv
implementation.However, a Debian patch changed the code such that
getenv
will never be replaced by es unless that abuse is detected at configure time, yet there is no point in detecting that abuse unless you want to replacegetenv
in the first place. The Debian patch unintentionally introduced a chicken-and-egg problem.Moreover, the configure test is currently unreliable:
getopt
function does call the system implementation ofgetenv
. Simply put, the test reports a false negative, so the replacementgetenv
will never be used.getenv
beforemain
begins execution. Again, the test reports a false negative, so the replacementgetenv
will never be used.getenv
is called beforemain
and the configure test correctly detects this. Due to the code changes however, either the system implementation is always used ifes_cv_abused_getenv=no
is manually set at configure time or the replacement is always used ifes_cv_abused_getenv=no
is not manually set. Either way, the test is pretty much unnecessary as only onegetenv
implementation is ever used. One might consider this case to be a false positive since the systemgetenv
does not actually cause any trouble.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions