Quantcast

Segmentation fault issue with gr_hier_block2_detail::connect

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Segmentation fault issue with gr_hier_block2_detail::connect

Ruecan
Hello GNU-Radio list,

I wonder why is my C++ code is thorwing a segmentation fault (core dumped), gdb outputs:

Program received signal SIGSEGV, Segmentation fault.
0xb7b1b718 in gr_hier_block2_detail::connect(boost::shared_ptr<gr_basic_block>, int, boost::shared_ptr<gr_basic_block>, int) ()
   from /usr/local/lib/libgnuradio-core-3.6.5.so.0.0.0

I confirm that the same line of code which is throwing that error is executed multiple (randomly) times before it came to that error.

I can't figure out what is causing that and how to fix it ?  
All explanation are welcome.

Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Segmentation fault issue with gr_hier_block2_detail::connect

Ruecan
And when I run again sometimes it stops and throw another segfault in the same location but labeled:

Program received signal SIGSEGV, Segmentation fault.
0xb7af75f3 in gr_flowgraph::check_dst_not_used(gr_endpoint const&) () from /usr/local/lib/libgnuradio-core-3.6.5.so.0.0.0
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Segmentation fault issue with gr_hier_block2_detail::connect

Marcus Müller
In reply to this post by Ruecan
Could you provide us with a backtrace (in GDB: "bt") and if possible with the code that you use to produce this error.
Usually, connect does not cause segfaults, a problem arises if you a) connect a block that does not exist yet (eg. in its constructor) b) connect a block in multiple flowgraphs.

Greetings,
Marcus

On 10/01/2013 08:18 PM, Naceur wrote:

> Hello GNU-Radio list,
>
> I wonder why is my C++ code is thorwing a segmentation fault (core dumped),
> gdb outputs:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7b1b718 in
> gr_hier_block2_detail::connect(boost::shared_ptr<gr_basic_block>, int,
> boost::shared_ptr<gr_basic_block>, int) ()
>     from /usr/local/lib/libgnuradio-core-3.6.5.so.0.0.0
>
> I confirm that the same line of code which is throwing that error is
> executed multiple (randomly) times before it came to that error.
>
> I can't figure out what is causing that and how to fix it ?
> All explanation are welcome.
>
> Regards,
>
>
>
> --
> View this message in context: http://gnuradio.4.n7.nabble.com/Segmentation-fault-issue-with-gr-hier-block2-detail-connect-tp43894.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Segmentation fault issue with gr_hier_block2_detail::connect

Ruecan
Thank you Marcus for the reply,

I just figured out where was the problem:
I am TWICE instantiating an object (a shared pointer) outside an if loop
and inside of it,

And for the backtrace it gives me that
... in main (argc=<error reading variable: Cannot access memory at address 0x0>,
    argv=<error reading variable: Cannot access memory at address 0x4>) ...

Actually I fixed the issue.

Cheers
Loading...