Bug 1021353 - ocserv randomly misbuilds man pages via autogen
ocserv randomly misbuilds man pages via autogen
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Other openSUSE 42.2
: P5 - None : Major (vote)
: ---
Assigned To: Andreas Schwab
E-mail List
Depends on:
Blocks: 1102408
  Show dependency treegraph
Reported: 2017-01-23 09:01 UTC by Bernhard Wiedemann
Modified: 2018-07-24 11:52 UTC (History)
4 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---

mini reproducer (2.36 KB, application/x-gzip)
2017-01-24 10:04 UTC, Bernhard Wiedemann
simple autogen patch (1.03 KB, patch)
2017-01-24 10:36 UTC, Bernhard Wiedemann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Wiedemann 2017-01-23 09:01:41 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
Comment 1 Bernhard Wiedemann 2017-01-23 09:42:15 UTC
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
Comment 2 Marguerite Su 2017-01-23 13:59:40 UTC
Thanks, I'll take a look at it.
Comment 3 Marguerite Su 2017-01-23 16:48:18 UTC
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.
Comment 4 Marguerite Su 2017-01-23 16:52:07 UTC
fixed in network:vpn and forwarded to tumbleweed/factory:


an update stack for released products and an upstream bug report are still needed to be done.

Comment 5 Marguerite Su 2017-01-23 17:03:21 UTC
upstream bug report: https://gitlab.com/ocserv/ocserv/issues/91
Comment 6 Bernhard Wiedemann 2017-01-24 07:20:04 UTC
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
Comment 7 Marguerite Su 2017-01-24 09:48:56 UTC
"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>.
Comment 8 Bernhard Wiedemann 2017-01-24 10:04:36 UTC
Created attachment 711355 [details]
mini reproducer

to use
tar xf autogenracetest.tar.gz
cd autogenracetest/outdir/
Comment 9 Bernhard Wiedemann 2017-01-24 10:36:04 UTC
Created attachment 711361 [details]
simple autogen patch

This would have made the racy build fail
instead of producing missing and incorrect files
Comment 10 Michael Matz 2017-01-24 13:16:33 UTC
Use http://savannah.gnu.org/support/?group=autogen&func=additem for adding
autogen issue or patches.
Comment 11 Bernhard Wiedemann 2017-01-24 14:49:09 UTC
filed it upstream
Comment 12 Bernhard Wiedemann 2017-01-27 19:01:58 UTC
This is an autogenerated message for OBS integration:
This bug (1021353) was mentioned in
https://build.opensuse.org/request/show/453018 42.3 / ocserv
Comment 13 Bernhard Wiedemann 2017-03-15 16:30:08 UTC
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