Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532088 - dev-libs/lzo-2.08: remove
Summary: dev-libs/lzo-2.08: remove
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: Sparc Linux
: Normal normal (vote)
Assignee: Michał Górny
Depends on: 612872
Blocks: unaligned-access
  Show dependency tree
Reported: 2014-12-09 22:00 UTC by Guido Winkelmann
Modified: 2017-05-28 23:32 UTC (History)
1 user (show)

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

Patch for lzo-2.08 that fixes undefined behavior causing crashes on strictly aligned architectures. (lzo-2.08_alignment_fix.patch,3.61 KB, patch)
2015-01-31 20:39 UTC, David Mattli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Winkelmann 2014-12-09 22:00:41 UTC
net-misc/openvpn-2.3.6 crashes shortly after startup with a Bus error.

To reproduce:

# /etc/init.d/openvpn start

wait a few seconds

# /etc/init.d/openvpn status
 * status: crashed

I have tried starting openvpn on the command line with the same line that the init script will use to start it (except for the --daemon flag). These are the results:

/usr/sbin/openvpn --config /etc/openvpn/openvpn.conf --writepid /var/run/ --setenv SVCNAME openvpn --cd /etc/openvpn --user openvpn --group openvpn --setenv PEER_DNS yes
Tue Dec  9 22:38:46 2014 OpenVPN 2.3.6 sparc-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Dec  6 2014
Tue Dec  9 22:38:46 2014 library versions: OpenSSL 1.0.1j 15 Oct 2014, LZO 2.08
Tue Dec  9 22:38:46 2014 WARNING: you are using user/group/chroot/setcon without persist-tun -- this may cause restarts to fail
Tue Dec  9 22:38:46 2014 WARNING: you are using user/group/chroot/setcon without persist-key -- this may cause restarts to fail
Tue Dec  9 22:38:49 2014 TUN/TAP device tun0 opened
Tue Dec  9 22:38:49 2014 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Dec  9 22:38:49 2014 /bin/ip link set dev tun0 up mtu 1500
Tue Dec  9 22:38:49 2014 /bin/ip addr add dev tun0 local peer
Tue Dec  9 22:38:49 2014 GID set to openvpn
Tue Dec  9 22:38:49 2014 UID set to openvpn
Tue Dec  9 22:38:49 2014 UDPv4 link local (bound): [undef]
Tue Dec  9 22:38:49 2014 UDPv4 link remote: [undef]
Tue Dec  9 22:38:49 2014 ifconfig_pool_read(), in='adams,', TODO: IPv6
Tue Dec  9 22:38:49 2014 succeeded -> ifconfig_pool_set()
Tue Dec  9 22:38:49 2014 Initialization Sequence Completed
Bus error

No core dumps were created, even though I did "ulimit -c unlimited" before.

The crashes did not happen with version 2.3.3.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-10 09:09:12 UTC
You wouldn't get a coredump because this is not a segmentation fault. A SIGBUS on SPARC could be caused by an unaligned memory access, which is probably what this will turn out to be.

dmesg should tell you why the SIGBUS occurred.

Please post your `emerge --info =net-misc/openvpn-2.3.6' output in a comment.
Comment 2 Guido Winkelmann 2014-12-23 01:06:40 UTC
> dmesg should tell you why the SIGBUS occurred.

No, there is no dmesg output after the crash.

> Please post your `emerge --info =net-misc/openvpn-2.3.6' output in a comment.

# emerge --info =net-misc/openvpn-2.3.6
Portage 2.2.8-r2 (default/linux/sparc/13.0, gcc-4.7.3, glibc-2.19-r1, 3.5.7-gentoo sparc64)
                        System Settings
System uname: Linux-3.5.7-gentoo-sparc64-sun4u-with-gentoo-2.2
KiB Mem:     4153824 total,   1895768 free
KiB Swap:    4194296 total,   4173016 free
Timestamp of tree: Tue, 23 Dec 2014 01:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.7, 3.3.5-r1, 3.4.1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.12.6, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo x-portage
CFLAGS="-O2 -mcpu=ultrasparc -pipe"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=ultrasparc -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="acl apache2 bash-completion berkdb bzip2 cli cracklib crypt ctype curl curlwrappers cxx ddate dlz dri fortran gcc64 gd gdbm git iconv imap iproute2 ipv6 json kolab ldap lzma modules ncurses nls nptl openmp pam pcre perl postgres python readline sasl session sieve sparc ssl subversion svnserve tcpd unicode xml zip zlib" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 sheets stage tables krita karbon braindump author" CAMERAS="ptp2" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga r128 radeon sunbw2 suncg14 suncg3 suncg6 sunffb sunleo tdfx dummy v4l" 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"

                        Package Settings

net-misc/openvpn-2.3.6 was built with the following:
USE="iproute2 lzo pam plugins ssl -down-root -examples -passwordsave (-pkcs11) (-polarssl) (-selinux) -static -systemd"
Comment 3 Guido Winkelmann 2015-01-10 00:14:18 UTC
Upstream bug report:

It appears the bug is actually in LZO. Unfortunately, I have no idea how to produce a reduced test case for LZO that can reproduce the crash...
Comment 4 David Mattli 2015-01-31 20:39:21 UTC
Created attachment 395266 [details, diff]
Patch for lzo-2.08 that fixes undefined behavior causing crashes on strictly aligned architectures.

The problem is definitely in lzo. The library attempts an unaligned load halfword in lzo-2.08/src/lzo_init.c. The compiler emits the offending instruction because lzo provokes undefined behavior in the functions to load and store integers at arbitrary, potentially unsigned addresses.

In particular, lzo_memops_get_ne16, lzo_memops_get_ne32, lzo_memops_put_ne16, and lzo_memops_put_ne32 attempt to access an int through a pointer cast to a struct.

To test this conclusion I've implemented a fix that reimplements those functions with endian-neutral alternatives. These should work on any architecture. I've tested them on amd64 and sparc.

I've written the author of the library with my findings and I'll update when I hear from him.
Comment 5 David Mattli 2015-02-11 12:28:36 UTC
The LZO author informed me that he's implemented a workaround that is included in the 2.09 release. 

With 2.09 "make test" now runs successfully.

So this problem should be resolved once the LZO version is bumped. Which I've requested here:
Comment 6 Manuel Rüger (RETIRED) gentoo-dev 2016-07-09 14:00:33 UTC
dev-libs/lzo-2.09 is in tree now. Will keep open until 2.08 has been removed.
Comment 7 Manuel Rüger (RETIRED) gentoo-dev 2017-05-02 14:22:15 UTC
Keywords for dev-libs/lzo:
        |                                 |   u   |  
        | a a         p s   a     n r     |   n   |  
        | l m   h i   p p   r m m i i s   | e u s | r
        | p d a p a p c a x m i 6 o s 3   | a s l | e
        | h 6 r p 6 p 6 r 8 6 p 8 s c 9 s | p e o | p
        | a 4 m a 4 c 4 c 6 4 s k 2 v 0 h | i d t | o
   2.08 | + + + + + + + + + + ~ + o o + + | 5 o 2 | gentoo
[I]2.09 | + + + + + + + + + + ~ ~ o o ~ ~ | 5 o   | gentoo
   2.10 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ o o ~ ~ | 6 o   | gentoo

Mgorny, okay to remove it?
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-05-02 14:52:35 UTC
Sure, kill it with fire ;-).
Comment 9 Matt Turner gentoo-dev 2017-05-28 23:32:24 UTC