Re: ggc_collect() discarding/reusing remap_debug_filename() output, thus producing invalid objects

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

 



> > I tried to annotate `cached_wd` via GTY((..)) as on first glance it seems
> > the gc mistakenly re-uses it, but the `gengtype` generated state file never
> > picks this variable up.
> 
> Have you tried moving the variable to the top level and annotating it
> with GTY ((cache))?
> 
> I believe gengtype will emit code to clear such variables during
> garbage collection, avoiding the issue.

Thanks, `static GTY(()) const char* cached_wd = NULL;` outside the 
function fixes it. (style: Is directly outside the function Ok, or should this 
be moved to the top of the file?)

Now gtype.state picks it up and the final object contains the correct string.





[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