Everytime I compile something that uses 'xsltproc' it segfaults. Here's some dmesg-output: xsltproc[26954]: segfault at 25 ip 4011fc9a sp bfa6aad0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[26952]: segfault at 39 ip 40167aca sp bfe1f510 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[26955]: segfault at 39 ip 40167aca sp bff54e20 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[26969]: segfault at 25 ip 4011fc9a sp bfc67320 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[26970]: segfault at 39 ip 40167aca sp bf82df30 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[26971]: segfault at 39 ip 40167aca sp bfebfdb0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[27018]: segfault at 25 ip 4011fc9a sp bf806e90 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[27019]: segfault at 25 ip 4011fc9a sp bfa220c0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[27022]: segfault at 25 ip 4011fc9a sp bf805690 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[27023]: segfault at 25 ip 4011fc9a sp bff6ae10 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[19411]: segfault at 25 ip 4011fc9a sp bfed3510 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30352]: segfault at 25 ip 4011fc9a sp bf9d6fe0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[15552]: segfault at 25 ip 4011fc9a sp bf8fe7f0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[15621]: segfault at 25 ip 4011fc9a sp bfe13c90 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[5236]: segfault at 25 ip 4011fc9a sp bf903730 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[19566]: segfault at 25 ip 4011fc9a sp bfd87af0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30804]: segfault at 6e756675 ip 4011fc04 sp bfcbab60 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30807]: segfault at 6e756675 ip 4011fc04 sp bfe1b4e0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30809]: segfault at 25 ip 4011fc9a sp bfbe4280 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30815]: segfault at 25 ip 4011fc9a sp bff25dd0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30820]: segfault at 39 ip 40167aca sp bfd0cc00 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30822]: segfault at 25 ip 4011fc9a sp bfaeb190 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30825]: segfault at 39 ip 40167aca sp bfa4e150 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30828]: segfault at 25 ip 4011fc9a sp bfedc590 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30839]: segfault at 70 ip 4011fc04 sp bfb469c0 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30840]: segfault at 70 ip 4011fc04 sp bfcca360 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30842]: segfault at 39 ip 40167aca sp bfa66930 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30843]: segfault at 39 ip 40167aca sp bfc8f370 error 4 in libxml2.so.2.7.2[400fc000+125000] xsltproc[30844]: segfault at 25 ip 4011fc9a sp bff2edc0 error 4 in libxml2.so.2.7.2[400fc000+125000] __ratelimit: 1 messages suppressed xsltproc[6782]: segfault at 6e756675 ip 400b4c04 sp bfa028a0 error 4 in libxml2.so.2.7.2[40091000+125000] xsltproc[6788]: segfault at 6e756675 ip 400b4c04 sp bffa5e60 error 4 in libxml2.so.2.7.2[40091000+125000] xsltproc[6786]: segfault at 6e756675 ip 400b4c04 sp bfc502e0 error 4 in libxml2.so.2.7.2[40091000+125000] Here is some ebuild-output from app-text/docbook-xsl-stylesheets-1.74.0: Note: namesp. cut : processing stripped document Unit Test: refentry.007 Writing /tmp/smoketest-output/rn01re01.html for refentry Writing /tmp/smoketest-output/rn01.html for reference Writing /tmp/smoketest-output/index.html for book Writing /tmp/smoketest-output/toc.xml Writing /tmp/smoketest-output/plugin.xml Writing /tmp/smoketest-output/index.xml html/glossary.xsl:0: error : Unknown node type 0 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope html/glossary.xsl:0: error : Unknown node type 0 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope Note: namesp. cut : stripped namespace before processing WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Note: namesp. cut : processing stripped document WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Writing /tmp/smoketest-output/rn01re01.html for refentry Writing /tmp/smoketest-output/rn01.html for reference Writing /tmp/smoketest-output/index.html for book Writing /tmp/smoketest-output/htmlhelp.hhp Writing /tmp/smoketest-output/toc.hhc error : Node doc differs from parent's one /bin/sh: line 1: 6803 Segmentation fault xsltproc --stringparam base.dir /tmp/smoketest-output/ --param manifest.in.base.dir 1 $stylesheet tests/refentry.007.ns.xml error : Node doc differs from parent's one /bin/sh: line 1: 6805 Segmentation fault xsltproc --stringparam base.dir /tmp/smoketest-output/ --param manifest.in.base.dir 1 $stylesheet Note: namesp. cut : stripped namespace before processing WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Note: namesp. cut : processing stripped document WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Writing /tmp/smoketest-output/rn01re01.html for refentry Writing /tmp/smoketest-output/rn01.html for reference Writing /tmp/smoketest-output/index.html for book Writing /tmp/smoketest-output/toc.xml Writing /tmp/smoketest-output/plugin.xml Writing /tmp/smoketest-output/index.xml /bin/sh: line 1: 6806 Segmentation fault xsltproc --stringparam base.dir /tmp/smoketest-output/ --param manifest.in.base.dir 1 $stylesheet tests/refentry.007.ns.xml /bin/sh: line 1: 6807 Segmentation fault xsltproc --stringparam base.dir /tmp/smoketest-output/ --param manifest.in.base.dir 1 $stylesheet Note: namesp. cut : stripped namespace before processing WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Note: namesp. cut : processing stripped document WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Writing /tmp/smoketest-output/rn01re01.html for refentry Writing /tmp/smoketest-output/rn01.html for reference Writing /tmp/smoketest-output/index.html for book Writing /tmp/smoketest-output/jhelpset.hs Writing /tmp/smoketest-output/jhelptoc.xml Writing /tmp/smoketest-output/jhelpmap.jhm Writing /tmp/smoketest-output/jhelpidx.xml error : Unknown node type 0 error : Unknown node type 162236440 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope error : Unknown node type 0 error : Unknown node type 152528920 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope * * ERROR: app-text/docbook-xsl-stylesheets-1.74.0 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 113: Called _eapi0_src_compile * ebuild.sh, line 607: Called _eapi2_src_compile * ebuild.sh, line 641: Called die * The specific snippet of code: * emake || die "emake failed" * The die message: * emake failed Reproducible: Always Steps to Reproduce: Emerge something that uses xsltproc. Actual Results: Read above. Expected Results: No segfault. emerge --info Portage 2.2_rc11 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.7-r2, 2.6.26-gentoo-r1 i686) ================================================================= System uname: Linux-2.6.26-gentoo-r1-i686-Genuine_Intel-R-_CPU_1300_@_1.66GHz-with-glibc2.0 Timestamp of tree: Thu, 09 Oct 2008 11:45:05 +0000 app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7, 2.1.6-r1 dev-lang/python: 2.5.2-r8 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.3.0-r1 sys-apps/sandbox: 1.2.18.1-r3 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.26 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo" LANG="de_DE.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY=" " SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X bzip2 crypt dbus doc hal hardened ipv6 jpeg kde kdeenablefinal kdehiddenvisibility mmx mmxext nls ntpl ntplonly opengl pch pic python readline sse sse2 ssl threads unicode x86" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw copy dshare dsnoop extplug file hooks ladspa lfloat linear meter mulaw multi null rate route share shm asym dmix empty iec958 ioplug plug softvol mmap_emul" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="macmini" USERLAND="GNU" VIDEO_CARDS="fbdev vesa i810" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Downgrading to dev-libs/libxslt-1.1.22 and from dev-libs/libxml2-2.7.1 to dev-libs/libxml2-2.7.2 yields in the same segfaults. For now I disable the doc-useflag (again) and enable it only for some packages (java-doc). The whole docbook-stuff never worked for me, and the forums are full of problems with it. I guess I have to go without it if I do not want to run into compilation-errors every now and then..
if would help if you could get a backtrace of the problem. Could you run the commands issued by the build system inside gdb and see if xsltproc segfaults and if so attach the backtrace ? http://www.gentoo.org/proj/en/qa/backtraces.xml
Created attachment 168070 [details] Output of gdb+xsltproc. Here's the backtrace. Since this is my first backtrace, I will explain what I did. If something went wrong point it out and I'll try to fix it. 1) Set the flags in make.conf: CFLAGS="-march=prescott -O2 -ggdb" 2) Added splitdebug-feature to features in make.conf: FEATURES="splitdebug" 3) Reemerge libxml2 and libxslt with the following USE-flags: [ebuild R ] dev-libs/libxml2-2.7.2 USE="debug python readline -bootstrap -build -doc -examples -ipv6 -test" [ebuild R ] dev-libs/libxslt-1.1.24-r1 USE="crypt python -debug -examples" 4) Searched for something in app-text/docbook-xsl-stylesheets-1.74.0 that segfaults. I untared the ebuild and found this command (searched the install.sh and Makefile): xsltproc html/docbook.xsl tests/refentry.007.ns.xml (cd to dir where Makefile and install.sh are located) What is weird: xsltproc -o output.test html/docbook.xsl tests/refentry.007.ns.xml works: xsltproc -o output.test html/docbook.xsl tests/refentry.007.ns.xml Note: namesp. cut : stripped namespace before processing Unit Test: refentry.007 WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Note: namesp. cut : processing stripped document Unit Test: refentry.007 html/glossary.xsl:0: error : Unknown node type 157553848 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope ----------------- BACKTRACE: gdb xsltproc set args html/docbook.xsl tests/refentry.007.ns.xml set logging file backtrace.log set logging on run set logging off quit cat backtrace.log #0 0xb7e3d99a in __xmlRaiseError (schannel=0, channel=0, data=0x0, ctx=0x0, nod=0x8c835d8, domain=24, code=5011, level=XML_ERR_ERROR, file=0x0, line=0, str1=0x0, str2=0x0, str3=0x0, int1=0, col=0, msg=0xb7f29acb "Unknown node type %d\n") at error.c:515 #1 0xb7e865dd in xmlCtxtDumpOneNode (ctxt=0xbfd31858, node=0x8c835d8) at debugXML.c:171 #2 0xb7e87708 in xmlCtxtDumpNode (ctxt=0xbfd31858, node=0x14) at debugXML.c:1068 #3 0xb7e8777e in xmlCtxtDumpNodeList (ctxt=0xbfd31858, node=0x8c835d8) at debugXML.c:1089 #4 0xb7e8772a in xmlCtxtDumpNode (ctxt=0xbfd31858, node=0x8c895e0) at debugXML.c:1072 #5 0xb7e8777e in xmlCtxtDumpNodeList (ctxt=0xbfd31858, node=0x8c895e0) at debugXML.c:1089 #6 0xb7e8772a in xmlCtxtDumpNode (ctxt=0xbfd31858, node=0x8c723a0) at debugXML.c:1072 #7 0xb7e87add in xmlCtxtDumpDocument (ctxt=0xbfd31858, doc=<value optimized out>) at debugXML.c:1089 #8 0xb7e87b9d in xmlDebugCheckDocument__internal_alias (output=0xb7dd7560, doc=0x8c72338) at debugXML.c:1581 #9 0xb7e61121 in xmlFreeDoc__internal_alias (cur=0x8c72338) at tree.c:1192 #10 0xb7fe1be0 in xsltFreeStyleDocuments (style=0x830d980) at documents.c:239 #11 0xb7fcbbe2 in xsltFreeStylesheet (style=0x830d980) at xslt.c:947 #12 0x0804a50c in main (argc=3, argv=0xbfd31a64) at xsltproc.c:867 Starting program: /usr/bin/xsltproc html/docbook.xsl tests/refentry.007.ns.xml Program received signal SIGSEGV, Segmentation fault. 0xb7de399a in __xmlRaiseError (schannel=0, channel=0, data=0x0, ctx=0x0, nod=0x9aeb5d8, domain=24, code=5011, level=XML_ERR_ERROR, file=0x0, line=0, str1=0x0, str2=0x0, str3=0x0, int1=0, col=0, msg=0xb7ecfacb "Unknown node type %d\n") at error.c:515 515 error.c: No such file or directory. in error.c The complete output of xsltproc/gdb is attached. Does this help?
yep, this is much better, we just need to figure out what this "unknown node type" is now :)
I found the culprit, but I am not sure why this is happening. If I copy over /usr/lib/libxml2.so.2.7.2 from my notebook, everything is fine. CFLAGS there: CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer" If I do compile libxml2 with these flags, libxml2/xsltproc still segfaults. If I compile it w/o any march-argument in CFLAGS it segfaults, too. Same with march-native. I even did an "emerge -ave1 libxslt", but nothing changed (with my original CFLAGS). For now I have a workaround, but no real solution. Any suggestions?
Broken toolchain? Please try reemerging gcc, binutils, glibc,... This is really weird indeed Thanks
*** Bug 255355 has been marked as a duplicate of this bug. ***
I have the same problem, I analyzed backtrace and it seems to be debugging part of the libxml2 parser: #ifdef LIBXML_DEBUG_RUNTIME #ifdef LIBXML_DEBUG_ENABLED xmlDebugCheckDocument(stderr, cur); #endif #endif The workaround is to build libxml2 without debugging: USE='-debug' emerge libxml2
I ran a quick check after recompiling without the debuge-USE-flag and can confirm that. However, with dev-libs/libxml2-2.7.2-r2 with debug enabled the segfault is gone, but xsltproc still crashes with footnote</div></div></div></div></div></body></html> html/glossary.xsl:0: error : Unknown node type 49946480 html/math.xsl:5: element stylesheet: error : Reference to namespace 'mml' not in scope when run with 'xsltproc html/docbook.xsl tests/refentry.007.ns.xml' on the untared docbook-xsl-1.74.0-package. Without debug, it works.
It's frequently a very bad idea to have the debug USE flag enabled on a general use machine. For example, on many libraries, it turns on asserts that crash other packages regularly. You should probably only turn it on if you're a developer for some particular package, and probably only for that package. I certainly don't have it enabled on any of my machines. @gnome: Maybe we should remove debug from libxslt?
Daniel, I know. To be honest, I wondered myself how it got turned on. I think I forgot about it after getting the backtrace. Nevertheless, with debug on it crashes, without it works. So maybe the original-bug was fixed in the meantime? Another note.. I switched the machine and am running ~amd64 now. This includes the time of my last post.
I think we should have USE=debug for packages that enable anything beyond CFLAGS munging, like asserts that are not compiled in without it. On the other hand, many packages do nothing more than add -ggdb or the like to CFLAGS if passing --enable-debug. There we shouldn't have an USE=debug, as one should be using portage mechanisms for enabling debug symbols, as those support stuff like splitdebug, etc. libxslt is a former case. However in case of a package doing both with --enable-debug -- adding stuff to CFLAGS and enabling extra code, I'm not sure what to do about CFLAGS. Maybe the package should be patched to not touch CFLAGS and let portage and the user (make.conf) take care of that? Anyhow, this is a separate discussion not related to the bug at hand here.
(well, except for xslt crashing with debug on, and not with it off)
*** Bug 259537 has been marked as a duplicate of this bug. ***
libxslt-1.1.26 in portage, any progress with this bug? please retest.
try with EXTRA_ECONF="--without-mem-debug" USE="debug" emerge libxslt too if that makes any difference. The USE debug is controlling two flags.
*** Bug 260393 has been marked as a duplicate of this bug. ***
*** Bug 305831 has been marked as a duplicate of this bug. ***
(In reply to comment #16) > try with EXTRA_ECONF="--without-mem-debug" USE="debug" emerge libxslt too if > that makes any difference. The USE debug is controlling two flags. > I'm running into this bug today. I tried rebuilding libxslt, but that does not make a difference for me.
(In reply to comment #19) > (In reply to comment #16) > > try with EXTRA_ECONF="--without-mem-debug" USE="debug" emerge libxslt too if > > that makes any difference. The USE debug is controlling two flags. > > > > I'm running into this bug today. I tried rebuilding libxslt, but that does not > make a difference for me. > Found a solution, for me at least. Re-emerged app-text/docbook-xml-dtd and now sys-auth/polkit emerges successfully. At last.
Had the same problem Tried recompiling libxslt, no go. Upgraded to libxml2-2.7.7 and it seems to work now.
*** Bug 321977 has been marked as a duplicate of this bug. ***
*** Bug 344883 has been marked as a duplicate of this bug. ***
(In reply to comment #21) > Had the same problem > Tried recompiling libxslt, no go. > Upgraded to libxml2-2.7.7 and it seems to work now. > Is this solved then with libxml2-2.7.7 ? :-/
(In reply to comment #24) > (In reply to comment #21) > > Had the same problem > > Tried recompiling libxslt, no go. > > Upgraded to libxml2-2.7.7 and it seems to work now. > > > > Is this solved then with libxml2-2.7.7 ? :-/ >