Bugzilla – Bug 1021353
ocserv randomly misbuilds man pages via autogen
Last modified: 2018-07-24 11:52:01 UTC
when building the ocserv package on a multi-core machine it randomly misbuilds man pages ocpasswd.8 ocserv.8 occtl.8 where one of them contains content that should have been in another The problem goes away when changing -make V=1 %{?_smp_mflags} +make V=1 so there is probably some race condition where the concurrently running man-page generators creates a single temp file
the problematic part of the build is probably around autogen -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl "../src/occtl/args.def".tmp && \ rm -f "../src/occtl/args.def".tmp
Thanks, I'll take a look at it.
the problem happened because both occtl and ocpasswd use the same configuration filename "args.def" to build man pages. ocserv didn't have this problem because its configuration file's name is unique. although they were put into different sub-directories under /src, when loaded by autogen, it's impossible for autogen to distinguish one from the other. fixed by adding a prefix to them.
fixed in network:vpn and forwarded to tumbleweed/factory: https://build.opensuse.org/request/show/452014 an update stack for released products and an upstream bug report are still needed to be done. Marguerite
upstream bug report: https://gitlab.com/ocserv/ocserv/issues/91
I still think, we could improve autogen in this regard. e.g. if it would not strip all path and trailing dot components, this race would not have happened ~/autogen/outdir # strace -s 200 -o ../autogen.strace autogen -DMAN_SECTION=8 -Tagman-cmd.tpl ../indir/args.in1.def ; grep \\.man ../autogen.strace WARNING: fserr 2 (No such file or directory) performing 'search for' on ../indir/args.in1.def unlink("args.man") = -1 ENOENT (No such file or directory) access("args.man", W_OK) = -1 ENOENT (No such file or directory) open("args.man", O_RDWR|O_CREAT|O_TRUNC, 0666) = 5 rename("args.man", "occtl.8") = 0
"improve autogen" is beyond my capacity. it sounds like it needs an upstream bugfix from autogen side, or a completely new "feature" :-(. feel free to reassign it to autogen maintainer: Andreas Schwab <schwab@suse.de>.
Created attachment 711355 [details] mini reproducer to use tar xf autogenracetest.tar.gz cd autogenracetest/outdir/ ../test.sh
Created attachment 711361 [details] simple autogen patch This would have made the racy build fail instead of producing missing and incorrect files
Use http://savannah.gnu.org/support/?group=autogen&func=additem for adding autogen issue or patches.
filed it upstream
This is an autogenerated message for OBS integration: This bug (1021353) was mentioned in https://build.opensuse.org/request/show/453018 42.3 / ocserv
https://build.opensuse.org/request/show/459712 was accepted to make sure that such breakages at least get noticed in the future and https://savannah.gnu.org/support/index.php?109234 is reported upstream to give them a chance to fix it properly