Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 391185

Summary: =dev-python/utidylib-0.2-r1 - src_test(): Segmentation fault in trial
Product: Gentoo Linux Reporter: Jonathan Lovelace <kingjon3377>
Component: [OLD] UnspecifiedAssignee: Python Gentoo Team <python>
Status: RESOLVED OBSOLETE    
Severity: normal CC: mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log
gdb log showing context and backtrace
Ebuild switching to a fork including patches to make tests pass
updated patch to apply to more recent source

Description Jonathan Lovelace 2011-11-21 02:21:39 UTC
dev-python/utidylib-0.2-r1 fails its first test with a segmentation fault.

Reproducible: Always

Steps to Reproduce:
FEATURES=test emerge -1v =dev-python/utidylib-0.2-r1

Actual Results:  
First test fails with a segmentation fault.

Expected Results:  
All tests pass (or at least complete ...)

I'll attach my build log momentarily.

emerge --info:
Portage 2.1.10.11 (hardened/linux/amd64, gcc-4.5.3, glibc-2.11.3-r0, 3.0.4-hardened-r4 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.0.4-hardened-r4-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T6670_@_2.20GHz-with-gentoo-2.0.3
Timestamp of tree: Sun, 20 Nov 2011 17:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.11.3
Repositories: sunrise gentoo-haskell seden gamerlay-stable local eclipse g-cpan hackport_laptop gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=core2"
CHOST="x86_64-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 /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -mtune=core2"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests binpkg-logs collision-protect compress-build-logs distlocks ebuild-locks fakeroot fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://mirrors.rit.edu/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="C"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US"
MAKEOPTS="-j2 -l5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/usr/portage/local/layman/sunrise /usr/portage/local/layman/haskell /usr/portage/local/layman/seden /usr/portage/local/layman/gamerlay /usr/local/portage /usr/portage/local/layman/eclipse /usr/portage/local/layman/g-cpan /usr/portage/local/layman/hackport /usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 bash-completion berkdb bluetooth bzip2 caps cracklib crypt cxx dri gdbm gpm hardened iconv ipv6 jpeg justify libnotify lm_sensors mmx modules mudflap multilib ncurses nls nptl nptlonly ogg openmp pam pax_kernel pcre png policykit pppd readline session speex sse sse2 sse3 ssl ssse3 startup-notification sysfs tcpd theora truetype udev unicode urandom vorbis xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="all" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" NETBEANS_MODULES="apisupport ergonomics cnd harness ide java nb ruby" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jonathan Lovelace 2011-11-21 02:22:15 UTC
Created attachment 293255 [details]
Build log
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2011-12-01 19:30:07 UTC
I can't replicate this.

gentoo64 utidylib # el
Available Python interpreters:
  [1]   python2.5
  [2]   python2.6
  [3]   python2.7 *
gentoo64 utidylib # ebuild utidylib-0.2-r1.ebuild clean test
warning: build_py: byte-compiling is disabled, skipping.

>>> Source compiled.
 * Testing of dev-python/utidylib-0.2-r1 with CPython 2.7...
PYTHONPATH=build-2.7/lib trial tidy
tidy.test_tidy
  TidyTestCase
    test_badOptions ...                                                    [OK]
    test_encodings ...                                                     [OK]
    test_errors ...                                                        [OK]
    test_options ...                                                       [OK]
    test_parse ...                                                         [OK]

a seg fault could be something quite erroneous in your system.  Try unmerging, re-emerging, ensure your system has been fsck'd.  The easiest way to avoid that is to make your $PORTAGE_TMPDIR on a different partition. I doubt this is a bug
Comment 3 Jonathan Lovelace 2011-12-06 03:29:50 UTC
utidylib isn't previously installed on my system, so I can't unmerge it. But I've unmerged and re-emerged htmltidy (according to dmesg, the segfault comes somewhere in libtidy-0.99.so.0.0.0, installed by htmltidy). I've marked my root FS to fsck on my next reboot, but I also confirmed this with PORTAGE_TMPDIR on a tmpfs. 

I note that htmltidy's test phase doesn't seem to actually do anything; could this be a bug in htmltidy that utidylib just exposes?

Another possibly-relevant detail is that I'm running a hardened system.
Comment 4 Jonathan Lovelace 2011-12-22 00:12:11 UTC
Created attachment 296615 [details]
gdb log showing context and backtrace

I've rebuilt python:2.7 and htmltidy with CFLAGS=-ggdb and FEATURES="splitdebug installsources", and produced the segfault in gdb. I attach a log showing the immediate context and the backtrace.
Comment 5 Jonathan Lovelace 2012-02-18 20:18:24 UTC
Created attachment 302435 [details]
Ebuild switching to a fork including patches to make tests pass

I found a fork of the project on Github, where someone took the most recent upstream sources and applied all the patches in the upstream bug tracker; after fiddling with one of the patches in the Portage tree to make it apply cleanly again (mainly whitespace issues), the tests pass. I've attach the updated ebuild  here, and will upload the updated fix_tests.patch momentarily (no-docs-in-site-packages.patch needs no changes).
Comment 6 Jonathan Lovelace 2012-02-18 20:19:49 UTC
Created attachment 302437 [details, diff]
updated patch to apply to more recent source
Comment 7 Patrice Clement gentoo-dev 2016-10-12 15:20:19 UTC
This package should be last rited as it relies on an old version of htmltidy.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-20 21:29:58 UTC
0.3-r2 doesn't seem to use trial anymore.