https://osmocom.org/https://osmocom.org/favicon.ico?16647414092019-02-21T15:27:38ZOpen Source Mobile Communicationslibosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134202019-02-21T15:27:38Zmsuraev
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134212019-02-21T15:31:21Zmsuraev
<ul></ul><p>Can you attach your config.log? I'm unable to reproduce this yet.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134242019-02-21T15:50:34Zmsuraev
<ul></ul><p>Also, please add output of "ldd ./tests/stream/stream_test" - I'm unable to reproduce this on your office box under my user so it could be smth specific to your build.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134262019-02-21T16:25:47Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>ldd uncovered the cause:</p>
<p>In a successful run, stream_test links libosmo-netif.so from the build tree.<br />In a failing run, stream_test links a libosmo-netif.so from /usr/local/lib.</p>
<p>The only difference between a succesful and a failing run, from the same build tree, is:<br />in a failing run, env contains LD_LIBRARY_PATH=/usr/local/lib</p>
<p>Somehow, setting LD_LIBRARY_PATH changes the preference of which library gets linked.<br />It should <strong>always</strong> link the library just now built in the source tree, regardless of the environment variables.<br />Instead, pointing an LD_LIBRARY_PATH to /usr/local/lib makes it prefer the installed library.</p>
<p>We need to find a way to use the build-tree library even if LD_LIBRARY_PATH is set.<br />Why? Consider a user is installing to a custom ~/prefix/lib, then merely passing LD_LIBRARY_PATH pointing there would break the build.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134272019-02-21T16:35:29Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>How to reproduce:</p>
<p>- build and install libosmo-netif tag 0.4.0<br />- export LD_LIBRARY_PATH=/usr/local/lib<br />- 'make check' in current master of libosmo-netif (fe3527da2ac691c961f767c97d70bfe00d1e4d10)</p>
<p>The combination of an older library installed and the LD_LIBRARY_PATH in the env causes the test failure.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134282019-02-21T16:36:04Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Priority</strong> changed from <i>Immediate</i> to <i>Normal</i></li></ul><p>A workaround is to remove the system-installed libosmo-netif, hence downgrading priority</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134302019-02-21T16:50:21Zmsuraev
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Low</i></li></ul><blockquote>
<p>The combination of an older library installed and the LD_LIBRARY_PATH in the env causes the test failure.</p>
</blockquote>
<p>Note: this might happen with any test in any of osmocom projects. In general I think the "solution" would be to not use LD_LIBRARY_PATH together with 'make check'. We should double-check with libtool docs to see how it's meant to interact with LD_LIBRARY_PATH.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134392019-02-23T12:52:44Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>msuraev wrote:</p>
<blockquote>
<p>I think the "solution" would be to not use LD_LIBRARY_PATH together with 'make check'. We should double-check with libtool docs to see how it's meant to interact with LD_LIBRARY_PATH.</p>
</blockquote>
<p>That's a workaround. If the user needs to adjust the environment to be able to find installed library files and is then unable to do 'make check', your workaround doesn't work.<br />A solution would be something that allows setting whichever LD_LIBRARY_PATH and still have 'make check' work.<br />I'd prefer a way to make Makefile.am stronger than LD_LIBRARY_PATH, but in some projects, instead of linking library files, we directly compile .c files into the test binary.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=134402019-02-23T12:53:26Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Assignee</strong> deleted (<del><i>msuraev</i></del>)</li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li></ul> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=135562019-03-13T13:23:18Zosmith
<ul><li><strong>File</strong> <a href="/attachments/3591">log.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3591/log.txt">log.txt</a> added</li></ul><p>I ran into this issue even <strong>without having LD_LIBRARY_PATH set</strong>. Here is how to reproduce it, run this script in the local libosmo-netif.git checkout.</p>
<pre>
#!/bin/sh -ex
: make distclean
env
git checkout 0fe9b3664a8d0b74d5e1c67593b350d67de3f98f # previous commit
autoreconf -fi
./configure
make clean
make check
make install
git checkout fa7df8726001146c902d3a93e2a4b425fa9024b0 # current master
autoreconf -fi
./configure
make clean
make check
</pre>
<p>The second "make check" fails, full output is attached.</p>
<p>testsuite.log contains:<br /><pre>
5. testsuite.at:29: testing amr_test ...
./testsuite.at:32: $abs_top_builddir/tests/amr/amr_test
stderr:
/home/user/code/osmo-dev/src/libosmo-netif/tests/amr/.libs/amr_test: symbol lookup error: /home/user/code/osmo-dev/src/libosmo-netif/tests/amr/.libs/amr_test: undefined symbol: osmo_amr_oa_to_bwe
</pre></p>
<p>ldd shows that everything links against /usr/local/lib:<br /><pre>
$ ldd tests/amr/.libs/amr_test
linux-vdso.so.1 (0x00007ffcc8d11000)
libtalloc.so.2 => /usr/lib/x86_64-linux-gnu/libtalloc.so.2 (0x00007fa3a203d000)
libosmogsm.so.11 => /usr/local/lib/libosmogsm.so.11 (0x00007fa3a1ddb000)
libosmocore.so.12 => /usr/local/lib/libosmocore.so.12 (0x00007fa3a1bb2000)
libosmonetif.so.6 => /usr/local/lib/libosmonetif.so.6 (0x00007fa3a19a2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3a1603000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa3a13ff000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fa3a1066000)
libsctp.so.1 => /usr/lib/x86_64-linux-gnu/libsctp.so.1 (0x00007fa3a0e63000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3a2455000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa3a0c49000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fa3a09e4000)
libidn.so.11 => /lib/x86_64-linux-gnu/libidn.so.11 (0x00007fa3a07b0000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fa3a059d000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fa3a0366000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fa3a0131000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fa39feae000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fa39fca5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa39fa88000)
</pre></p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=135572019-03-13T13:56:04Zosmith
<ul></ul><p>It turns out, that at least in Debian 9, the following file exists by default:<br /><pre>
$ sudo cat /etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib
</pre></p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=135582019-03-13T14:08:36Zmsuraev
<ul></ul><p>I'm not sure it's actually related: I've got problem with amr-test despite not having anything in /usr/local/lib on ubuntu.<br />And adding "amr_amr_test_LDFLAGS = -no-install" to tests/Makefile.am fixed it for me. The same flag is used with stream tests so I think it's entirely different issue.</p> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=135592019-03-13T14:09:06Zmsuraev
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Stalled</i></li></ul> libosmo-netif - Bug #3812: stream_test fails depending on where it is runhttps://osmocom.org/issues/3812?journal_id=135602019-03-13T16:15:19Zosmith
<ul></ul><p><a class="user active" href="https://osmocom.org/users/119">msuraev</a>: using -noinstall fixes it for me too, created a patch: <a class="external" href="https://gerrit.osmocom.org/#/c/libosmo-netif/+/13241">https://gerrit.osmocom.org/#/c/libosmo-netif/+/13241</a></p>
<p>You are right, then the stream_test issue is a completely different one.</p>