On Sun, 07 Sep 2014 at 13:58:40 +0200, Marc Kleine-Budde wrote:
> BTW: even "lzop" fails with the new liblzo library:
> 
> $ lzop
>                           Lempel-Ziv-Oberhumer Packer
>                            Copyright (C) 1996 - 2010
> lzop v1.03         Markus Franz Xaver Johannes Oberhumer          Nov
> 1st 2010
> 
> lzo_init() failed - check your LZO installation !

This bit me on a recently-upgraded jessie system where I'm somewhat
reliant on openvpn, so after working around it by downgrading liblzo2-2
to the wheezy-security version, I looked further into it.

You don't actually need to build packages at all: the same failure occurs
in a freshly compiled lzo2 tree (just ./configure && make) using
"LD_LIBRARY_PATH=src/.libs gdb lzop", "run".

When rebuilt with CFLAGS="-O0 -g" it works. So, some optimization is
to blame for this.

When rebuilt with CFLAGS="-Og -g" it fails, and this time it's possible
to see *where* it fails, because the assignment to r isn't optimized out:

(gdb) break _lzo_config_check
...
_lzo_config_check () at src/lzo_init.c:100
(gdb) watch r
(gdb) s
...
_lzo_config_check () at src/lzo_init.c:117
117         r &= UA_GET_NE16(p) == 0;
(gdb) 
lzo_memops_get_ne16 (ss=0xbefff1f1) at src/lzo_func.h:387
387         LZO_MEMOPS_COPY2(&v, ss);
(gdb) 
Watchpoint 4: r

Old value = 1
New value = 0

My next try was CPPFLAGS="-DLZO_CFG_NO_UNALIGNED" to stop lzo doing
"clever" pointer dereferences in LZO_MEMOPS_COPY2, and sure enough,
that works. So we have a workaround: define that macro on at least armel.
It might slow lzo2 down, but working slowly is better than failing rapidly.
(My next idea was -fno-strict-aliasing, but unfortunately that didn't work.)

This optimization stuff made me suspicious about new compiler optimizations
since wheezy's (working) lzo2 was compiled. It's getting late now, but the
next thing I try is going to be rebuilding wheezy's lzo2 on a jessie system
to see whether it has the same failure conditions.

I'd really like to see this fixed in jessie; I'm tempted to say it
should be RC. I'll try to produce and test a complete patch, either
using CPPFLAGS="-DLZO_CFG_NO_UNALIGNED" on armel or preferably turning off
some specific optimization.

Hope this helps,
    S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to