Solved Upgrade failed: Bus error (core dumped)

Lamia

Aspiring Daemon

Reaction score: 152
Messages: 619

A box that has been running custom kernel/base suddenly showed
Code:
%freebsd-version -kur
12.0-RELEASE-p10
12.0-RELEASE-p10
12.1-RELEASE
Before now, I was sure that it was running a custom kernel/base as "freebsd-update fetch install" command won't run on it. I had always had to make buildkernel etc to upgrade it.

When I saw the discrepancy, I ran mergemaster -iU, make delete-old/delete-old-libs. I changed /etc/motd to reflect 12.1-RELEASE. The command uname -a had been showing 12.0-RELEASE-p10 Generic at a time I had even set loader.conf to use MYKERNEL. Sadly, it was still showing Generic at a time I restarted and ensured the OS use MYKERNEL when booting.

Moving forward, I tried "freebsd-update fetch install" and the OS started downloading the updates/patches. It stopped at some point and since then no executable works. They are show bus error (core dumped).

I have tried "ldconfig -r /lib /usr/lib..." but no lock. The /rescue/ dir contains fewer statically linked exec to fix the OS. The commands in it work e.g. zpool except sh, which also breaks with "bus error (core dumped)" at some point.

To make matter worse, the /usr/src is empty, SVN checkout throws "bus error (core dumped)", ssh too and many more. At few times, I had copied libkvm.so and libbz.so from /usr/obj/src/amd64.amd/... when the OS threw error "invalid file format" for those libs yet replacing them won't fix the error. It would rather produce "unsupported file format". freebsd-update rollback/fetch throws bus error too.

The PC boots up but no longer starts X.org i.e. GUI. And most commands now throw the bus error after logging in and running them.

I won't want to reinstall the OS; your suggestions would be appreciated
 

T-Daemon

Daemon

Reaction score: 494
Messages: 1,037

To make matter worse, the /usr/src is empty, SVN checkout ...
If you are thinking to obtain a fresh copy of the source code to compile world and kernel to replace the current system, then this is easily done without svn. But before doing so check if make(1) and unzip(1) core dump.

If they don't core dump, for the source code go to https://github.com/freebsd/freebsd, choose the branche you want on the top left side of the page, on the top right side download the code as a zip file. I have done this a few times myself with a system with no internet access and only mobile phone at my disposal (no mobile hotspot or USB/Bluetooth tethering possible ).

But there is no guarantee the build process will go through with that affected system.

If you need to, backup your important data first.

You could also try a cross-install as described for current in UPDATING.

Assuming there is no other parallel installed FreeBSD system available, you could install a fresh system on a USB pendrive or similar device, with minimum 8 gigabyte capacity, install devel/llvm80, get the source code, build the system, cross-install on affected system.

If you decide to procede with a cross-install, have a look at COMMON ITEMS, General Notes in UPDATING.

But the question here is, is it worth the trouble, wouldn't a fresh system installation be the easiest way to return to a functional system, or are there circumstances worth it?
 
OP
Lamia

Lamia

Aspiring Daemon

Reaction score: 152
Messages: 619

Thanks T-Deamon. I did like you advised. Re-installation of the OS was the action performed. And given that the HDDs are spinning drives, I dropped an SSD for caching and logging (ZIL and ZPARC). Performance was unbelievable afterwards.
 
Top