segfault by functor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

segfault by functor

Jens Kallup
What does this mean?
How to fix it?


Program received signal SIGSEGV, Segmentation fault.
0x0000000000436a67 in operator() (a3=..., a2=..., a1=..., a0=...,
this=<optimized out>)
     at /usr/local/include/boost/function/function_template.hpp:771
771                   (this->functor BOOST_FUNCTION_COMMA
BOOST_FUNCTION_ARGS);
(gdb) q
A debugging session is active.

     Inferior 1 [process 22406] will be killed.

Quit anyway? (y or n) y


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: segfault by functor

sehe
On 22-01-17 07:54, Jens Kallup wrote:
> What does this mean?
> How to fix it?

It means you are calling a function (object) that is not (correctly)
initialized or that has been (re)moved.

This has nothing to do with boost or Spirit.

Use your regular tooling for finding where your memory errors come from
(experience, valgrind, asan, ubsan)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: segfault by functor

Michael Powell-2
In reply to this post by Jens Kallup
On Sun, Jan 22, 2017 at 1:54 AM, Jens Kallup <[hidden email]> wrote:
> What does this mean?
> How to fix it?

As with Jens' reply, yes, this is not really a Qi question, per se,
although there are Qi things most likely involved.

I'm not familiar with the internals of Spirit, whether X3 or Qi/Karma,
but that said...

Think about it. I had done this once, and realized I had a rule in a
local scope. Although it built okay, it ran with segfault. Why?
Because the reference or pointer that Qi was holding onto to build the
expression tree was suddenly gone when the scope rolled back. It was
easy to solve in my case in that any rules should be maintained in an
appropriate scope. For instance, in my case it was a parser/grammar
class, so the rules were private members.

>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000436a67 in operator() (a3=..., a2=..., a1=..., a0=...,
> this=<optimized out>)
>      at /usr/local/include/boost/function/function_template.hpp:771
> 771                   (this->functor BOOST_FUNCTION_COMMA
> BOOST_FUNCTION_ARGS);
> (gdb) q
> A debugging session is active.
>
>      Inferior 1 [process 22406] will be killed.
>
> Quit anyway? (y or n) y
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general