Forum: GNU Radio Problems with buffer allocation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alvaro P. (Guest)
on 2009-01-28 17:00
(Received via mailing list)
Hello,

continuing with my attempt of building a block that manages two vectors
in the input ports (one of 30 char and another one of 432 char), and one
vector in the output of 510 char, I get the error  message that I attach
at the bottom of the email when I run the complete waveform where it is
included.

I have taken a look into gr_buffer.h but I don't really understand what
it is going on.

Does anybody recognise this problem or had it before?

Thank you in advance.

Alvaro P.


gr_buffer::allocate_buffer: warning: tried to allocate
   75 items of size 432. Due to alignment requirements
   256 were allocated.  If this isn't OK, consider padding
   your structure to a power-of-two bytes.
   On this platform, our allocation granularity is 4096 bytes.
gr_buffer::allocate_buffer: warning: tried to allocate
   64 items of size 510. Due to alignment requirements
   2048 were allocated.  If this isn't OK, consider padding
   your structure to a power-of-two bytes.
   On this platform, our allocation granularity is 4096 bytes.
*** stack smashing detected ***: python terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7eb4558]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7eb4510]
/usr/local/lib/libgnuradio-core.so.0[0xb7bf2674]
/usr/local/lib/libgnuradio-core.so.0[0xb7b75ea7]
/usr/local/lib/libgnuradio-core.so.0(_ZN13gr_sync_block12general_workEiRSt6vectorIiSaIiEERS0_IPKvSaIS5_EERS0_IPvSaIS9_EE+0x3a)[0xb7be999a]
/usr/local/lib/libgnuradio-core.so.0(_ZN28gr_single_threaded_scheduler9main_loopEv+0x13c6)[0xb7be8226]
/usr/local/lib/libgnuradio-core.so.0(_ZN28gr_single_threaded_scheduler3runEv+0x1d)[0xb7be862d]
/usr/local/lib/libgnuradio-core.so.0(_ZN19gr_scheduler_thread14run_undetachedEPv+0xb2)[0xb7be63a2]
/usr/local/lib/libgromnithread.so.0(omni_thread_wrapper+0x81)[0xb7a85dc1]
/lib/tls/i686/cmov/libpthread.so.0[0xb7f4d50f]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7e9b7ee]
======= Memory map: ========
08048000-08144000 r-xp 00000000 08:06 1665010    /usr/bin/python2.5
08144000-08145000 r--p 000fb000 08:06 1665010    /usr/bin/python2.5
08145000-0816a000 rw-p 000fc000 08:06 1665010    /usr/bin/python2.5
0816a000-08170000 rw-p 0816a000 00:00 0
0956e000-0988c000 rw-p 0956e000 00:00 0          [heap]
b5500000-b5521000 rw-p b5500000 00:00 0
b5521000-b5600000 ---p b5521000 00:00 0
b562b000-b562c000 ---p b562b000 00:00 0
b562c000-b5e2c000 rw-p b562c000 00:00 0
b5e2c000-b5e2d000 r--s 00000000 00:09 42008716   /SYSV00000000 (deleted)
b5e2d000-b5e35000 rw-s 00000000 00:09 42074255   /SYSV00000000 (deleted)
b5e35000-b5e3d000 rw-s 00000000 00:09 42074255   /SYSV00000000 (deleted)
b5e3d000-b5e3e000 r--s 00000000 00:09 42008716   /SYSV00000000 (deleted)
b5e3e000-b5e3f000 r--s 00000000 00:09 41910410   /SYSV00000000 (deleted)
b5e3f000-b5e47000 rw-s 00000000 00:09 41975949   /SYSV00000000 (deleted)
b5e47000-b5e4f000 rw-s 00000000 00:09 41975949   /SYSV00000000 (deleted)
b5e4f000-b5e50000 r--s 00000000 00:09 41910410   /SYSV00000000 (deleted)
b5e50000-b5e51000 r--s 00000000 00:09 41812104   /SYSV00000000 (deleted)
b5e51000-b5e59000 rw-s 00000000 00:09 41877643   /SYSV00000000 (deleted)
b5e59000-b5e61000 rw-s 00000000 00:09 41877643   /SYSV00000000 (deleted)
b5e61000-b5e62000 r--s 00000000 00:09 41812104   /SYSV00000000 (deleted)
b5e62000-b5e63000 r--s 00000000 00:09 41713798   /SYSV00000000 (deleted)
b5e63000-b5e6b000 rw-s 00000000 00:09 41779337   /SYSV00000000 (deleted)
b5e6b000-b5e73000 rw-s 00000000 00:09 41779337   /SYSV00000000 (deleted)
b5e73000-b5e74000 r--s 00000000 00:09 41713798   /SYSV00000000 (deleted)
b5e74000-b5e75000 r--s 00000000 00:09 41615492   /SYSV00000000 (deleted)
b5e75000-b5f74000 rw-s 00000000 00:09 41681031   /SYSV00000000 (deleted)
b5f74000-b6073000 rw-s 00000000 00:09 41681031   /SYSV00000000 (deleted)
b6073000-b6074000 r--s 00000000 00:09 41615492   /SYSV00000000 (deleted)
b6074000-b6075000 r--s 00000000 00:09 41517186   /SYSV00000000 (deleted)
b6075000-b6090000 rw-s 00000000 00:09 41582725   /SYSV00000000 (deleted)
b6090000-b60ab000 rw-s 00000000 00:09 41582725   /SYSV00000000 (deleted)
b60ab000-b60ac000 r--s 00000000 00:09 41517186   /SYSV00000000 (deleted)
b60ac000-b60ad000 r--s 00000000 00:09 41418880   /SYSV00000000 (deleted)
b60ad000-b60b5000 rw-s 00000000 00:09 41484419   /SYSV00000000 (deleted)
b60b5000-b60bd000 rw-s 00000000 00:09 41484419   /SYSV00000000 (deleted)
b60bd000-b60be000 r--s 00000000 00:09 41418880   /SYSV00000000 (deleted)
b60be000-b60bf000 r--s 00000000 00:09 41320574   /SYSV00000000 (deleted)
b60bf000-b60c7000 rw-s 00000000 00:09 41386113   /SYSV00000000 (deleted)
b60c7000-b60cf000 rw-s 00000000 00:09 41386113   /SYSV00000000 (deleted)
b60cf000-b60d0000 r--s 00000000 00:09 41320574   /SYSV00000000 (deleted)
b60d0000-b60d1000 r--s 00000000 00:09 41222268   /SYSV00000000 (deleted)
b60d1000-b60e0000 rw-s 00000000 00:09 41287807   /SYSV00000000 (deleted)
b60e0000-b60ef000 rw-s 00000000 00:09 41287807   /SYSV00000000 (deleted)
b60ef000-b60f0000 r--s 00000000 00:09 41222268   /SYSV00000000 (deleted)
b60f0000-b60f1000 r--s 00000000 00:09 41123962   /SYSV00000000 (deleted)
b60f1000-b60f9000 rw-s 00000000 00:09 41189501   /SYSV00000000 (deleted)
b60f9000-b6101000 rw-s 00000000 00:09 41189501   /SYSV00000000 (deleted)
b6101000-b6102000 r--s 00000000 00:09 41123962   /SYSV00000000 (deleted)
b6102000-b6103000 r--s 00000000 00:09 41025656   /SYSV00000000 (deleted)
b6103000-b610b000 rw-s 00000000 00:09 41091195   /SYSV00000000 (deleted)
b610b000-b6113000 rw-s 00000000 00:09 41091195   /SYSV00000000 (deleted)
b6113000-b6114000 r--s 00000000 00:09 41025656   /SYSV00000000 (deleted)
b6114000-b6115000 r--s 00000000 00:09 40927350   /SYSV00000000 (deleted)
b6115000-b6124000 rw-s 00000000 00:09 40992889   /SYSV00000000 (deleted)
b6124000-b6133000 rw-s 00000000 00:09 40992889   /SYSV00000000 (deleted)
b6133000-b6134000 r--s 00000000 00:09 40927350   /SYSV00000000 (deleted)
b6134000-b6135000 r--s 00000000 00:09 40829044   /SYSV00000000 (deleted)
b6135000-b6143000 rw-s 00000000 00:09 40894583   /SYSV00000000 (deleted)
b6143000-b6151000 rw-s 00000000 00:09 40894583   /SYSV00000000 (deleted)
b6151000-b6152000 r--s 00000000 00:09 40829044   /SYSV00000000 (deleted)
b6152000-b6153000 r--s 00000000 00:09 40730739   /SYSV00000000 (deleted)
b6153000-b615b000 rw-s 00000000 00:09 40796277   /SYSV00000000 (deleted)
b615b000-b6163000 rw-s 00000000 00:09 40796277   /SYSV00000000 (deleted)
b6163000-b6164000 r--s 00000000 00:09 40730739   /SYSV00000000 (deleted)
b6164000-b61e6000 rw-p b6164000 00:00 0
b61e6000-b61fa000 r-xp 00000000 08:06 1754975
/usr/lib/python2.5/lib-dynload/_ctypes.so
b61fa000-b61fb000 r--p 00014000 08:06 1754975
/usr/lib/python2.5/lib-dynload/_ctypes.so
b61fb000-b61fd000 rw-p 00015000 08:06 1754975
/usr/lib/python2.5/lib-dynload/_ctypes.so
b61fd000-b622e000 r-xp 00000000 08:06 101967
/usr/lib/python2.5/site-packages/numpy/random/mtrand.so
b622e000-b622f000 r--p 00030000 08:06 101967
/usr/lib/python2.5/site-packages/numpy/random/mtrand.so
b622f000-b6233000 rw-p 00031000 08:06 101967
/usr/lib/python2.5/site-packages/numpy/random/mtrand.so
b6233000-b6867000 r-xp 00000000 08:06 1666296
/usr/lib/liblapack.so.3gf.0
b6867000-b6868000 r--p 00633000 08:06 1666296
/usr/lib/liblapack.so.3gf.0
b6868000-b686b000 rw-p 00634000 08:06 1666296
/usr/lib/liblapack.so.3gf.0
b686b000-b6978000 rw-p b686b000 00:00 0
b6979000-b697c000 r-xp 00000000 08:06 1754981
/usr/lib/python2.5/lib-dynload/cmath.so
b697c000-b697d000 r--p 00002000 08:06 1754981
/usr/lib/python2.5/lib-dynload/cmath.so
b697d000-b697e000 rw-p 00003000 08:06 1754981
/usr/lib/python2.5/lib-dynload/cmath.so
b697e000-b6981000 r-xp 00000000 08:06 1755079
/usr/lib/python2.5/lib-dynload/_lsprof.so
b6981000-b6982000 r--p 00002000 08:06 1755079
/usr/lib/python2.5/lib-dynload/_lsprof.so
b6982000-b6983000 rw-p 00003000 08:06 1755079
/usr/lib/python2.5/lib-dynload/_lsprof.so
b6983000-b698d000 r-xp 00000000 08:06 101965
/usr/lib/python2.5/site-packages/numpy/fft/fftpack_lite.so
b698d000-b698e000 r--p 00009000 08:06 101965
/usr/lib/python2.5/site-packages/numpy/fft/fftpack_lite.so
b698e000-b698f000 rw-p 0000a000 08:06 101965
/usr/lib/python2.5/site-packages/numpy/fft/fftpack_lite.so
b698f000-b69d0000 rw-p b698f000 00:00 0
b69d0000-b69df000 r-xp 00000000 08:06 1147510    /lib/libbz2.so.1.0.4
b69df000-b69e0000 r--p 0000f000 08:06 1147510    /lib/libbz2.so.1.0.4
b69e0000-b69e1000 rw-p 00010000 08:06 1147510    /lib/libbz2.so.1.0.4
b69e2000-b69e5000 r-xp 00000000 08:06 1755080
/usr/lib/python2.5/lib-dynload/_locale.so
b69e5000-b69e6000 r--p 00002000 08:06 1755080
/usr/lib/python2.5/lib-dynload/_locale.so
b69e6000-b69e7000 rw-p 00003000 08:06 1755080
/usr/lib/python2.5/lib-dynload/_locale.so
b69e7000-b69eb000 r-xp 00000000 08:06 101966
/usr/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so
b69eb000-b69ec000 r--p 00003000 08:06 101966
/usr/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so
b69ec000-b69ed000 rw-p 00004000 08:06 101966
/usr/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so
b69ed000-b69ef000 r-xp 00000000 08:06 1755075
/usr/lib/python2.5/lib-dynload/_heapq.so
b69ef000-b69f0000 r--p 00001000 08:06 1755075
/usr/lib/python2.5/lib-dynload/_heapq.so
b69f0000-b69f2000 rw-p 00002000 08:06 1755075
/usr/lib/python2.5/lib-dynload/_heapq.so
b69f2000-b69f6000 r-xp 00000000 08:06 1753276
/usr/lib/python2.5/lib-dynload/zlib.so
b69f6000-b69f7000 r--p 00003000 08:06 1753276
/usr/lib/python2.5/lib-dynload/zlib.so
b69f7000-b69f8000 rw-p 00004000 08:06 1753276
/usr/lib/python2.5/lib-dynload/zlib.so
b69f8000-b69fe000 r-xp 00000000 08:06 1757958
/usr/lib/python2.5/lib-dynload/bz2.so
b69fe000-b69ff000 r--p 00005000 08:06 1757958
/usr/lib/python2.5/lib-dynload/bz2.so
b69ff000-b6a01000 rw-p 00006000 08:06 1757958
/usr/lib/python2.5/lib-dynload/bz2.so
b6a01000-b6a42000 rw-p b6a01000 00:00 0
b6a42000-b6a44000 r-xp 00000000 08:06 1755138
/usr/lib/python2.5/lib-dynload/_hashlib.so
b6a44000-b6a45000 r--p 00001000 08:06 1755138
/usr/lib/python2.5/lib-dynload/_hashlib.so
b6a45000-b6a46000 rw-p 00002000 08:06 1755138
/usr/lib/python2.5/lib-dynload/_hashlib.so
b6a46000-b6a49000 r-xp 00000000 08:06 1753256
/usr/lib/python2.5/lib-dynload/fcntl.so
b6a49000-b6a4a000 r--p 00002000 08:06 1753256
/usr/lib/python2.5/lib-dynload/fcntl.so
b6a4a000-b6a4b000 rw-p 00003000 08:06 1753256
/usr/lib/python2.5/lib-dynload/fcntl.so
b6a4b000-b6a4f000 r-xp 00000000 08:06 1753254
/usr/lib/python2.5/lib-dynload/binascii.so
b6a4f000-b6a50000 r--p 00003000 08:06 1753254
/usr/lib/python2.5/lib-dynload/binascii.so
b6a50000-b6a51000 rw-p 00004000 08:06 1753254
/usr/lib/python2.5/lib-dynload/binascii.so
b6a51000-b6a92000 rw-p b6a51000 00:00 0
b6a92000-b6a96000 r-xp 00000000 08:06 101963
/usr/lib/python2.5/site-packages/numpy/lib/_compiled_base.so
b6a96000-b6a97000 r--p 00003000 08:06 101963
/usr/lib/python2.5/site-packages/numpy/lib/_compiled_base.so
b6a97000-b6a98000 rw-p 00004000 08:06 101963
/usr/lib/python2.5/site-packagesAborted
Eric B. (Guest)
on 2009-01-28 20:55
(Received via mailing list)
On Wed, Jan 28, 2009 at 02:53:25PM +0000, Alvaro P. wrote:
>
>   your structure to a power-of-two bytes.
>   On this platform, our allocation granularity is 4096 bytes.
> gr_buffer::allocate_buffer: warning: tried to allocate
>   64 items of size 510. Due to alignment requirements
>   2048 were allocated.  If this isn't OK, consider padding
>   your structure to a power-of-two bytes.
>   On this platform, our allocation granularity is 4096 bytes.

These are normal...

> *** stack smashing detected ***: python terminated

This indicates that some code, 99% probability your new block, wrote
beyond the bounds of a stack allocated object.

When you compile your new code are there _any_ warnings emitted by the
compiler?  If so, make them go away.

Eric
This topic is locked and can not be replied to.