Bug 1277996 - loading of zsh modules broken by global enforcement of the '-z now' linker flag
loading of zsh modules broken by global enforcement of the '-z now' linker flag
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: zsh (Show other bugs)
23
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kamil Dudka
Fedora Extras Quality Assurance
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-04 09:04 EST by Will Thompson
Modified: 2015-11-27 13:23 EST (History)
5 users (show)

See Also:
Fixed In Version: zsh-5.1.1-3.fc24 zsh-5.1.1-3.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-27 13:23:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Will Thompson 2015-11-04 09:04:12 EST
My .zshrc has this line:

zmodload zsh/zftp

Since upgrading to F23 this morning, loading this module fails:

/home/wjt/.zshrc:99: failed to load module `zsh/zftp': /usr/lib64/zsh/5.1.1/zsh/zftp.so: undefined symbol: freehostent

A no-op freehostent() is provided by zsh/lib/tcp -- apparently for the sole use of zftp! https://github.com/johan/zsh/search?utf8=%E2%9C%93&q=freehostent -- and indeed if I manually load that module before zftp:

zmodload zsh/net/tcp
zmodload zsh/zftp

Then everything works fine:

% zftp
zftp: not enough arguments

Version-Release number of selected component (if applicable):

zsh-5.1.1-2.fc23.x86_64
Comment 1 Kamil Dudka 2015-11-04 10:42:30 EST
(In reply to Will Thompson from comment #0)
> A no-op freehostent() is provided by zsh/lib/tcp -- apparently for the sole
> use of zftp!
> https://github.com/johan/zsh/search?utf8=%E2%9C%93&q=freehostent -- and
> indeed if I manually load that module before zftp:
> 
> zmodload zsh/net/tcp
> zmodload zsh/zftp

The above dependency should be handled by zsh as it is part of the metadata:

https://sourceforge.net/p/zsh/code/ci/master/tree/Src/Modules/zftp.mdd

> Version-Release number of selected component (if applicable):
> 
> zsh-5.1.1-2.fc23.x86_64

This is really strange.  If I build zsh-5.1.1-2.fc23.src.rpm in f22 buildroot, the resulting packages work as expected.  If I build it in f23 buildroot, the dependency loading stops working.  Something must have changed in the toolchain between f22 and f23.
Comment 2 Kamil Dudka 2015-11-04 11:21:49 EST
This seems to be caused by hardening linker flags that were introduced in f23.

I tried to remove '-z now' from the default linker flags:

sudo sed 's/-z now//' -i /usr/lib/rpm/redhat/redhat-hardened-ld

... rebuild zsh-5.1.1-2.fc23 and the problem went away.  So we either need to make zsh module loading work with the '-z now' linker flag, or make its build system drop the flag during the build.
Comment 3 Kamil Dudka 2015-11-05 07:45:25 EST
The related Fesco ticket:
https://fedorahosted.org/fesco/ticket/1384

A comment on this topic on the upstream mailing-list:
http://www.zsh.org/mla/workers/2015/msg02981.html
Comment 4 Kamil Dudka 2015-11-05 08:27:17 EST
fixed in zsh-5.1.1-3.fc24
Comment 5 Fedora Update System 2015-11-05 08:51:14 EST
zsh-5.1.1-3.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-9e91841c99
Comment 6 Fedora Update System 2015-11-05 21:34:31 EST
zsh-5.1.1-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update zsh'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-9e91841c99
Comment 7 Fedora Update System 2015-11-27 13:23:22 EST
zsh-5.1.1-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.