Solved Devd not running after upgrade FreeBSD 12.2 -> 12.3

Hi all,
after upgrade my system from source code, devd fails to start and create a core.
If I treat to start after system boot happens this
Code:
service devd start
devd not running?
Starting devd.
segmentation fault (core dumped)
/etc/rc.d/devd: WARNING: failed to start devd
System seems to be updated
Code:
freebsd-version -kur
12.3-STABLE
12.3-STABLE
12.3-STABLE
but this service don't work

Have I forgotten to do something?

Miguel
 
This is about my system configuration if that might help
Laptop Dell Latitude E6400

Code:
uname -a
FreeBSD lucero 12.3-STABLE FreeBSD 12.3-STABLE r372075 BANDIDO  amd64

Code:
cat /etc/rc.conf
hostname="lucero"

#Configuracion de red
wlans_iwn0="wlan0"
create_args_wlan0="country ES regdomain FCC4"
ifconfig_wlan0="WPA SYNCDHCP"

clear_tmp_enable="YES"
keymap="es.acc"

inetd_enable="YES"

ntpd_enable="YES"
nptdate_flags="-b -s hora.rediris.es"

powerd_enable="YES"
devd_enable="YES"

hald_enable="YES"   

acpi_video_load="YES"
dbus_enable="YES"
polkitd_enable="YES"

moused_enable="NO"

zfs_enable="YES"
fuse_enable="YES"       #Sistema de archivos exFAT

microcode_update_enable="YES"
kld_list="cpuctl"
 
Have I forgotten to do something?
Did you run mergemaster(8) or etcupdate(8)?

Not related to the issue but you should remove some things from your rc.conf:
Code:
devd_enable="YES"
Don't need to enable this, it's enabled by default (one of the few services that are enabled by default)

Code:
inetd_enable="YES"
Relic from the past, are you sure you want to enable this?

Code:
hald_enable="YES"
HAL has been removed a while ago.

Code:
acpi_video_load="YES"
Doesn't belong in rc.conf, should be added to /boot/loader.conf. Simple to remember; *_load goes in loader.conf, *_enable goes in rc.conf.

Code:
polkitd_enable="YES"
Policy Kit has been integrated in Dbus a long time ago. This doesn't do anything anymore.

Code:
moused_enable="NO"
Just remove it. It's set to NO by default.

Code:
fuse_enable="YES"
Doesn't do anything. If you need to load fuse(4) add it to kld_list: sysrc kld_list+="fuse"
 
Thank you for your interest SirDice
Yes, entering in single user mode, this was the sequence after new kernel install
Code:
zfs set readonly=off zroot
zfs mount -a

swapon -a
adjkerntz -i

mergemaster -p

cd /usr/src
make installworld
/usr/sbin/mergemaster -iF
   
cd /usr/src
make delete-old

reboot

pkg upgrade

make delete-old-libs
 
Not related to the issue but you should remove some things from your rc.conf:
I really appreciate your comments on my setup as I have been switching from an old setup to a new one for a long time without paying much attention.
Thanks, I'll correct it and take note of everything.
About the inetd service, I activate it but only for services enabled in inetd.conf like ssh and www in some case; I suppose that this is the correct procedure although maybe you could also do it as sshd_enable="YES" in rc.conf ?

Doesn't belong in rc.conf, should be added to /boot/loader.conf. Simple to remember; *_load goes in loader.conf, *_enable goes in rc.conf.
A rule that I will never forget, thank you
 
Ok, mergemaster(8) was done. Did it perhaps leave some merge issues in /etc/devd.conf? Check that file, and the files under /etc/devd/*. If you had some merge issues that may prevent devd(8) from starting properly.

About the inetd service, I activate it but only for services enabled in inetd.conf like ssh and www in some case; I suppose that this is the correct procedure although maybe you could also do it as sshd_enable="YES" in rc.conf ?
It's a really old way of enabling those services. Just keep inetd(8) disabled and use sshd_enable="YES" if you want to have sshd(8) running. Web services run on nginx, Apache or any of the other. Those are typically started as 'individual' services, usually not through inetd(8).
 
A rule that I will never forget, thank you
No rule without exception ;)

From rc.conf()
kld_list (str) A whitespace-separated list of kernel modules to load
right after the local disks are mounted, without any .ko ex-
tension or path. Loading modules at this point in the boot
process is much faster than doing it via /boot/loader.conf
for those modules not necessary for mounting local disks.
 
This looks odd. ES=Spain FCC=USA
Try and leave this out if you have wireless problems.
The wireless module has a rom and keeps country code info.
Wireless works fine since I add SYNCDHCP to get ip address.
Anyway by removing locale lines it works too, thanks
 
Ok, mergemaster(8) was done. Did it perhaps leave some merge issues in /etc/devd.conf? Check that file, and the files under /etc/devd/*. If you had some merge issues that may prevent devd(8) from starting properly.

This is the content of /etc/devd
Code:
ls -la /etc/devd
total 49
drwxr-xr-x   2 root  wheel     9 26 abr.  13:26 .
drwxr-xr-x  25 root  wheel   116  9 may.  21:29 ..
-rw-r--r--   1 root  wheel  2024  2 oct.   2021 asus.conf
-rw-r--r--   1 root  wheel   524  2 oct.   2021 devmatch.conf
-rw-r--r--   1 root  wheel  3775 26 abr.  13:26 hyperv.conf
-rw-r--r--   1 root  wheel   415  2 oct.   2021 iwmbtfw.conf
-rw-r--r--   1 root  wheel  3147  2 oct.   2021 uath.conf
-rw-r--r--   1 root  wheel   453  2 oct.   2021 ulpt.conf
-rw-r--r--   1 root  wheel  2290  2 oct.   2021 zfs.conf
and /etc/devd.conf is this (attached)
but I don't know if it's correct
I attach dmesg.boot file in case it helps
 

Attachments

  • devd.conf
    8.6 KB · Views: 73
All the files under /etc/devd are standard configuration files not tuned by me as well as devd.conf so, although I don't know exactly their syntax, I understand (in principle) that they are correct.
On that assumption I just did an unusual test to rule out configuration problems which consisted of taking the executable file from an old system running FreeBSD version 12.1 and replacing it on the new one with version 12.3. My surprise is that it works correctly (no cores generated) so I think it is a problem with the new version and not *.conf files problem.
After reboot with the old executable version:
Code:
service devd status
devd is running as pid 811.
Now, for example, I can already hot plug my USB mouse being recognized and hot mounted.
I could leave it working like this but I understand that it is not the correct solution
 
I have tried to generate a new executable file from the source code downloaded through svn

Code:
cd /usr/src/sbin/devd

Code:
make install


install  -s -o root -g wheel -m 555   devd /sbin/devd

install  -o root -g wheel -m 444  devd.debug /usr/lib/debug/sbin/devd.debug

installing DIRS CONFSDIR

install  -d -m 0755 -o root  -g wheel  /etc

installing DIRS DEVDDIR

install  -d -m 0755 -o root  -g wheel  /etc/devd

install  -o root -g wheel -m 444 devd.8.gz  /usr/share/man/man8/

install  -o root -g wheel -m 444 devd.conf.5.gz  /usr/share/man/man5/

===> tests (install)

installing DIRS testsFILESDIR

install  -d -m 0755 -o root  -g wheel  /usr/tests/sbin/devd

install  -o root  -g wheel -m 444  Kyuafile /usr/tests/sbin/devd/Kyuafile

(cd /usr/src/sbin/devd/tests &&  DEPENDFILE=.depend.client_test  NO_SUBDIR=1 make -f /usr/src/sbin/devd/tests/Makefile _RECURSING_PROGS=t   PROG=client_test  install)

install  -s -o root -g wheel -m 555   client_test /usr/tests/sbin/devd/client_test

install  -o root -g wheel -m 444  client_test.debug /usr/lib/debug/usr/tests/sbin/devd/client_test.debug

and after rebooting the system the problem reappears to be updated the executable under /sbin

Code:
service devd status
devd is not running.

Code:
service devd start
Starting devd.
Fallo de segmentaci�n (core dumped)
/etc/rc.d/devd: WARNING: failed to start devd

My compiler
Code:
cc -v
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
Target: x86_64-unknown-freebsd12.3
Thread model: posix
InstalledDir: /usr/bin

Code:
cat /etc/make.conf
CPUTYPE?=native

# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
# explicitly turn it off when using compiling with the -O2 optimization level.
CFLAGS= -O2 -fno-strict-aliasing -pipe -pthread

# CXXFLAGS controls the compiler settings used when compiling C++ code.
# Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
# to add to CXXFLAGS value, "+=" must be used rather than "=".  Using "="
# alone will remove the often needed contents of CFLAGS from CXXFLAGS.
CXXFLAGS+= -O3 -pthread

# To compile just the kernel with special optimizations, you should use
# this instead of CFLAGS (which is not applicable to kernel builds anyway).
# There is very little to gain by using higher optimization levels, and doing
# so can cause problems.
COPTFLAGS= -O -pipe -pthread

#Optimizando ports

OPTIONS_SET=        OPTIMIZED_CFLAGS NLS CPU_OPTS THREADS OPENGL GMP SIMD ASM PNG OPENGL VDPAU VAAPI SYSTRAY NOTIFY
OPTIONS_UNSET=          DEBUG DTRACE GOOGLE CMAKE_CXX_FLAGS_DEBUG CPU_CLIP GVFS

OPTIMIZED_CFLAGS=       YES
BUILD_OPTIMIZED=        YES
WITH_CPUFLAGS=          YES
WITH_LANG=        es
WITHOUT_DEBUG=          YES

DOC_LANG=        es_ES.ISO8859-1

#MK_PROFILE=        NO
BUILD_STATIC=        YES
MALLOC_PRODUCTION=    YES

Code:
cat /etc/src.conf
WITHOUT_KERNEL_SYMBOLS=yes
WITHOUT_ASSERT_DEBUG="ON"

What else can I try?
 
Code:
# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
# explicitly turn it off when using compiling with the -O2 optimization level.
CFLAGS= -O2 -fno-strict-aliasing -pipe -pthread

# CXXFLAGS controls the compiler settings used when compiling C++ code.
# Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
# to add to CXXFLAGS value, "+=" must be used rather than "=".  Using "="
# alone will remove the often needed contents of CFLAGS from CXXFLAGS.
CXXFLAGS+= -O3 -pthread

# To compile just the kernel with special optimizations, you should use
# this instead of CFLAGS (which is not applicable to kernel builds anyway).
# There is very little to gain by using higher optimization levels, and doing
# so can cause problems.
COPTFLAGS= -O -pipe -pthread
Remove this. Don't set any of these unless you know what you are doing.

Code:
BUILD_STATIC= YES 
MALLOC_PRODUCTION= YES
This should probably be removed too.
 
I don't know the reason but after a new source code update devd is operational again
Code:
uname -a
FreeBSD lucero 12.3-STABLE FreeBSD 12.3-STABLE r372092 BANDIDO  amd64
Code:
service devd status
devd is running as pid 818.

Problem solved
 
Finally and in case someone has the same problem, I have verified that this problem appears when the following line is present in make.conf
CFLAGS= -O2 -fno-strict-aliasing -pipe -pthread when performing a make buildworld
 
Back
Top