Re: Intrumenting memory accesses and internal segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

After looking into the plugin CTraps made by Brandon Lucia with GCC 4.8 I
understood that I just broke up the CallGraph ...
It seems that calling cgraph_edge::rebuild_edges does the job !

If you think this is not enough to repair my bug, or if there is a better
way (through a better understanding of GCC)
of fixing my code, I am open to any suggestions !

Thank you,

 - Hugo

2017-10-10 10:34 GMT+02:00 hugo brunie <hbrunie0@xxxxxxxxx>:

> Hi,
> Inspired from thread_sanityzer GCC pass I am trying to instrument every
> memory access of a chosen function.
>
> Through the gate of my pass (GCC plugin 6.1), I only instrument function
> which name is present in a text file.
> Then I changed a little bit of thread_sanytizer pass to instrument every
> memory access inside these functions.
>
> My problem happens on C++ code as simple as :
>
> int main(int argc, char * argv[])
> {
>     Domain dom;
>     int b = dom.relt();
>     int a = dom.elt();
>     return 0;
> }
>
> in domain.hpp there is : the domain class with relt returning a reference
> and elt returning a const NO reference.
>
> The SSA code generated is :
>
> Location: File (simple_main.cpp) Line (8)
>   <bb 2>:
>   DomAin::DomAin (&dom);
>   <bb 3>:
>   b_4 = DomAin::elt (&dom);
>   # DEBUG b => b_4
>   _6 = DomAin::relt (&dom);
>   *correspondance_instrument_load_store* (11, _6, &"simple_main.cpp"[0]);
>   a_7 = *_6;
>   # DEBUG a => a_7
>   _8 = 0;
>   dom ={v} {CLOBBER};
>   return _8;
> <L2>:
>   dom ={v} {CLOBBER};
>   resx 1
>
> BUT if I just left either
>
> int b = dom.relt();
> OR
> int a = dom.elt();
> alone in the main, there is no segfault.
>
> Error trace :
> 0xac0eff crash_signal
>         ../../gcc/toplev.c:333
> 0x93374e inline_edge_summary
>         ../../gcc/ipa-inline.h:281
> 0x93374e estimate_function_body_sizes
>         ../../gcc/ipa-inline-analysis.c:2648
> 0x937066 compute_inline_parameters(cgraph_node*, bool)
>         ../../gcc/ipa-inline-analysis.c:2953
> 0xb5fe9a convert_callers_for_node
>         ../../gcc/tree-sra.c:5112
> 0xb69a9e cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
> void*), void*, bool)
>         ../../gcc/cgraph.h:3071
> 0xb69a9e convert_callers
>         ../../gcc/tree-sra.c:5127
> 0xb69a9e modify_function
>         ../../gcc/tree-sra.c:5183
> 0xb69a9e ipa_early_sra
>         ../../gcc/tree-sra.c:5411
> 0xb69a9e execute
>         ../../gcc/tree-sra.c:5458
>
> Thank you for your help,
>
>  - Hugo
>
>
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux