Dimitry Andric
2018-Apr-26 10:06 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
On 26 Apr 2018, at 06:17, Dewayne Geraghty <dewayne.geraghty at heuristicsystems.com.au> wrote:> > Andre, You're not alone. I think there's a problem with clang6 on i386 > FreeBSD 11.1X, refer: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227552 > https://forums.freebsd.org/threads/uptime-w-i386-breakage.65584/ > and perhaps also on amd64, search for > https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=clang&list_id=226390. > > Without time to investigate I've reverted userland > FreeBSD 11.2-PRERELEASE r332843M amd64 1101515 1101509 > FreeBSD 11.2-PRERELEASE r332843M i386 1101515 1101509As noted in another post, I cannot reproduce the problems with gptboot, but with FreeBSD-11.2-PRERELEASE-i386-20180420-r332802, I do indeed see w and uptime crashing in libxo: (gdb) bt #0 ifree (tsd=0x28000000) at arena.h:799 #1 0x2814b506 in __free (ptr=0x280601ef) at tsd.h:716 #2 0x2808bb07 in xo_do_emit_fields () at /usr/src/contrib/libxo/libxo/libxo.c:6419 #3 0x28089a1c in xo_do_emit (xop=<value optimized out>, flags=<value optimized out>, fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6470 #4 0x28089b61 in xo_emit (fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6541 #5 0x08049f50 in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/usr.bin/w/w.c:475 #6 0x080494cd in _start1 () #7 0x08049448 in _start () #8 0x00000000 in ?? () Not sure if this has anything to do with clang though, it looks more like a double free to me, at first glance. I'll do some debugging. -Dimitry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 223 bytes Desc: Message signed with OpenPGP URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20180426/37d469cf/attachment.sig>
Dimitry Andric
2018-Apr-26 11:45 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
On 26 Apr 2018, at 12:06, Dimitry Andric <dim at FreeBSD.org> wrote:> > On 26 Apr 2018, at 06:17, Dewayne Geraghty <dewayne.geraghty at heuristicsystems.com.au> wrote: >> >> Andre, You're not alone. I think there's a problem with clang6 on i386 >> FreeBSD 11.1X, refer: >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227552 >> https://forums.freebsd.org/threads/uptime-w-i386-breakage.65584/ >> and perhaps also on amd64, search for >> https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=clang&list_id=226390. >> >> Without time to investigate I've reverted userland >> FreeBSD 11.2-PRERELEASE r332843M amd64 1101515 1101509 >> FreeBSD 11.2-PRERELEASE r332843M i386 1101515 1101509 > > As noted in another post, I cannot reproduce the problems with gptboot, > but with FreeBSD-11.2-PRERELEASE-i386-20180420-r332802, I do indeed see > w and uptime crashing in libxo: > > (gdb) bt > #0 ifree (tsd=0x28000000) at arena.h:799 > #1 0x2814b506 in __free (ptr=0x280601ef) at tsd.h:716 > #2 0x2808bb07 in xo_do_emit_fields () at /usr/src/contrib/libxo/libxo/libxo.c:6419 > #3 0x28089a1c in xo_do_emit (xop=<value optimized out>, flags=<value optimized out>, fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6470 > #4 0x28089b61 in xo_emit (fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6541 > #5 0x08049f50 in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/usr.bin/w/w.c:475 > #6 0x080494cd in _start1 () > #7 0x08049448 in _start () > #8 0x00000000 in ?? () > > Not sure if this has anything to do with clang though, it looks more > like a double free to me, at first glance. I'll do some debugging.Strangely, simply recompiling libxo fixes the problem, or at least works around it. This is on the r332802 snapshot, so I guess the libxo.so.0 file shipped may be broken, somehow. -Dimitry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 223 bytes Desc: Message signed with OpenPGP URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20180426/964d1326/attachment.sig>
Andre Albsmeier
2018-Apr-27 17:55 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
On Thu, 26-Apr-2018 at 12:06:21 +0200, Dimitry Andric wrote:> On 26 Apr 2018, at 06:17, Dewayne Geraghty <dewayne.geraghty at heuristicsystems.com.au> wrote: > > > > Andre, You're not alone. I think there's a problem with clang6 on i386 > > FreeBSD 11.1X, refer: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227552 > > https://forums.freebsd.org/threads/uptime-w-i386-breakage.65584/ > > and perhaps also on amd64, search for > > https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=clang&list_id=226390. > > > > Without time to investigate I've reverted userland > > FreeBSD 11.2-PRERELEASE r332843M amd64 1101515 1101509 > > FreeBSD 11.2-PRERELEASE r332843M i386 1101515 1101509 > > As noted in another post, I cannot reproduce the problems with gptboot, > but with FreeBSD-11.2-PRERELEASE-i386-20180420-r332802, I do indeed see > w and uptime crashing in libxo:Scary, seems to be OK here: buildbox:~>cat /usr/src/.svn_revision 333056 buildbox:~>uname -K -m i386 1101515 buildbox:~>w 19:51 up 4:41, 1 user, load averages: 0,25 0,26 0,21 USER TTY FROM LOGIN@ IDLE WHAT andre pts/0 bali 19:42 - w buildbox:~>uptime 19:51 up 4:41, 1 user, load averages: 0,25 0,26 0,21 buildbox:~>ll /lib/libxo.so.0 -r--r--r-- 1 root wheel 97596 27 Apr 15:07 /lib/libxo.so.0 buildbox:~> -Andre> > (gdb) bt > #0 ifree (tsd=0x28000000) at arena.h:799 > #1 0x2814b506 in __free (ptr=0x280601ef) at tsd.h:716 > #2 0x2808bb07 in xo_do_emit_fields () at /usr/src/contrib/libxo/libxo/libxo.c:6419 > #3 0x28089a1c in xo_do_emit (xop=<value optimized out>, flags=<value optimized out>, fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6470 > #4 0x28089b61 in xo_emit (fmt=0x804ad4d "{:time-of-day/%s} ") at /usr/src/contrib/libxo/libxo/libxo.c:6541 > #5 0x08049f50 in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/usr.bin/w/w.c:475 > #6 0x080494cd in _start1 () > #7 0x08049448 in _start () > #8 0x00000000 in ?? () > > Not sure if this has anything to do with clang though, it looks more > like a double free to me, at first glance. I'll do some debugging. > > -Dimitry >-- Unix is very userfriendly. It's just picky who its friends are.