During a test build of devel/bear on armv7 FreeBSD 13.1 I noticed that pkg-config 1.8.0 got stuck in an endless loop in this command (processing configuration for devel/grpc 1.47.1,2): pkgconf --static --cflags-only-I protobuf grpc++ The process seems to be allocating memory every once in a while. Here is a backtrace; unfortunately I do not have debug symbols. 0x400ce0d0 in pkgconf_fragment_copy () from /usr/local/lib/libpkgconf.so.3 (gdb) backtrace #0 0x400ce0d0 in pkgconf_fragment_copy () from /usr/local/lib/libpkgconf.so.3 #1 0x400cd380 in ?? () from /usr/local/lib/libpkgconf.so.3 #2 0x400cca90 in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #3 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #4 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #5 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #6 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #7 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #8 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #9 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #10 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #11 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #12 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #13 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #14 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #15 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #16 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #17 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #18 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #19 0x400cd054 in ?? () from /usr/local/lib/libpkgconf.so.3 #20 0x400ccc2c in pkgconf_pkg_traverse () from /usr/local/lib/libpkgconf.so.3 #21 0x400cd2c8 in pkgconf_pkg_cflags () from /usr/local/lib/libpkgconf.so.3 #22 0x0002588c in ?? () #23 0x400d0330 in pkgconf_queue_apply () from /usr/local/lib/libpkgconf.so.3 #24 0x00024ab4 in ?? () #25 0x00023888 in ?? () The same issue can be reproduced on arm64 and amd64.
It appears that the problem no longer happens.
I'm still seeing this problem. jrm@phe ~ % uname -a FreeBSD phe.ftfl.ca 14.0-CURRENT FreeBSD 14.0-CURRENT main-n259729-69542f26820b GENERIC-NODEBUG amd64 % time PKG_CONFIG_DEBUG_SPEW=1 pkgconf --cflags grpc++ -I/usr/local/include -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -maes -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX ... -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -DNOMINMAX PKG_CONFIG_DEBUG_SPEW=1 pkgconf --cflags grpc++ 148.92s user 0.18s system 99% cpu 2:29.99 total The full output above grows to just under 5 MB. ## Equivalent with pkg-config from Freedesktop ## jrm@phe ~/scm/nm/pkg-config % time PKG_CONFIG_PATH=/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig:/usr/local/share/pkgconfig ./pkg-config --cflags grpc++ -Wno-float-conversion -Wno-implicit-float-conversion -Wno-implicit-int-float-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option ... -DNOMINMAX -Wno-float-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -DNOMINMAX -I/usr/local/include PKG_CONFIG_PATH= ./pkg-config --cflags grpc++ 0.00s user 0.01s system 84% cpu 0.014 total With pkg-config the full output above is about 20 KB. ## pkgconf 1.8.0-1 on an arch linux does not seem to have the problem ## jrm@met ~ % uname -a Linux met 6.0.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 08 Dec 2022 11:03:38 +0000 x86_64 GNU/Linux jrm@met ~ % time PKG_CONFIG_DEBUG_SPEW=1 pkgconf --cflags grpc++ -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -DNOMINMAX -maes -msse4.1 -DNOMINMAX -DNOMINMAX PKG_CONFIG_DEBUG_SPEW=1 pkgconf --cflags grpc++ 1.29s user 0.00s system 99% cpu 1.291 total ## I tried updating pkgconf to 1.9.3 (see https://reviews.freebsd.org/D37901) on my FreeBSD system and it seems to fix the problem ## jrm@phe ~ % which pkgconf /usr/local/bin/pkgconf jrm@phe ~ % pkgconf --version 1.9.3 jrm@phe ~ % time pkgconf --cflags grpc++ -I/usr/local/include -maes -msse4.1 -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -DNOMINMAX -Wno-float-conversion -Wno-implicit-float-conversion -Wno-implicit-int-float-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -DNOMINMAX pkgconf --cflags grpc++ 0.02s user 0.01s system 95% cpu 0.027 total
It not hangs, it is just VERY slow. After a few minutes it continues to work. See https://github.com/pkgconf/pkgconf/issues/229
pkgconf 2.0.2 landed. Does this issue still persist?
The problem is resolved now that pkgconf 2.0.2 has landed.