[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] trellis_encoder_bb segfaults when inside hier_blo
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] trellis_encoder_bb segfaults when inside hier_block |
Date: |
Tue, 3 Aug 2010 14:02:28 -0700 |
User-agent: |
Mutt/1.5.20 (2009-08-17) |
On Tue, Aug 03, 2010 at 09:49:30AM +0200, Martin Braun wrote:
> On Mon, Aug 02, 2010 at 02:07:38PM -0700, Eric Blossom wrote:
> > On Mon, Aug 02, 2010 at 06:00:10PM +0200, Martin Braun wrote:
> > > Sorry for the double-post, we were having problems with our SMTP today.
> > >
> > > On Mon, Aug 02, 2010 at 02:54:48PM +0200, Martin Braun wrote:
> > > > chancoding_industrystd_encoder_bb::chancoding_industrystd_encoder_bb ()
> > > > : gr_hier_block2 ("industrystd_encoder_bb",
> > > > gr_make_io_signature (1, 1, sizeof(char)),
> > > > gr_make_io_signature (1, 1, sizeof(char)))
> > > > {
> > > > trellis_encoder_bb_sptr encoder =
> > > > trellis_encoder_bb_sptrllis_make_encoder_bb(fsm(1, 2, make_G()), 0);
> > >
> > > This was a typo due to pasting into the email window.
> > > make_G() returns a generator matrix, just in case someone wonders.
> > >
> > > Besides, I just figured out that the same happens when I use an FIR
> > > filter instead.
> > > Here's how I create segfaults every time:
> > >
> > > - create a hier_block in C++
> > > - internally connect an FIR filter (e.g. fir_filter_fff)
> > > - do anything with that block.
> > >
> > > Looks like this has nothing to do with gr-trellis. If this looks like a
> > > bug to any of the devs and not like a mistake on my end, I'll rig up a
> > > test case for downloading if necessary.
> >
> > Not sure if it's a bug or not.
> > Please cook up a small test case that shows the problem.
>
> Hi Eric,
>
> I've created a small out-of-tree module available at
> http://mbant.de/testcrash.tar.gz.
>
> ./bootstrap && ./configure && make check
> segfaults every time.
> I tried it on two machines (32- and 64-Bit Ubuntus), with different GNU
> Radio versions (precisely: 3.2.2 and current trunk) and different gcc's
> (4.4.1 and 4.4.3).
>
> Thanks,
> MB
I've found and fixed the problem on the maint branch.
Johnathan will propagate the changes to master and next when he gets a chance.
Here's the fix for the test case:
diff -r -u testcrash/lib/testcrash_hierblock.cc
testcrash.new/lib/testcrash_hierblock.cc
--- testcrash/lib/testcrash_hierblock.cc 2010-08-03 00:37:14.000000000
-0700
+++ testcrash.new/lib/testcrash_hierblock.cc 2010-08-03 12:31:03.576077097
-0700
@@ -32,7 +32,7 @@
testcrash_hierblock_sptr
testcrash_make_hierblock ()
{
- return testcrash_hierblock_sptr (new testcrash_hierblock ());
+ return gnuradio::get_initial_sptr (new testcrash_hierblock ());
}
All block factories should always use gnuradio::get_initial_sptr instead
of instantiating the shared pointer directly. For blocks that derive
from gr_block, the old way works OK, but when applied to blocks that
derive from gr_hier_block2 problems occur :-)
The fix I committed changes all the block factories to use
gnuradio::get_initial_sptr.
Thanks for the great test case!
Eric