Solved Upgrade to 11 failure

I've tried for several weeks now, every time I sync the sources first and then attempt make buildworld, after make cleanworld. The outcome is always the same, it segfaults at the same place every time. Shall I file a bug? Is there a workaround?
Code:
cc   -O2 -pipe -march=core2  -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC -I. -I/usr/obj/usr/src/lib/ncurses/ncursesw -I/usr/src/lib/ncurses/ncursesw -I/usr/src/lib/ncurses/ncurses -I/usr/src/contrib/ncurses/include -I/usr/src/contrib/ncurses/ncurses -Wall -DNDEBUG -DHAVE_CONFIG_H -DFREEBSD_NATIVE -DTERMIOS -MD  -MF.depend.tty_update.o -MTtty_update.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef  -Qunused-arguments  -c /usr/src/contrib/ncurses/ncurses/tty/tty_update.c -o tty_update.o
cc: error: unable to execute command: Segmentation fault
cc: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 3.9.1 (tags/RELEASE_391/final 289601) (based on LLVM 3.9.1)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/obj/usr/src/tmp/usr/bin
 
I've got this.
Code:
OPTIONS_UNSET= NLS DOCS X11
CPUTYPE?=core2
KERNCONF=TURTLE4
DEFAULT_VERSIONS+= perl5=5.24
MK_PROFILE=no
 
You should upgrade to 11-RELEASE first, 11-RELEASE uses clang 3.8.0. You are trying to build world (of 11-RELEASE?) with clang 3.9.1, which is the compiler of 11-STABLE.
 
Hmmm, thanks. How to set my sources to RELEASE? I glanced over Handbook, see nothing about this there.
 
Uhm, compiler doesn't matter too much here. If you build the world then the first thing the system does is to build its own compiler, then it'll use that to build the rest of the system. This is why it's perfectly possible to build 11.0 on 10.3.

I see you're trying to build a customized kernel. What happens when you try to build GENERIC? I'd start there, once you upgraded you can always continue with setting up a custom kernel again. Of course, depending on how much you changed in your setup.

(edit):

Did you clean out /usr/obj before you tried building 11.0? If not then start there, that's the most common cause for problems.
 
Yes that's what I was thinking.
I do not think kernel matters, it is not even built during make buildworld. And the failure is on ncurses.
Yes I do make cleanworld before building the world, AFAIK it cleans up object files, too.
 
Yes I do make cleanworld before building the world, AFAIK it cleans up object files, too.
Could be, but I'd still recommend wiping out /usr/obj/usr manually nonetheless. Also because this is literally described in the process of recovering when something goes wrong. The recommended steps are basically:
  • # chflags -R noschg /usr/obj/usr
  • # rm -rf /usr/obj/usr
  • # cd /usr/src
  • # make cleandir
  • # make cleandir
No where does it mention the cleanworld target in the documentation (source: FreeBSD handbook), so personally I wouldn't rely on it.
 
Code:
# chflags -R noschg /usr/obj/usr
# rm -rf /usr/obj/usr
This is what make cleanworld does. Anyhow, after all the commands from ShelLuser there is no change, it segfaults at the same spot. Time to file a bug, methinks.
 
As to the attachment: it's not too uncommon to rely on websites such as Pastebin for this.

I checked and I found a few problems with your configuration. However, I can't say for sure how much it will interfere with building your kernel. If there's one thing I learned though its that sometimes even small details can have consequences.

First things first: I noticed that you based your configuration on MINIMAL instead of GENERIC. I wouldn't recommend this unless you know what you're doing, the best route to take is base your configuration of GENERIC and go from there. Also because the main approach of MINIMAL is to move features out of the kernel and supply them through kernel modules. But since you're removing things anyway that seems a bit off to me.

For starters... You removed several compatibility options. I'd recommend against it:

Code:
options     COMPAT_FREEBSD32    # Compatible with i386 binaries
# options     COMPAT_FREEBSD4        # Compatible with FreeBSD4
# options     COMPAT_FREEBSD5        # Compatible with FreeBSD5
# options     COMPAT_FREEBSD6        # Compatible with FreeBSD6
# options     COMPAT_FREEBSD7        # Compatible with FreeBSD7
Unix, per definition, relies heavily on backwards compatibility. I don't know for sure what the consequences of removing these options will be, but I can't help be convinced that it won't be too good.

I also spotted a few errors in the Pseudo device section:

Code:
# options     PADLOCK_RNG    # VIA Padlock RNG
# options     RDRAND_RNG    # Intel Bull Mountain RNG
device        ether        # Ethernet support
Those aren't options, they're devices. This is from GENERIC:

Code:
# Pseudo devices.
device          loop                    # Network loopback
device          random                  # Entropy device
device          padlock_rng             # VIA Padlock RNG
device          rdrand_rng              # Intel Bull Mountain RNG
device          ether                   # Ethernet support
I doubt that leaving those devices in will have consequences, but even so: these are some inconsistencies nonetheless.

Anyway, personally I'd try a different route first to determine if you found a bug or not. Something like this:

Code:
include GENERIC
ident TURTLE4-0

# IPFW - from TURTLE3
options        IPFIREWALL
options        IPFIREWALL_VERBOSE
options        IPFIREWALL_VERBOSE_LIMIT=5
options        IPFIREWALL_DEFAULT_TO_ACCEPT
# options    IPFIREWALL_NAT        # I do not remember why I turned it off
options        IPDIVERT
options        DUMMYNET
So: build a GENERIC kernel (or MINIMAL I guess) with the additions you want and see how well that compiles. If that works you can simply work your way down into removing those devices which you don't need.

One option is of course to copy the configuration file and then commenting things out, you could also use nodevice and nooptions statements in your own configuration file (so you'd include GENERIC, then simply unload/remove whatever you don't need).

So, for MINIMAL I'd probably use something like this (quite frankly I wouldn't use MINIMAL in the first place, but you get the idea):

Code:
include MINIMAL
ident TURTLE4-0

nomakeoptions DEBUG
nomakeoptions WITH_CTF

nooptions DDB
nooptions GDB
nooptions DEADLKRES
nooptions INVARIANTS
nooptions INVARIANTS_SUPPORT
nooptions WITNESS
nooptions WITNESS_SKIPSPIN
nooptions MALLOC_DEBUG_MAXZONES

# IPFW - from TURTLE3
options        IPFIREWALL
options        IPFIREWALL_VERBOSE
options        IPFIREWALL_VERBOSE_LIMIT=5
options        IPFIREWALL_DEFAULT_TO_ACCEPT
# options    IPFIREWALL_NAT        # I do not remember why I turned it off
options        IPDIVERT
options        DUMMYNET
Hope this can give you some ideas.
 
Code:
URL: https://svn.freebsd.org/base/stable/11
Relative URL: ^/stable/11
This system has been built and upgraded from source for many years. I even do not remember what was the version when I installed it.
 
Note: credit where credit's due: SirDice gave me this idea in his post here.

Code:
URL: https://svn.freebsd.org/base/stable/11
Relative URL: ^/stable/11
This system has been built and upgraded from source for many years. I even do not remember what was the version when I installed it.
Well, we just found the reason why it doesn't compile. Despite what the URL suggests you're not using a stable source tree. /stable gets you a developers branch pretty much like CURRENT is. The main difference being that it's not as 'bleeding edge' as CURRENT. But... It's still a developers branch with all risks attached. See also chapter 23.4 of the FreeBSD handbook.

Now... It is very well possible that if you check out the latest build (right now, at the time of you reading this) things may stabilize after which you can compile again.

However, my suggestion is to follow these steps:
  • Backup your kernel configuration (copy it out of the way).
  • # rm -rf /usr/obj/usr ; rm -rf /usr/src && mkdir /usr/src
  • # svn co svn://svn.freebsd.org/base/releng/11.0 /usr/src
  • Put your kernel configuration back into place.
I'm pretty sure that from here on you should be able to compile the kernel and/or the base system.

Hope this helps.
 
Thanks, will try it right away. So I got confused with STABLE ... vs RELEASE. Go figure. After using FreeBSD since 2003 ... My kernel config is a symlink actually, BTW. No harm when it gets lost.
 
Back
Top