Bug 620846 - x86_64: memtest86+ grub entry fails to boot
x86_64: memtest86+ grub entry fails to boot
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: memtest86+ (Show other bugs)
rawhide
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
:
: 622666 622667 625860 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-03 11:59 EDT by Edouard Bourguignon
Modified: 2011-02-18 20:26 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-19 08:14:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
.spec file patch to use '-z max-page-size=0x1000' on x86_64 links of the ELF image (356 bytes, application/octet-stream)
2011-01-07 15:03 EST, Jack Perdue
no flags Details

  None (edit)
Description Edouard Bourguignon 2010-08-03 11:59:33 EDT
Description of problem:
memtest-setup add an entry for memtest86+ in grub.conf but this entry fails to boot:
Error 13: Invalid of unsupported executable format


Version-Release number of selected component (if applicable):
memtest86+-4.10-2.fc13

How reproducible:
static

Steps to Reproduce:
1. su -c yum install memtest86+
2. su -c memtest-setup
3. reboot on Memtest grub entry
  
Actual results:
Fails to boot with error 13.

Expected results:
Should boot memtest86+

Additional info:
Seems RHEL6 has same problem, see bug #607006
Comment 1 Anton Arapov 2010-08-04 02:30:10 EDT
  Edouard, this is known issue. The problem is in the loader of memtest and the way to fix it is to rewrite the loader. And there are zero volunteers to do it.
  The workaround is to change: 
     kernel --type=netbsd /elf-memtest86+-4.00 to kernel /memtest86+-4.00
in grub.conf. It's not by default because the majority of the systems works just well with current config.
Comment 2 Anton Arapov 2010-08-10 13:01:42 EDT
*** Bug 622666 has been marked as a duplicate of this bug. ***
Comment 3 Anton Arapov 2010-08-10 13:01:51 EDT
*** Bug 622667 has been marked as a duplicate of this bug. ***
Comment 4 Edward Sheldrake 2010-08-20 14:44:25 EDT
*** Bug 625860 has been marked as a duplicate of this bug. ***
Comment 5 Edward Sheldrake 2010-08-20 14:54:08 EDT
Sorry for yet another dupe, however I do have a possible solution (see #625860) for my initial analysis.

I noticed Fedora 13's x86_64 binutils produce a different elf-memtest than Fedora 12's binutils did, and it no longer works. I then later managed to get Fedora 13 to produce a working elf-memtest by doing:

make LD="ld -z max-page-size=0x1000"

A simpler solution may be to just distribute the .i686.rpm, since there's nothing x86_64 in the .x86_64.rpm anyway.
Comment 6 Andre Robatino 2010-08-23 14:31:19 EDT
I can confirm that the problem started for me in F13.  Prior to that I ran 64-bit F10, F11, and F12 on the same hardware without ever seeing it.
Comment 7 Dan Book 2010-12-04 02:36:04 EST
Same problem, and using the non-ELF version doesn't work because I get the error that it doesn't fit into memory. (which is the point of the ELF version from what I understand)
Comment 8 Fedora Admin XMLRPC Client 2010-12-17 03:49:16 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 9 Edward Sheldrake 2010-12-17 04:32:51 EST
There are 2 different causes of this bug here:

1. The memtest86+ loader needs a re-write.
2. On Fedora 13+, the elf-memtest built on x86_64 ends up about 1MB too big due to a change in binutils - http://sourceware.org/ml/binutils/2009-08/msg00563.html

elf-memtest86+-4.10 is always a 32bit executable, there is no 64bit version.

From "readelf -l" on elf-memtest86+-4.10 from the .i686.rpm
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x00100000 0x00100000 0x27ad8 0x27ad8 RW  0x1000

And from "readelf -l" on elf-memtest86+-4.10 from the .x86_64.rpm
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x127ad8 0x127ad8 RW  0x200000
Comment 10 Jack Perdue 2011-01-07 14:28:42 EST
As Edward also noted (Comment #5), there's a linker flag that can be used to reduce the overall size.

Adding this bit to the %prep section of the .spec file:

%ifarch x86_64
sed -i -e's,$(LD) -s -T memtest.lds,$(LD) -s -T memtest.lds -z max-page-size=0x1000,' Makefile
%endif

(adding the '-z max-page-size=0x1000' on x86_64 links of the ELF image)

returns a "readelf -l" image like this:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x00100000 0x00100000 0x26ad8 0x26ad8 RW  0x1000

which is closer to the File/MemSize of the 32-bit version and works when the x86_64 RPM is installed.

So, in this particular case, the workaround is either drop the i686 build in the x86_64 repo (which is probably a nasty hack repo-management-wise) or add the max-page-size option that Edward suggested on the link for the x86_64 ELF image.

FWIW, given that memtest86+ is one of the boot options on the LiveCD, it would be nice if it would work again.
Comment 11 Jack Perdue 2011-01-07 14:31:29 EST
[oops... I appeared to have missed the top part of my post when copying/pasting... here is the first part to the previous comment]

I received the same Error 13 here with Fedora 14 on a Compaq Presario R3000 laptop with 768MB RAM and AMD Athlon(tm) 64 Processor 3000+.

Anton's (Comment #1), which seems to come from https://bugzilla.redhat.com/show_bug.cgi?id=578966 doesn't help (causes instant reboot).

As Edward noted, it is a 32-bit build anyway and using the i686 RPM on my x86_64 system is one workaround (slightly complicated by the fact that the .i686.rpm is not in the x86_64 repo, but other than that it just worked).

... (see previous comment) ...
Comment 12 Jack Perdue 2011-01-07 15:03:55 EST
Created attachment 472291 [details]
.spec file patch to use '-z max-page-size=0x1000' on x86_64 links of the ELF image
Comment 13 moondrake 2011-01-11 08:32:07 EST
Jack: Patch works fine for me, thanks

Anton: the x86_64 size bug seems a different problem than the one you refer to. And is a problem on all three my x86_64 machines (laptops and desktops). This seems to affect a large percentage of users. A bugfix release for F13 and F14 may be a good idea.

About the loader problem, why not make memtest-setup create 2 alternate grub entries and solve it for everybody (instead of assuming it works for a majority).
Comment 14 Jaroslav Škarvada 2011-01-11 10:18:43 EST
I am new maintainer. 

Thanks, patch seems to work.
Comment 15 Fedora Update System 2011-01-19 10:20:32 EST
memtest86+-4.10-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/memtest86+-4.10-3.fc14
Comment 16 Fedora Update System 2011-01-19 10:30:18 EST
memtest86+-4.10-3.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/memtest86+-4.10-3.fc13
Comment 17 Fedora Update System 2011-02-18 20:23:37 EST
memtest86+-4.10-3.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 18 Fedora Update System 2011-02-18 20:26:23 EST
memtest86+-4.10-3.fc14 has been pushed to the Fedora 14 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.