[Geany-devel] Issue with geanyLaTeX after GtkBuilder: Help needed to debug

Frank Lanitz frank at xxxxx
Tue Jan 3 21:02:53 UTC 2012


On Tue, 03 Jan 2012 08:45:38 -0800
Matthew Brush <mbrush at codebrainz.ca> wrote:

> On 12/31/2011 02:57 AM, Frank Lanitz wrote:
> > Hi folks,
> >
> > Since about GtkBuilder come in into Geany core we are experiencing
> > some issue with GeanyLaTeX in terms of in some cases the toolbar is
> > not able tobe loaded and Geany is ending up inside a segfault. Most
> > likely its repreducable by activating the toolbar and restarting
> > Geany having a tex-file loaded. The issue seems to be located in
> > near of line
> > https://github.com/geany/geany-plugins/blob/master/geanylatex/src/geanylatex.c#L168
> > unfortunately I don't have any bloody idea, what might is going
> > wrong. Anyone else could jump in here?
> >
> 
> Attached is a patch to fix the issue.  It's the same bug in Geany
> where this code was probably copied from, so I'll fix Geany and leave
> it to you to apply this patch to the plugin. If either Geany or
> GeanyLatex is fixed the plugin will be fixed, but for correctness I
> guess they should both be fixed.
> 
> IIUC what's happening is Geany's variable (toolbar.c:toolbar_markup)
> is declared const but not static so it's global to the entire
> program. When the plugin is loaded (at runtime with dlopen) with the
> same variable name also declared const, the one previously defined in
> Geany is used instead. If Geany's is declared static, GeanyLatex uses
> it's own variable because it can't see Geany's, if it's declared
> static in GeanyLatex, the local scope wins I guess.
> 
> So what was happening was GeanyLatex was loading Geany's toolbar XML 
> string constant instead of it's own (which obviously is a problem).

Yepp. Sounds legit. 
 
> I'd love to know why this changed all of the sudden though, why it's 
> different from before.

Me too ;)
-- 
http://frank.uvena.de/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20120103/9d4bed85/attachment.pgp>


More information about the Devel mailing list