Created attachment 331479 [details] Don't fail an assert on bad input from dependency generator A contributor triggered an assert fail when building powerman package, which generated a .pc file with an empty version line: Version: which, when processed by pkgconfig dependency generator produced something like: pkgconfig(powerman) = which in turn triggered an unhelpful assertion fail: #0 0x00df5402 in __kernel_vsyscall () #1 0x005b14b0 in raise () from /lib/libc.so.6 #2 0x005b2e78 in abort () from /lib/libc.so.6 #3 0x005aa45e in __assert_fail () from /lib/libc.so.6 #4 0x00fb385b in rpmfcHelper (fc=<value optimized out>, deptype=<value optimized out>, nsdep=0xfb9fab "pkgconfig") at rpmfc.c:407 #5 0x00fb3ce9 in rpmfcSCRIPT (fc=0x8092da8) at rpmfc.c:867 #6 0x00fb1f8f in rpmfcApply (fc=0x8092da8) at rpmfc.c:1273 #7 0x00fb51c0 in rpmfcGenerateDepends (spec=0x807a9a8, pkg=0x8079760) at rpmfc.c:1770 #8 0x00fa616f in processBinaryFiles (spec=0x807a9a8, installSpecialDoc=4, test=0) at files.c:2186 #9 0x00f9fbb9 in buildSpec (ts=0x8068e80, spec=0x807a9a8, what=<value optimized out>, test=0) at build.c:257 #10 0x0804a6e1 in buildForTarget (ts=<value optimized out>, arg=<value optimized out>, ba=0xfc1c00) at build.c:264 #11 0x0804aa19 in build (ts=0x8068e80, arg=0xbfffea38 "powerman.spec", ba=0xfc1c00, rcfile=0x0) at build.c:298 #12 0x0804b761 in main (argc=3, argv=0xbfffe924) at rpmqv.c:698
Created attachment 331485 [details] Be more tolerant about broken pkgconfig files I actually couldn't find a specification that would specify that Version must be present and non-empty.
Applied the second patch in upstream. Thanks for it. We should be more tolerant to pkg-config as it is heavily patched on the Fedora side and we actually rely on the RH patches added to it (--print-provides, --print-requires). Also from the pkg-config POV it is not completely clear whether the Version is mandatory or not so it is good to be cautious here. The _exit() calls are just too ugly in the first patch which is too bad. The rest of rpm just try to propagate bad return code in saner way upwards without exit() or even worse _exit() calls.