Hi,

I am also affected by this problem.  It is an overflow check
using undefined behavior in an overflow check in test.c
that looks like "if (pe + SPINSZ > pe && pe != 0)"
but with >4G memory pe + SIINSZ wraps around.

I think the most simple fix would be the following:

2020-12-15  Bernd Edlinger  <bernd.edlin...@hotmail.de>

        * Makefile: Use -fwrapv-pointer for test.c.

diff -u memtest86+-5.01.orig/Makefile memtest86+-5.01/Makefile
--- memtest86+-5.01.orig/Makefile       2020-12-15 06:50:42.000000000 +0100
+++ memtest86+-5.01/Makefile    2020-12-15 06:54:08.941390803 +0100
@@ -58,7 +58,8 @@
        $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
 
 test.o: test.c
-       $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin 
-ffreestanding test.c
+       $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
+       -ffreestanding -fwrapv-pointer test.c
 
 random.o: random.c
        $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin 
-ffreestanding random.c


** Patch added: "bug-fix for >4G memory"
   
https://bugs.launchpad.net/ubuntu/+source/memtest86+/+bug/1876157/+attachment/5443714/+files/memtest.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1876157

Title:
  Memtest86+ in Ubuntu 20.04 doesn't work, switch to Coreboot branch or
  package new release v5.31b is available since 12/04/2020

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/memtest86+/+bug/1876157/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to