From owner-freebsd-embedded@freebsd.org Wed Jul 24 18:35:52 2019 Return-Path: Delivered-To: freebsd-embedded@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8473DB45D3 for ; Wed, 24 Jul 2019 18:35:52 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 24D526C628 for ; Wed, 24 Jul 2019 18:35:52 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: by mailman.nyi.freebsd.org (Postfix) id 24698B45D1; Wed, 24 Jul 2019 18:35:52 +0000 (UTC) Delivered-To: embedded@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24092B45D0; Wed, 24 Jul 2019 18:35:52 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 146246C625; Wed, 24 Jul 2019 18:35:49 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563993341; bh=1BdDsH6U2YL6ls3mGhO/vIPoG7yfQyHh+34O7Y3OMKA=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=EYWoceDXJ32c5gQnL4S0WF6xqc6ZFJgUT5bWSYJEeAih9gnHNLMdfue5uh+HrX9Vd mVT4H6tXFXgaUnjlJ0NdkQXO4MjRUIshOziG4al/mlYoew9AOZeYKVy4vi+x7eDtgj VlZuOSowgLSakLXhLrkmnCQQQKU2uAzbOlleXqqg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermann.fritz.box ([91.65.81.169]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MdvqW-1iR49k1PTa-00b2DZ; Wed, 24 Jul 2019 20:30:10 +0200 Date: Wed, 24 Jul 2019 20:30:03 +0200 From: "Hartmann, O." To: Toomas Soome Cc: "freebsd-embedded@freebsd.org" , FreeBSD CURRENT Subject: Re: PCengines APU2C4, 12-STABLE: bootloader failure: Panic: free: guard2 fail @ 0x1000 + 2311663946 from Message-ID: <20190724203003.27310532@hermann.fritz.box> In-Reply-To: <93EFC481-50A1-491C-87BB-12A35F3302EE@me.com> References: <20190724101132.5560377a@thor.intern.walstatt.dynvpn.de> <20190724120720.4382397c@thor.intern.walstatt.dynvpn.de> <20190724154901.0c114ebe@thor.intern.walstatt.dynvpn.de> <93EFC481-50A1-491C-87BB-12A35F3302EE@me.com> Organization: walstatt.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/m3=LP+rbCDt2MASh.M=eXJ."; protocol="application/pgp-signature" X-Provags-ID: V03:K1:+EiBjYwAKCWzvCM0yd4O/fjkcfvVzTDS/DVAueGFi01o3WMtPxg 1SB07rSv3pUzdwElBVHr5t9osljH/Knin8KTQDlVfmmM7t5/ILTw9FWwpxMVW6tMdWaiucj nF5bF6oBuTDm+BrHgJ53ldKUw4PS/FB/iKZQgIt1OstxQkzUiFZ/aaO+iqbOh/wP7EfuS+V urzY4k64+U2GEtIgLXpXg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ojvwHM+oOgI=:k5AF//aAmY8IhB5JcxosxC vu17mEiIa6pTOf/ACFmmJfheDlLTTrXF5/ZPyi1/hMd+B1jo8srAsW9I7BYy6oLaKlFUv+XlE CW9R8PkWUgmRLIi+ht6x9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org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=EYWoceDX X-Spamd-Result: default: False [-6.25 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[walstatt.org]; HAS_ORG_HEADER(0.00)[]; IP_SCORE(-1.12)[ip: (1.02), ipnet: 2610:1c1:1::/48(-3.72), asn: 11403(-2.84), country: US(-0.05)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmx.net:+]; MX_GOOD(-0.01)[cached: mx00.gmx.net]; NEURAL_HAM_SHORT(-0.82)[-0.823,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_NO_TLS_LAST(0.10)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; FORGED_RECIPIENTS(0.00)[tsoome@me.com ..,freebsd-embedded@freebsd.org]; RECEIVED_SPAMHAUS_PBL(0.00)[169.81.65.91.zen.spamhaus.org : 127.0.0.11] X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2019 18:35:52 -0000 --Sig_/m3=LP+rbCDt2MASh.M=eXJ. Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, 24 Jul 2019 18:07:22 +0300 Toomas Soome wrote: > > On 24 Jul 2019, at 16:48, O. Hartmann > > wrote: > >=20 > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA256 > >=20 > > Am Wed, 24 Jul 2019 12:06:53 +0200 > > "O. Hartmann" > > schrieb:=20 > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA256 > >>=20 > >> Am Wed, 24 Jul 2019 12:09:16 +0300 > >> Toomas Soome schrieb: > >> =20 > >>>> On 24 Jul 2019, at 11:11, O. Hartmann > >>>> wrote: > >>>>=20 > >>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>> Hash: SHA256 > >>>>=20 > >>>> Hallo, > >>>>=20 > >>>> on APU2C4 from PCengines with latest firmware apu2_v4.9.0.7.rom, > >>>> SeaBIOS rel-1.12.1.3-0-g300e8b7, booting via legacy MBR FreeBSD > >>>> 12-STABLE r350274 (the same with r350115) fails to boot with an > >>>> immediate loader error: > >>>>=20 > >>>> [...] > >>>> SeaBIOS (version rel-1.12.1.3-0-g300e8b7) > >>>>=20 > >>>> Press F10 key now for boot menu > >>>>=20 > >>>> Booting from Hard Disk... > >>>> / > >>>>=20 > >>>> onsoles: internal video/keyboard =20 > >>>> IOS drive C: is disk0=20 > >>>> IOS drive D: is disk1=20 > >>>> IOS 639kB/3404444kB available memory=20 > >>>>=20 > >>>> reeBSD/x86 bootstrap loader, Revision 1.1 =20 > >>>> Mon Apr 15 21:28:11 CEST 2019 root@thor)=20 > >>>> anic: free: guard2 fail @ 0x1000 + 2311663946 from > >>>> X=C3=A7u0=C3=A7}4=C3=A7l$=E2=99=A6=E2=94=9C=C3=AD@=E2=94=A4=E2=99=A0= :2106163957 -> Press a key on the console to > >>>> reboot <-- [=E2=80=A6] =20 > >>>=20 > >>>=20 > >>> This is definitely something =E2=80=9Cfunny=E2=80=9D, we are apparent= ly > >>> attempting to free pointer 0x1000 which is definitely wrong > >>> because our heap should be just below 4GB line. Since we do get > >>> list of disks printed, also memory and version, it means we get > >>> error from interpretator - it is possible the stack did clash > >>> with bss and hence the corruption. =20 > >>=20 > >> I realized that I have defined=20 > >>=20 > >> WITH_KERNEL_RETPOLINE=3DYES > >>=20 > >> and since I use to build NanoBSD with -DNO_CLEAN, I'm just now > >> compiling a clean NanoBSD with RETPOLINE mitigations disabled so > >> far - trying to check whether either of the ways to build causes > >> the issue.=20 > >>>=20 > >>> You can try to press space on first spinner and enter alternate > >>> loader on boot: prompt. (enter ?/boot on boot: prompt to see the > >>> file list). =20 > >>=20 > >> I try a soon as the build process has finished and if the problem > >> is then still present. =20 > >=20 > >=20 > > With a fresh build and no RETPOLINE mitigation (neither kernel nor > > world) the phenomenon as described above is still the same. I tried > > an alternative loader as requested, but without success. When > > choosing loader_4th, I get this error: > >=20 > > [...] > > FreeBSD/x86 boot > > Default: 0:ad(0p3)/boot/loader > > boot: /boot/loader_4th/ > >=20 > > onsoles: internal video/keyboard > > IOS drive C: is disk0 > > IOS drive D: is disk1 > > IOS 639kB/3404444kB available memory > >=20 > > reeBSD/x86 bootstrap loader, Revision 1.1 > > Wed Jul 24 12:51:12 CEST 2019 root@thor) > > anic: No heap setup =20 > > -> Press a key on the console to reboot <=E2=80=94 =20 > > =20 >=20 > Now this is bad. if my math is correct, this system is supposed to > have 3GB of RAM, so are there specific build exceptions in place? see > stand/i386/loader/main.c, function main, after call to bios_getmem(). >=20 > rgds, > toomas I'm afraid I do not understand exactly the point. The base system is a PCengine APU2C4 - which has 4 GB of memory total. I do not build the NanoBSD image with any kind of buikd exceptions - neither did I with the FreeBSD versions that worked so far (see my initial post for the revision numbers). Should there be build execeptions in place for recent developments? >=20 > >=20 > > Loader loader_simp ends up in stuck console with no output: > >=20 > > [...] > > FreeBSD/x86 boot > > Default: 0:ad(0p3)/boot/loader > > boot: /boot/loader_4th/ > >=20 > > onsoles: internal video/keyboard > > IOS drive C: is disk0 > > IOS drive D: is disk1 > > IOS 639kB/3404444kB available memory > >=20 > > reeBSD/x86 bootstrap loader, Revision 1.1 > > Wed Jul 24 12:59:23 CEST 2019 root@thor) > > [...] > >=20 > > regards > > oh =20 > >> =20 > >>>=20 > >>> =20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>> Booting 12.0-STABLE #78 r349288: Sat Jun 22 09:10:25 CEST 2019 > >>>> amd64 works fine with nothing changed except the OS version. > >>>>=20 > >>>>=20 > >>>> Booting 2.0-STABLE #78 r349288 works fine: > >>>>=20 > >>>> [...] > >>>> SeaBIOS (version rel-1.12.1.3-0-g300e8b7) > >>>>=20 > >>>> Press F10 key now for boot menu > >>>>=20 > >>>> Booting from Hard Disk... > >>>> | > >>>>=20 > >>>> onsoles: internal video/keyboard =20 > >>>> IOS drive C: is disk0=20 > >>>> IOS drive D: is disk1=20 > >>>> IOS 639kB/3404444kB available memory=20 > >>>>=20 > >>>> reeBSD/x86 bootstrap loader, Revision 1.1=20 > >>>> Mon Apr 15 21:28:11 CEST 2019 root@thor)=20 > >>>> oading /boot/defaults/loader.conf=20 > >>>> oading /boot/device.hints=20 > >>>> oading /boot/loader.conf=20 > >>>> oading /boot/loader.conf.local=20 > >>>> Loading kernel... > >>>> /boot/kernel/kernel text=3D0xb005e8 \ > >>>> [...] > >>>>=20 > >>>> In the message taken from the serial console the first column of > >>>> characters is lost due to an error in the output which seems > >>>> FreeBSD related.=20 > >>>=20 > >>> It certainly does look weird - sio_putc() is used in boot2 and > >>> it=E2=80=99s implementation is using same principe as comc_putchat() = in > >>> comconsole.c (even if it is asm versus c code). Since the serial > >>> data is interpreted by terminal, it feels more about terminal > >>> emulator issue (line discipline, cabling, usb to serial > >>> dongle?) =20 > >>=20 > >> We use here a null modem cabling with an integrated > >> USB-to-UART/TTL converter, which is attached to a FreeBSD CURRENT > >> (most recent) box: > >>=20 > >> [...] > >> ugen2.3: at usbus2 > >> uftdi0 on uhub4 > >> uftdi0: on usbus2 > >> [...] > >>=20 > >> it is a=20 > >> StarTech.com 1 Port USB Nullmodem RS232 Adapter Kabel (USB 2.0 > >> FTDI chipset). > >>=20 > >> Regards, > >> oh > >>=20 > >> =20 > >>>=20 > >>> rgds, > >>> toomas > >>>=20 > >>> =20 > >>>>=20 > >>>> The file /boot/loader.conf.local contains these lines in both, > >>>> working and non-working, scenario: > >>>>=20 > >>>> [...] > >>>> boot_serial=3D"YES" > >>>> # serial speed in bits/s > >>>> comconsole_speed=3D"115200" > >>>> console=3D"comconsole" > >>>>=20 > >>>> autoboot_delay=3D"0" > >>>>=20 > >>>> verbose_loading=3D"YES" > >>>> loader_logo=3D"orb" > >>>> beastie_disable=3D"YES" > >>>>=20 > >>>> ### Microcode > >>>> #cpu_microcode_load=3D"YES" # Set this to YES to > >>>> load and apply a > >>>> #cpu_microcode_name=3D"/boot/firmware/intel-ucode.bin" # Set this > >>>> to the microcode #cpu_microcode_type=3D"cpu_microcode" # > >>>> Required for the kernel to find # the microcode update file. > >>>>=20 > >>>>=20 > >>>> # disable Process Table Isolation > >>>> #vm.pmap.pti=3D0 > >>>>=20 > >>>> kern.geom.label.gptid.enable=3D0 > >>>>=20 > >>>> # Limit the phys. memory > >>>> #hw.physmem=3D1073741824 # 1 G > >>>> #hw.physmem=3D536870912 # 512 MB > >>>> #hw.physmem=3D268435456 # 256 MB > >>>>=20 > >>>> # Da mehr als 1 igb NIC an Bord! Siehe man igb(4) > >>>> kern.ipc.nmbclusters=3D757350 > >>>> #kern.ipc.nmbjumbo9k=3D8192 > >>>>=20 > >>>> # NIC > >>>> #hw.em.max_interrupt_rate=3D32000 > >>>> hw.em.max_interrupt_rate=3D16000 > >>>>=20 > >>>> #If non-zero, enable EXPERIMENTAL feature to improve concurrent > >>>> Fortuna performance kern.random.fortuna.concurrent_read=3D"1" > >>>>=20 > >>>> # Forward Information Bases (FIBs) > >>>> net.fibs=3D10 > >>>> net.add_addr_allfibs=3D0 > >>>>=20 > >>>> [...] > >>>>=20 > >>>>=20 > >>>> Again, with the exact same setting 12-STABLE r349288 boots fine, > >>>> rr350274 doesn't. FreeBSD 12-STABLE r > >>>>=20 > >>>> Can someone please help? > >>>>=20 > >>>> Thanks in advance, oh =20 > >=20 > > [...] > >=20 > >=20 > > - --=20 > > O. Hartmann > >=20 > > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3= =BCr > > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 = Abs. 4 > > BDSG). -----BEGIN PGP SIGNATURE----- > >=20 > > iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXThhzQAKCRA4N1ZZPba5 > > R5SrAQDMEZQPGXsD9dqGsq9wNOPYPY7o0y/sBm9ovRkyepI5VwD/WUulyFprjlPI > > hKYI/AJ/VVqI3EfPd/dUiSyBf1toeQw=3D > > =3DaLz0 > > -----END PGP SIGNATURE----- > > _______________________________________________ > > freebsd-current@freebsd.org > > mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-current > > To > > unsubscribe, send any mail to > > "freebsd-current-unsubscribe@freebsd.org > > " =20 >=20 > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" --Sig_/m3=LP+rbCDt2MASh.M=eXJ. Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXTijqwAKCRA4N1ZZPba5 Rw1PAP0ahBLrj0EdGz3TOlt5+OXpYkWqjF7fp8urcgtK5uFNtQD+Lnh6k+GIJZSM P9UjiOyKqkmFdN5pLO21QpfZSjCAewE= =rsps -----END PGP SIGNATURE----- --Sig_/m3=LP+rbCDt2MASh.M=eXJ.--