NTIA / gr-ltetrigger

GNU Radio out-of-tree module for triggering on LTE signal
Other
14 stars 13 forks source link

Fails to Build: libgnuradio-ltetrigger.so: undefined reference to .... #8

Open Sout opened 6 years ago

Sout commented 6 years ago

-- The CXX compiler identification is GNU 8.1.1 -- The C compiler identification is GNU 8.1.1 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Build type not specified: defaulting to release. -- Boost version: 1.67.0 -- Found the following Boost libraries: -- filesystem -- system -- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") -- SRSLTE LIBRARIES: /lib/libsrslte_rf.so/lib/libsrslte_common.a -- SRSLTE INCLUDE DIRS: /usr/local/include -- Found SRSLTE: /lib/libsrslte_rf.so;/lib/libsrslte_common.a
-- Checking for module 'cppunit' -- Found cppunit, version 1.14.0 -- Found CPPUNIT: /usr/lib/libcppunit.so;dl
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.14") found components: doxygen missing components: dot Checking for GNU Radio Module: RUNTIME -- Checking for module 'gnuradio-runtime' -- Found gnuradio-runtime, version 3.7.11

srslte: Version 18.03.1 (tried it on head and still got the same error) gr-ltetrigger: Current Head. 5b46bd85450f54a3889a6fb3ef2ac3fe0d81d551 Os: Arch (I'm sure i manged to screw something up)

--- Sout

djanderson commented 6 years ago

Thanks for the report! srsLTE somewhat recently moved some code around and this might be related. I'll take a look.

Sout commented 6 years ago

So i THINK(never played around with cmake before so i could be doing something terribly wrong). I have a fix. see https://github.com/Sout/gr-ltetrigger/tree/cmake-fix Essentially link to srslte_py and fftw

djanderson commented 6 years ago

Looks good. I've often had to add/modify Find*.cmake files so I'm not surprised you have to do that on Arch (we've only tested on Ubuntu). If you'd like to create a PR I'll make sure there are no regressions on our setup and merge it in.

Sout commented 6 years ago

Hmm. Well progress. CMake files seem to work. However it know segfaults on the qa tests (down_link_trigger).

Starting program: /usr/bin/python2 ./cell_search_file.py --sample-rate 1.92M ../test_frames/lte_frame_6prb_cellid_123 --repeat --time-out 1 [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Starting cell search... [New Thread 0x7fffe8058700 (LWP 23173)] [New Thread 0x7fffe7857700 (LWP 23174)] [New Thread 0x7fffe7056700 (LWP 23175)] [New Thread 0x7fffe6855700 (LWP 23176)] [New Thread 0x7fffe6054700 (LWP 23177)] [New Thread 0x7fffe5853700 (LWP 23178)] [New Thread 0x7fffe5052700 (LWP 23179)] [New Thread 0x7fffe4851700 (LWP 23180)] [New Thread 0x7fffbffff700 (LWP 23181)] [New Thread 0x7fffc7fff700 (LWP 23182)] [New Thread 0x7fffc77fe700 (LWP 23183)] [New Thread 0x7fffc6ffd700 (LWP 23184)] [New Thread 0x7fffc67fc700 (LWP 23185)] [New Thread 0x7fffc5ffb700 (LWP 23186)]

Thread 14 "mib11" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffc67fc700 (LWP 23185)] 0x00007ffff789f017 in memcpy@GLIBC_2.2.5 () from /usr/lib/libc.so.6 (gdb) bt

0 0x00007ffff789f017 in memcpy@GLIBC_2.2.5 () from /usr/lib/libc.so.6

1 0x00007fffe845a9b4 in prb_cp_ref () from /usr/lib/libgnuradio-ltetrigger.so

2 0x00007fffe8458e9e in srslte_pbch_cp () from /usr/lib/libgnuradio-ltetrigger.so

3 0x00007fffe8459d75 in srslte_pbch_decode () from /usr/lib/libgnuradio-ltetrigger.so

4 0x00007fffe847cc36 in srslte_ue_mib_decode () from /usr/lib/libgnuradio-ltetrigger.so

5 0x00007fffe8451f70 in gr::ltetrigger::mib_impl::general_work(int, std::vector<int, std::allocator >&, std::vector<void const, std::allocator<void const> >&, std::vector<void, std::allocator<void> >&) ()

from /usr/lib/libgnuradio-ltetrigger.so

6 0x00007ffff5010bb2 in gr::block_executor::run_one_iteration() () from /usr/lib/libgnuradio-runtime-3.7.11.so.0.0.0

7 0x00007ffff5053ce2 in gr::tpb_thread_body::tpb_thread_body(boost::shared_ptr, int) ()

from /usr/lib/libgnuradio-runtime-3.7.11.so.0.0.0

8 0x00007ffff5047005 in ?? () from /usr/lib/libgnuradio-runtime-3.7.11.so.0.0.0

9 0x00007ffff4ffb372 in ?? () from /usr/lib/libgnuradio-runtime-3.7.11.so.0.0.0

10 0x00007ffff3849cd7 in ?? () from /usr/lib/libboost_thread.so.1.67.0

11 0x00007ffff7bc1075 in start_thread () from /usr/lib/libpthread.so.0

12 0x00007ffff78f653f in clone () from /usr/lib/libc.so.6

What version of srslte do you use? (will trying that to build to make sure it is nothing wierd there)

Sout commented 6 years ago

So i think i found the source of my segfault (it is in srsLTE)

srslte_pbch_cp (input=0x7fffa000f000, output=0x7fffa0003a00, cell=..., put=false) 

(note the input and output) after which

input+= cell.nof_prb * SRSLTE_NRE / 2 - 36; 

happens. This shuld equal to input += cell.nof_prb * SRSLTE_NRE / 2 - 36; This should be be -36 (with cell.nof_prb = 0 and SRSLTE_NRE = 12) How ever due to a cell.nof_prb being cast. it ends up being. 4294967260. Thus

(gdb) p input
$24 = (cf_t *) 0x8007a000eee0

and results in a segfault. Hopefully this is also reproduceable for you and not a sign that sumthing is really wrong with my Install --- Sout

djanderson commented 6 years ago

Our last build was against srsLTE before they shuffled code around. I'm pretty sure I saw this error when I updated the cmake stuff a little while back.

Sorry for the slow responses here, I've been pretty pinned down for the last few weeks and am booked up for the next week, but I'll be picking this up at that time. Thanks for the debugging!

Sout commented 5 years ago

So i come bearing good news. I think i have it working / fixed See b634ea47708b1f76f1bd29853291eb7df25e0a9f (note the commit comments).