Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488168 - net-fs/samba-4.1.0 - xsltproc -o default/docs-xml/manpages/smb.conf.5 fails: Build failed: -> task failed (err #-7): {task: manpages/smb.conf.5 smb.conf.5.xml -> smb.conf.5}
Summary: net-fs/samba-4.1.0 - xsltproc -o default/docs-xml/manpages/smb.conf.5 fails: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
: 600924 609528 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-16 06:18 UTC by MCassaniti
Modified: 2020-01-07 20:19 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Truncated build log (build-truncated.log,1000.00 KB, text/plain)
2013-10-16 06:25 UTC, MCassaniti
Details
Environment (environment,158.12 KB, text/plain)
2013-10-17 00:08 UTC, MCassaniti
Details
emerge --info --verbose (emerge-info.log,14.06 KB, text/plain)
2013-10-17 00:09 UTC, MCassaniti
Details
build.log.gz (build.log.gz,243.18 KB, application/x-gzip)
2013-10-17 00:10 UTC, MCassaniti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MCassaniti 2013-10-16 06:18:44 UTC
When attempting to build Samba-4 (I've tried 4.0.0, 4.0.9, 4.1.0 so far) I get an error when the man page smb.conf.5 is being generated. I've tried building by hand on my Gentoo system and on a Fedora machine. The Fedora machine doesn't fail even though key packages related to XML/XSLT match in version. This suggests either a bug with one of the Gentoo packages, or a USE flag needs changing.

I'm putting this under Samba-4 so that the correct USE flag is requested in future ebuilds.

=== Package details ===
app-text/docbook-xml-dtd-4.1.2-r6
app-text/docbook-xml-dtd-4.2-r2
app-text-xmlto-0.0.24-r1: -latex
dev-libs/libxml2-2.9.1-r1: ipv6 lzma -python readline
dev-python/lxml-3.2.1: threads
dev-libs/libxslt-1.1.28-r1: crypt -python

Reproducible: Always

Steps to Reproduce:
Attempt to build the package with the above use flags set. Even when changing the -python to +python, the build of the man page still fails.
Actual Results:  
I'll attach the full build log to explain exactly what occurred. In short:

[3578/3664] Generating manpages/smb.conf.5
15:58:46 runner  XML_CATALOG_FILES="file:///etc/xml/catalog file:///usr/local/share/xml/catalog file:///var/tmp/portage/net-fs/samba-4.1.0/work/samba-4.1.0/bin/default/docs-xml/build/catalog.xml"

export XML_CATALOG_FILES

/usr/bin/xsltproc --xinclude --stringparam noreference 0 -o default/docs-xml/manpages/smb.conf.5.xml --nonet /var/tmp/portage/net-fs/samba-4.1.0/work/samba-4.1.0/docs-xml/xslt/expand-sambadoc.xsl ../docs-xml/manpages/smb.conf.5.xml

/usr/bin/xsltproc --nonet -o default/docs-xml/manpages/smb.conf.5 /var/tmp/portage/net-fs/samba-4.1.0/work/samba-4.1.0/docs-xml/xslt/man.xsl default/docs-xml/manpages/smb.conf.5.xml 

Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.1.0/work/samba-4.1.0/bin'
Build failed:  -> task failed (err #-7): 
	{task: manpages/smb.conf.5 smb.conf.5.xml -> smb.conf.5}


I initially added to a bug with the Samba Bugzilla (https://bugzilla.samba.org/show_bug.cgi?id=9515), but they've helped me to show that this is Gentoo specific, not an upstream issue.
Comment 1 MCassaniti 2013-10-16 06:25:20 UTC
Created attachment 360984 [details]
Truncated build log

Build log truncated to last 1000KB.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-10-16 12:49:53 UTC
Comment on attachment 360984 [details]
Truncated build log

Please attach the entire (compressed) build log to this bug report.
Comment 3 MCassaniti 2013-10-17 00:08:35 UTC
Created attachment 361082 [details]
Environment

Environment file. Possibly not required.
Comment 4 MCassaniti 2013-10-17 00:09:06 UTC
Created attachment 361084 [details]
emerge --info --verbose
Comment 5 MCassaniti 2013-10-17 00:10:48 UTC
Created attachment 361086 [details]
build.log.gz

Sorry for not uploading the compressed build log. I'm used to the Kernel mailing list where such things are not allowed.
Comment 6 MCassaniti 2013-10-17 00:12:43 UTC
I don't mind if you change the version details in the bug description, but I would really like this bug to reflect that the problem is building a man page. The issue is certainly not about building the binaries or some other portion of the build process. I'll let you decide what is best though rather than change it.
Comment 7 MCassaniti 2013-10-22 05:04:27 UTC
I've tried to rebuild this on a vanilla Gentoo build. This involved these steps:
 - Download 20131008 x86 minimal boot ISO and booting from this ISO
 - Download of 20131008 i686 stage 3 as a base and extracting
 - Download of portage-latest and extracting
 - Addition of appropriate KEYWORDS, USE flags and an unmask to suit samba-4.1.0
 - Compile of samba-4.1.0 and required dependencies

The build failed on merge because there is no /run directory populated within the chroot. This is unrelated to the bug at hand and would've succeeded in a more normal environment.

I copied from my current build machine the files make.conf, package.use, package.unmask and package.keywords. After this I ran the following:
 - Fixed the /run directory problem from earlier
 - emerge -auvD --newuse world
 - emerge -av --newuse \=samba-4.1.0

The package merged successfully. Still not sure what the issue is as this doesn't seem to be related to a USE flags problem. Next step was to try the last two steps again on my current build machine which again failed.

I found that the make profile on my build machine is for hardened/linux/x86, but the vanilla machine is default/linux/x86/13.0. So I performed the following on the vanilla machine:
 - Changed profile to hardened/linux/x86
 - Re-built gcc, glibc and binutils
 - Ran emerge -euvD --newuse world
 
This was done to rebuild the entire system as hardened. I realise there's probably more flags there than required. When this was run the build of samba-4.1.0 failed with the same error.
 
I rebuilt the following packages with USE="-hardened" and a vanilla gcc (i686-pc-linux-gnu-4.7.3-vanilla on hardened profile):
 - virtual/libiconv
 - app-text/docbook-xml-dtd:4.2
 - dev-libs/libxml2
 - dev-libs/popt
 - dev-python/python-exec
 - dev-python/python:2.7
 - dev-python/python:3.2
 - dev-python/subunit
 
The results were the same (failure of man page build). I then ran an emerge -e world with the vanilla gcc mentioned above. Samba-4.1.0 now built successfully.
 
Conclusion: Something when it is built with a hardened compiler is causing samba-4 man page generation to fail. What that something is I don't yet know.
Comment 8 MCassaniti 2013-10-23 01:32:49 UTC
My plan is to run the xsltproc command manually on the failing and working machine with appropriate debugging/function tracing. Unfortunately I don't have experience doing debugging so I was hoping someone could suggest and appropriate process for this. From there I could probably open a new bug against the right package and maintainer so this can be resolved and no longer be an issue of the Gentoo Samba team.

Assitance with debugging anyone?
Comment 9 Kevin Cody Jr. 2015-02-09 22:36:52 UTC
This is repeat of debian #750593. The bug is in docbook-xslt, an inappropriate recursive function that causes a stack overflow.

This patch allows Samba to build:

https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=66;filename=nonrecursive-string-subst.patch;att=1;bug=750593
Comment 10 MCassaniti 2015-02-11 22:26:30 UTC
So where to next. Is it ideal to have this patch included within the Samba 4 builds, or is it an upstream issue? I didn't see any obvious changes to the man page building from reading the release notes upstream.

I can try a rebuild on a hardened box and see what the results are with this patch if you would like?
Comment 11 Simon C. Ion 2015-09-08 04:47:45 UTC
I can confirm that the patch in comment #9 causes Samba-4.1.20-r1 to build on an ~x86 system. There's some speculation in discussion on Debian bug 750593 about permissions of /dev/shm, but on my system /dev/shm is world-writeable. 

This appears to be a 32-bit platform-specific bug in app-text/docbook-xsl-stylesheets. Any hope of getting this issue resolved in the next couple of months?
Comment 12 Jenny Danzmayr 2016-01-18 01:59:04 UTC
I can confirm that the patch in comment #9 causes samba-4.2.7-r1 to build on a fresh install of gentoo-hardened on amd64.

This also affects amd64 systems
Comment 13 Víctor Ostorga (RETIRED) gentoo-dev 2016-01-18 14:32:03 UTC
(In reply to masterbase from comment #12)
> I can confirm that the patch in comment #9 causes samba-4.2.7-r1 to build on
> a fresh install of gentoo-hardened on amd64.
> 
> This also affects amd64 systems

I cannot reproduce it. Please share your build log and the output of the command qlist -Iv | egrep -i 'docbook|libxslt'
Comment 14 Jenny Danzmayr 2016-01-21 16:11:24 UTC
I looked at it again, it appears that on amd64 systems, the bug only occurs on systems that don't have a lot of ram (>1GB). If you're still interested I can test it again and share the result.
Comment 15 Navid Zamani 2016-04-16 20:06:14 UTC
I can reproduce it on an ARMv7 hard-float system with only 1GB of RAM.
Comment 16 Stoycho 2017-02-17 15:15:20 UTC
*** Bug 609528 has been marked as a duplicate of this bug. ***
Comment 17 Matthias Hanft 2017-06-16 13:22:47 UTC
*** Bug 600924 has been marked as a duplicate of this bug. ***
Comment 18 Manfred Knick 2017-10-22 16:09:49 UTC
REFERENCE:


Bug 635064 - net-fs/samba-[ 4.5.10-r1,4.6.8-r1,4.7.0-r1]: runtime error while generating man-pages


*SOUTION* proposed // *PATCH* provided :

https://bugs.gentoo.org/635064#c10
Comment 19 Matthew Marlowe (RETIRED) gentoo-dev 2017-10-23 23:53:22 UTC
Also, seeing this bug on a new amd64 system w/ 2GB ram.  Unable to build any recent version of samba w/o the patch.  Haven't tried a complete world rebuild yet...that might be next step.  But, it does look like redhat has this as an active bug in their db too...real issue.  Not sure why it is not being addressed upstream.
Comment 20 Matthew Marlowe (RETIRED) gentoo-dev 2017-10-25 05:39:03 UTC
ok, apparently the patch for this bug was included in =app-text/docbook-xsl-stylesheets-1.79.1-r2 as adding that package to packages.accept_keywords is all that is needed to get samba to install w/o breaking during the build of the manpages.
Comment 21 Michael Hofmann 2017-12-01 16:53:23 UTC
1) I was hit by this bug during "emerge -e @world" after switching to profile "default/linux/amd64/17.0/no-multilib".
2) I saw this bug on Samba 4.5.10-r1 and ~4.5.15.
3) I can confirm that upgrading to "docbook-xsl-stylesheets-1.79.1-r2" solves the problem. Thanks to Matthew Marlowe!
Comment 22 Michael Hofmann 2017-12-01 17:15:44 UTC
I filed a stabilization request in bug 639398.
Comment 23 Rees Machtemes 2017-12-02 08:56:28 UTC
I can confirm this bug on 32-bit PPC with samba-4.5.10-r1.
Also confirm that upgrading to "docbook-xsl-stylesheets-1.79.1-r2" solves it! 

Damn, this package takes a million years to build on older machines. So glad I won't have to do this again for a while!