[op25-dev] need help using extract()

Matt D md123 at nycap.rr.com
Wed Dec 11 11:24:23 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The seg fault from trying to use extract remains:

Program terminated with signal 11, Segmentation fault.
#0  extract<std::vector<bool, std::allocator<bool> > > (in=...,
    bits=bits at entry=0xa3309ce0, bits_sz=bits_sz at entry=8) at
./op25_yank.h:109
109	      x =  (x << 1) | (in[bits[i]] ? 1 : 0);
(gdb) bt
#0  extract<std::vector<bool, std::allocator<bool> > > (in=...,
    bits=bits at entry=0xa3309ce0, bits_sz=bits_sz at entry=8) at
./op25_yank.h:109
#1  0xb2e0aa53 in ldu1::lcf (this=0xb498148) at ldu1.cc:138
#2  0xb2e08931 in ldu1::snapshot (this=0xb498148) at ldu1.cc:102
#3  0xb2e0f42b in snapshot_du_handler::handle (this=0xadc8b28, du=...)
    at snapshot_du_handler.cc:44

I can not figure out what I am doing wrong. I tried to copy how it
this procedure is done in abstract_data_unit::frame_body().  I give
the vector to extract() like this:

uint16_t
ldu1::lcf() const
{
   const size_t LCF_BITS[] = {
    0, 1, 2, 3, 4, 5, 6 , 7
   };
   const size_t LCF_BITS_SZ = sizeof(LCF_BITS) / sizeof(LCF_BITS[0]);
   const uint16_t lcf = extract(get_vec(), LCF_BITS, LCF_BITS_SZ);
   return lcf;

}

const_bit_vector&
ldu1::get_vec() const
{
  return decoded_lcw_vec;
}

and i know the vector is there becuase it prints to the screen before
the program dies:

DU1 LCW Data--------------------------------------------
- -----------------------------------------------------------
Encoded LCW:
  LCF:  00000000
  MFID: 00000000
  TGID: 0000000000000001
  Source ID: 001000100000011111111101

  Hamming decode:
    LCF:  00000000
    MFID: 00000000
    TGID: 0000000000000001
    Source ID: 001000100000011111111101


    RS decode:
      LCF:  00000000
      MFID: 00000000
      TGID: 0000000000000001
      Source ID: 001000100000011111111101

 Decode LDU1 LCW Vector
Complete:000000000000000001000000000000000000000000000001001000100000011111111101
- -----------------------------------------------------------

the vector is defined private in the .h file.   Any help will be much
appreciated.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
Comment: MacGPG2 - http://www.gpgtools.org/macgpg2.html
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSqEtnAAoJECrdp7MWSIVbv3wH/3vO0ml/lccBEkZNs60fmZU0
DkHClK3byd5OkD8z7/NtH2jHl97XRY52HgXzZFMhzujUlU1ZyOH3VvzNWtYjvlhr
nHcJN3C3sVayFw2Yok4nHCLYbCc6sTPCHLc5bjcUIA7BBZ8a1FzJtcpySkE5HS1Q
K9lsXJDAqbhryaHfyrSIf0RbTILHrFjTiVfPTX7Cc2jA6UOLWXC1O4jpE7HqE1Xw
mSLoh+LH2ax0JH/ju4LcwCIhCrYdIciuLHdwx5eYCYIaSd0CBYVqjNFmdbbakxNs
meItfFhovWynV6wPTaxlpjs7saH3p05/kZAgelVVzHICoifx+9cJwWBhV3O65cU=
=EncL
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/op25-dev/attachments/20131211/64050f2a/attachment.html>


More information about the op25-dev mailing list