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

2012-01-03 Thread Matthew Brush

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).


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


Cheers,
Matthew Brush


diff --git a/geanylatex/src/geanylatex.c b/geanylatex/src/geanylatex.c
index e1bab6e..a27c98b 100644
--- a/geanylatex/src/geanylatex.c
+++ b/geanylatex/src/geanylatex.c
@@ -124,7 +124,7 @@ const guint ui_entries_n = G_N_ELEMENTS(format_icons);
 
 
 /* fallback UI definition */
-const gchar *toolbar_markup =
+static const gchar *toolbar_markup =
 ui
 	toolbar name='glatex_format_toolbar'
 		toolitem action='Wizard'/
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2012-01-03 Thread Frank Lanitz
On Tue, 03 Jan 2012 08:45:38 -0800
Matthew Brush mbr...@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/


pgpIsINMArm48.pgp
Description: PGP signature
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2012-01-03 Thread Frank Lanitz
On Tue, 03 Jan 2012 09:01:06 -0800
Matthew Brush mbr...@codebrainz.ca wrote:

 On 01/03/2012 08:45 AM, Matthew Brush 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).
 
  I'd love to know why this changed all of the sudden though, why it's
  different from before.
 
 
 I fixed in Geany in this commit:
 
 https://github.com/geany/geany/commit/8f489fc9fbab8a8c197f40536fac8ebd74c430eb
 
 So if you pull from Geany's repo and rebuild, even before applying
 the patch, the toolbar problem should be fixed, but probably best to
 apply the same changes as in that commit the plugin as well.

Thanks for the finding. I've applied it locally and will give it a
test.  

Cheers, 
Frank 

-- 
http://frank.uvena.de/en/


pgpUy7BGCS6Gg.pgp
Description: PGP signature
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2012-01-01 Thread Frank Lanitz
On Sat, 31 Dec 2011 04:09:36 -0800
Matthew Brush mbr...@codebrainz.ca wrote:

 Will check it out in a while and see if I can spot anything.

Would be cool as I really don't have any clue what might can be broken.
I assume its some issue on my code ... but :D 

Cheers, 
Frank 
-- 
http://frank.uvena.de/en/


pgpWDDpZZK3YH.pgp
Description: PGP signature
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2011-12-31 Thread Frank Lanitz
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?

Cheers, 
Frank 
-- 
http://frank.uvena.de/en/


pgpZFWRuCDDPB.pgp
Description: PGP signature
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2011-12-31 Thread Matthew Brush

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?



Can you post a full traceback from gdb with debugging symbols?

IIRC the toolbar was already using GtkBuilder and is not in the same 
.glade file as the rest of the UI (and theoretically shouldn't be 
affected by it).


Cheers,
Matthew Brush
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


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

2011-12-31 Thread Frank Lanitz
On Sat, 31 Dec 2011 03:04:13 -0800
Matthew Brush mbr...@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?
 
 
 Can you post a full traceback from gdb with debugging symbols?
 
 IIRC the toolbar was already using GtkBuilder and is not in the same 
 .glade file as the rest of the UI (and theoretically shouldn't be 
 affected by it).

Dammit. With current geany build I cannot reproduce the crash, only a
huge number of warnings

Geany-INFO: Loaded:   /home/frlan/local/lib/geany/geanylatex.so
(GeanyLaTeX)

(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed

After I activated the toolbar inside plugin configuration dialog I got: 

Gtk-WARNING **: New: missing action New

Program received signal SIGTRAP, Trace/breakpoint trap.
0x7540b888 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0  0x7540b888 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7540bc02 in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x779ebda2 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#3  0x779eba05 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4  0x779eba05 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#5  0x779ef431 in gtk_ui_manager_ensure_update () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#6  0x779ef4a9 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#7  0x70ab0ab9 in init_toolbar () at geanylatex.c:172
#8  0x70ab3a47 in on_configure_response (dialog=optimized out, 
response=optimized out, user_data=optimized out) at geanylatex.c:253
#9  on_configure_response (dialog=optimized out, response=optimized out, 
user_data=optimized out) at geanylatex.c:183
#10 0x75cd3804 in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x75ce578a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x75cd3804 in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x75ce578a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x77833dc5 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#19 0x75cd375a in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x75ce4f7a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x77832bed in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#24 0x778dc418 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#25 0x75cd375a in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x75ce55bf in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x75ceebe3 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x779f5301 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#30 0x778da5d3 in gtk_propagate_event () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#31 0x778da933 in gtk_main_do_event () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#32 0x7754621c in ?? () from 

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

2011-12-31 Thread Matthew Brush

Thanks,

Will check it out in a while and see if I can spot anything.

Cheers,
Matthew Brush

On 12/31/2011 03:16 AM, Frank Lanitz wrote:

On Sat, 31 Dec 2011 03:04:13 -0800
Matthew Brushmbr...@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?



Can you post a full traceback from gdb with debugging symbols?

IIRC the toolbar was already using GtkBuilder and is not in the same
.glade file as the rest of the UI (and theoretically shouldn't be
affected by it).


Dammit. With current geany build I cannot reproduce the crash, only a
huge number of warnings

Geany-INFO: Loaded:   /home/frlan/local/lib/geany/geanylatex.so
(GeanyLaTeX)

(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed
(geany:10190): Gtk-CRITICAL **: IA__gtk_action_get_sensitive: assertion
`GTK_IS_ACTION (action)' failed

After I activated the toolbar inside plugin configuration dialog I got:

Gtk-WARNING **: New: missing action New

Program received signal SIGTRAP, Trace/breakpoint trap.
0x7540b888 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0  0x7540b888 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7540bc02 in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x779ebda2 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#3  0x779eba05 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4  0x779eba05 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#5  0x779ef431 in gtk_ui_manager_ensure_update () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#6  0x779ef4a9 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#7  0x70ab0ab9 in init_toolbar () at geanylatex.c:172
#8  0x70ab3a47 in on_configure_response (dialog=optimized out, 
response=optimized out, user_data=optimized out) at geanylatex.c:253
#9  on_configure_response (dialog=optimized out, response=optimized out, 
user_data=optimized out) at geanylatex.c:183
#10 0x75cd3804 in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x75ce578a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x75cd3804 in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x75ce578a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x77833dc5 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#19 0x75cd375a in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x75ce4f7a in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x75ceee11 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x77832bed in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#24 0x778dc418 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#25 0x75cd375a in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x75ce55bf in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x75ceebe3 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x75ceefb2 in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x779f5301 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#30 0x778da5d3 in gtk_propagate_event () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#31 0x778da933 in