Bug 1248071

Summary: Increase ELFRESERVE constant from 3072 to 3104
Product: [Fedora] Fedora Reporter: Jan Chaloupka <jchaloup>
Component: golangAssignee: Vincent Batts <vbatts>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 24CC: admiller, fpokorny, golang-updates, jchaloup, lemenkov, renich, s, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 12:03:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Increase ELFRESERVE to 3104 none

Description Jan Chaloupka 2015-07-29 14:24:57 UTC
Description of problem:
Etcd and kubernetes built in rawhide with debugging info support fails with the following error:

ELFRESERVE too small: 3104 > 3072

Version-Release number of selected component (if applicable):
golang-1.4.99-4.1.5beta2.fc24.x86_64

How reproducible:
Always

Steps to Reproduce:
1. clone etcd repository
2. set with_debug macro to 1
3. build etcd for master branch

Actual results:
Etcd fails to build

Expected results:
Etcd does not fail to build

Additional info:
To support debugging info, each build is hacked by adding -B flag in -ldflags string:
-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')

This increases header for 32bytes which is exactly difference between 3104 and 3072.

Setting the constant to 3104 fixes this issue.

Comment 1 Jan Chaloupka 2015-07-29 14:25:52 UTC
Created attachment 1057332 [details]
Increase ELFRESERVE to 3104

Comment 2 Vincent Batts 2015-07-29 15:05:31 UTC
https://github.com/golang/go/blob/master/src/cmd/link/internal/ld/elf.go#L716

Though, for folks using this golang compiler to cross-compile for other platforms like FreeBSD, this change should be platform specific.

Comment 3 Jan Chaloupka 2015-07-29 16:31:21 UTC
Does golang in Fedora support cross-compiling?

Comment 4 Vincent Batts 2015-07-29 19:11:51 UTC
yes. `GOOS=freebsd go build <source>` will produce a binary for freebsd.

Also, what and where is this `with_debug` that you are setting? Do you mean `%_enable_debug_packages` rpm macros?

I'm trying to reproduce your steps.

Comment 5 Jan Chaloupka 2015-07-30 08:44:33 UTC
Header of etcd's spec files starts with:

%if 0%{?fedora}
%global with_devel 1
%global with_bundled 0
%global with_debug 0
%global with_check 1
%else
%global with_devel 0
%global with_bundled 1
%global with_debug 0
%global with_check 0
%endif

> yes. `GOOS=freebsd go build <source>` will produce a binary for freebsd.

In that case, what about to add Fedora specific option --increase-header-for-debug or shorter name that I will set when building on Fedora with debuginfo? I can prepare a patch if you agree with the hack? This will not break cross-compiling.

Or instead of option set environment variable INCREASE_HEADER_FOR_DEBUG (which is four-line hack).

At the moment there is not debuginfo for etcd and kubernetes due to this.

Comment 8 Vincent Batts 2015-07-30 17:47:17 UTC
jan please validate the new builds of golang fix the issue for you.

Comment 9 Jan Chaloupka 2015-07-30 21:36:12 UTC
Etcd build with debug on for f24 no longer fails on ELFRESERVE [1]
For f23 updates and buildroot overrides are needed from now on. F23 now installs golang-1.4.99-4.1.5beta2.fc23.x86_64 [2]. Can you override it? Command:

bodhi --buildroot-override=golang-1.5-0.8.beta3.fc23 for f23-candidate --duration=20 --notes='temp non-stable dependecy waiting for stable'

[1] http://koji.fedoraproject.org/koji/taskinfo?taskID=10547345
[2] https://kojipkgs.fedoraproject.org//work/tasks/7368/10547368/root.log

Comment 10 Vincent Batts 2015-07-31 19:18:14 UTC
fixed upstream https://golang.org/cl/12951

Comment 11 Vincent Batts 2015-07-31 19:19:17 UTC
build root override is tagged.

Comment 12 Jan Chaloupka 2015-08-01 11:44:33 UTC
F23 build of kubernetes with debug enabled building as well [1].

[1] http://koji.fedoraproject.org/koji/taskinfo?taskID=10571611

Thank you Vincent.

Comment 13 Jan Kurik 2016-02-24 15:48:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 14 Fedora End Of Life 2017-07-25 19:03:34 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 15 Fedora End Of Life 2017-08-08 12:03:27 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.