Bug 1491023

Summary: memtest86+ FTBFS in Rawhide -- segfaults on linking memtest.bin
Product: [Fedora] Fedora Reporter: Petr Šabata <psabata>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rawhideCC: aoliva, fweimer, jakub, jan.kratochvil, jkurik, jskarvad, langdon, law, nickc, sgallagh
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: binutils-2.29-9.fc28 binutils-2.29-13.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-13 23:17:40 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:
Bug Depends On:    
Bug Blocks: 1474910    
Attachments:
Description Flags
Backport patch
sgallagh: review?
Failed build log none

Description Petr Šabata 2017-09-12 19:26:30 UTC
Description of problem:
memtest86+ fails to build in Fedora 27 and Rawhide, segfaulting on linking.
Both i686 and x86_64 builds are affected.  The package builds fine in F26.

Log snippet:

ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o smp.o vmem.o random.o
objcopy -O binary memtest_shared memtest_shared.bin
gcc -E -traditional bootsect.S -o bootsect.s
as -32   -o bootsect.o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -32   -o setup.o setup.s
ld -T memtest.bin.lds bootsect.o setup.o -b binary \
memtest_shared.bin -o memtest.bin
make: *** [Makefile:49: memtest.bin] Segmentation fault (core dumped)
make: *** Deleting file 'memtest.bin'
error: Bad exit status from /var/tmp/rpm-tmp.7ZQDKB (%build)
    Bad exit status from /var/tmp/rpm-tmp.7ZQDKB (%build)
RPM build errors:
Child return code was: 1

Version-Release number of selected component (if applicable):
memtest86+-5.01-18.fc2[78] and their modular counterparts

How reproducible:
Always

Steps to Reproduce:
1. scratch/mock build memtest86+ for f2[78]

Actual results:
Segfault, see above.

Expected results:
Build passes just like it does in F26.

Additional info:
Could this be related to the binutils change?
Note this is blocking Fedora 27 [Modular] Server.

Comment 1 Petr Šabata 2017-09-12 19:33:59 UTC
Most likely caused by https://sourceware.org/bugzilla/show_bug.cgi?id=21884
Reassigning to binutils.

Comment 2 Stephen Gallagher 2017-09-14 13:43:57 UTC
Created attachment 1326023 [details]
Backport patch

I tried backporting the aforementioned upstream patch myself. Unfortunately, even with this patched binutils in the buildroot, I get:

gcc -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
ld --warn-constructors --warn-common -static -T memtest_shared.lds \
 -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o smp.o vmem.o random.o && \
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o smp.o vmem.o random.o
objcopy -O binary memtest_shared memtest_shared.bin
gcc -E -traditional bootsect.S -o bootsect.s
as -32   -o bootsect.o bootsect.s
gcc -E -traditional setup.S -o setup.s
as -32   -o setup.o setup.s
ld -T memtest.bin.lds bootsect.o setup.o -b binary \
memtest_shared.bin -o memtest.bin
make: *** [Makefile:49: memtest.bin] Segmentation fault (core dumped)
make: *** Deleting file 'memtest.bin'


RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.f914aY (%build)
    Bad exit status from /var/tmp/rpm-tmp.f914aY (%build)
ERROR: Exception(/home/sgallagh/workspace/fedora/memtest86+/memtest86+-5.01-18.fc28.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 45 seconds
INFO: Results and/or logs in: /home/sgallagh/workspace/fedora/memtest86+/results_memtest86+/5.01/18.fc28

Comment 3 Nick Clifton 2017-09-14 15:40:19 UTC
Hi Stephen, Hi Petr

  Right PR, wrong patch. :-)  The patch you found was to update the linker 
  testsuite after the patch to prevent the seg-fault went in.  I have taken
  the liberty of creating my own patch, based on the PR, and applied it to 
  the rawhide sources.  So if you try binutils-2.29-8.fc28 the problem should
  be fixed.

  I have not back-ported the patch to the F27 branch because the bug is also
  fixed in the FSF 2.29.1 binutils release which is due to happen in a day or
  so, and I plan to pull this release into both rawhide and F27 when it 
  happens.

Cheers
  Nick

Comment 4 Stephen Gallagher 2017-09-14 16:26:31 UTC
Created attachment 1326143 [details]
Failed build log

This build still hits a segfault. See attached mock build log.

Comment 5 Nick Clifton 2017-09-15 10:19:42 UTC
Hi Stephen,

  Oh bananas - there was a second PR also affecting the memtest86+ build.
  Please try binutils-2.29-9.fc28 which should fix this second problem.
  (This patch is also in the 2.29.1 point release which will be out soon).

Cheers
  Nick

Comment 6 Stephen Gallagher 2017-09-15 12:35:38 UTC
I can confirm that memtest86+ on Rawhide builds successfully with binutils-2.29-9.fc28 in the buildroot. Thanks!

Comment 8 Petr Šabata 2017-09-15 15:40:31 UTC
I confirm the fix as well.  Our modules built fine.

Comment 9 Langdon White 2017-09-25 23:59:50 UTC
Can this be closed? I currently have it blocking the Modular Server release and I would like it to stop doing that as it isn't blocking it anymore "for real" :).

Comment 10 Nick Clifton 2017-09-26 07:31:00 UTC
OK, I will close this BZ.

Comment 11 Fedora Update System 2018-03-08 14:20:52 UTC
binutils-2.29-13.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e

Comment 12 Fedora Update System 2018-03-08 16:24:12 UTC
binutils-2.29-13.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e

Comment 13 Fedora Update System 2018-03-13 23:17:40 UTC
binutils-2.29-13.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.