# Dynamic\_cast on ARM Android

**URL:** <https://www.ruby-forum.com/t/dynamic-cast-on-arm-android/209308>\
**Category:** GNU Radio\
**Created:** [July 11, 2011, 12:16pm UTC](https://www.ruby-forum.com/t/dynamic-cast-on-arm-android/209308 "2011-07-11T12:16:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [July 11, 2011, 12:16pm UTC](https://www.ruby-forum.com/t/dynamic-cast-on-arm-android/209308/1 "2011-07-11T12:16:03Z")

</div>

Hi all,

I tried to run gnuradio in order to decode DAB+ form a file on an ARM  
Cortex-A8 (OMAP 3) with Android. I translated the specific Python code  
to C++ and used gnu libstdc++ with boost. I connected the blocks using  
the method connect of gr\_hier\_block and gr\_top\_block.

The result is SIGSEGV in dynamic\_cast when connecting blocks. The exact  
line should be: gnuradio-core/src/lib/runtime/gr\_sptr\_magic.cc:54:

```
gr_hier_block2 *hb2 = dynamic_cast<gr_hier_block2 *>(p);

```

Did you find such a problem before? How to solve it? My idea is to  
rewrite bock connections without dynamic\_cast.

The exact gdb output is:  
0x0036ab4a in \_\_cxxabiv1::\_\_dynamic\_cast (src\_ptr=0x3e0b80,  
src\_type=, dst\_type=0x3c9af0, src2dst=) at /tmp/ndk-digit/src/build/…/gcc/gcc-4.4.3/libstdc  
+±v3/libsupc++/dyncast.cc:47  
47 /tmp/ndk-digit/src/build/…/gcc/gcc-4.4.3/libstdc+±v3/libsupc  
++/dyncast.cc: No such file or directory.  
in /tmp/ndk-digit/src/build/…/gcc/gcc-4.4.3/libstdc+±v3/libsupc  
++/dyncast.cc

The backtrace is:  
(gdb) bt  
#0 0x0036ab4a in \_\_cxxabiv1::\_\_dynamic\_cast (src\_ptr=0x3e0b80,  
src\_type=, dst\_type=0x3c9af0, src2dst=) at /tmp/ndk-digit/src/build/…/gcc/gcc-4.4.3/libstdc  
+±v3/libsupc++/dyncast.cc:47  
#1 0x000da704 in gnuradio::detail::sptr\_magic::fetch\_initial\_sptr  
(p=0x3e0b80)  
at  
/home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/gnuradio-core/src/lib/runtime/gr\_sptr\_magic.cc:54  
#2 0x0002a824 in gnuradio::get\_initial\_sptr (p=0x3e0b80)  
at  
/home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/gnuradio-core/src/lib/runtime/gr\_sptr\_magic.h:47  
#3 0x00028ce8 in dab\_make\_null\_detect (length=2656, debug=false)  
at  
/home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/python/detect\_null.cpp:25  
#4 0x0001cfc0 in OfdmDemod::OfdmDemod (this=0x3dc408,  
dab\_params=0x3dc328, rx\_params=0x3dc3c0, verbose=true, debug=true)  
at /home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/python/ofdm.cpp:92  
#5 0x00017474 in dab\_make\_ofdm\_demod (dab\_params=0x3dc328,  
rx\_params=0x3dc3c0, verbose=true, debug=true)  
at /home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/python/ofdm.cpp:24  
#6 0x0000f878 in dab\_rx\_main ()  
at  
/home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/python/dab\_rx\_constellation.cpp:93  
#7 0x0000e780 in thread\_entry (data=0x0)  
at  
/home/riadh/dev/p8/trunk/soft/Didon/Soft/Sources/main/didon\_main.cpp:82  
#8 0x00352584 in thread\_header (data=0x3d401c)  
at  
/home/riadh/dev/p8/trunk/soft/CommonSoft/ParrotOS/core/src/posix/posix\_thread.c:353  
#9 0xafe0fe34 in \_\_thread\_entry (func=0x3523e8 \<thread\_header\>,  
arg=0x3d401c, tls=) at  
bionic/libc/bionic/pthread.c:188  
#10 0xafe0f900 in pthread\_create (thread\_out=,  
attr=0x78, start\_routine=0x3523e8 \<thread\_header\>, arg=0x3d401c) at  
bionic/libc/bionic/pthread.c:324  
#11 0x00000000 in ?? ()

Best reagrds,

Riadh.

---

<div class="post-metadata">

**Author:** ![Riadh\_Elloumi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4491bb/32.png) [@Riadh\_Elloumi](https://www.ruby-forum.com/u/Riadh_Elloumi)\
**Post date:** [July 13, 2011, 10:45am UTC](https://www.ruby-forum.com/t/dynamic-cast-on-arm-android/209308/2 "2011-07-13T10:45:44Z")

</div>

Hi all,

It was a bug of mine. I should have used self() for interconnecting  
blocks in gr\_hier\_block2 rather than gnuradio::get\_initial\_sptr (this).

Best reagrds,

Riadh.
