From owner-freebsd-ports-bugs@freebsd.org Thu May 18 11:48:52 2017 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026EDD7307A for ; Thu, 18 May 2017 11:48:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD76A849 for ; Thu, 18 May 2017 11:48:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IBmoU6073264 for ; Thu, 18 May 2017 11:48:51 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 211204] loading sysutils/memtest86+ reboots the system Date: Thu, 18 May 2017 11:48:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 11:48:52 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211204 --- Comment #2 from Andriy Gapon --- Created attachment 182690 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D182690&action= =3Dedit attempt to fix loading via freebsd boot chain I finally found some time to look into this and made a few interesting discoveries. Most importantly, the current version of memtest86+, unlike all previous versions, does not relocate itself to the low memory at the very start. Th= at, of course, causes a problem when it switches to the real mode needed for ma= king BIOS calls. That's why it crashed in mem_size -> query_pcbios. I've added a patch to add that early relocation (patch-main.c). I've changed the initial load address to a higher value as well (patch-memtest.lds). That way there should be a smaller chance of interfer= ing with the loader. Also, it seems that the stack size was too small, at least on my system, and some global variables got corrupted after the BIOS calls. I've added a pat= ch for that too (patch-test.h). Additionally I've fixed the SMP detection code for systems with older ACPI versions (patch-smp.c). Finally, I have fixed a couple of problems in the code, so that it can be compiled with newer GCC versions (4.9.x, 5.x) (patch-test.c, patch-lib.c, patch-io.h). Unfortunately, resulting binaries do not work correctly, so t= he compiler is still 4.8. I suspect that the newer compilers do progressively more aggressive optimizations and that results in the bad code because of some q= uite sloppy inline assembly (incorrect constraints and clobber lists) in test.c. Could you please test it and see if it works? Thank you! --=20 You are receiving this mail because: You are the assignee for the bug.=