Re: Debugging applet causing hildon-home crash

2010-01-11 Thread Kimmo Hämäläinen
On Mon, 2010-01-11 at 02:03 +0100, ext Graham Cobb wrote:
 On Sunday 10 January 2010 19:50:20 Graham Cobb wrote:
  Now to try to work out why my widget cannot receive any click events but
  other widgets can!
 
 Well, it turns out it is because the buttons I want to click on in my home 
 page applet are within a GtkScrolledWindow.  I can receive the clicks if I 
 get rid of the scrolled window (but, not everything fits).  Does anyone know 

This could be fixed in the latest (git master) hildon-desktop. I noticed
that the mouse event forwarding didn't cope well with deep widget
hierarchies.

 if it would work if I used a HildonPannableArea (I won't get a chance to try 
 it until next weekend)?

If you could e-mail me (or attach to a bug) your applet, I can test if
it works in the future.

-Kimmo

 
 Graham
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-10 Thread Graham Cobb
On Saturday 09 January 2010 14:06:42 Jan Arne Petersen wrote:
 Hi,

 On 01/09/2010 02:52 PM, Graham Cobb wrote:
  As there is no way (that I am aware of) for GTypes to be unregistered, or
  to be reregistered, is there some way for me to stop hildon-home actually
  unmapping my code? At least that would mean that the plugin could be
  re-added to the desktop, although no newer version would be usable until
  a reboot.

 You could define a g_module_check_init like this:

 const gchar *
 g_module_check_init (GModule *module)
 {
  g_module_make_resident(module);

  return NULL;
 }

 to prevent the module of being unloaded (see
 http://maemo.org/api_refs/5.0/5.0-final/glib/glib-Dynamic-Loading-of-Module
s.html#glib-Dynamic-Loading-of-Modules.description).

Thanks very much -- that works and fixes my problems (along with, of course, 
many other bug fixes to cope with the widget being destroyed and then 
recreated again!).

I will update the documentation bug report to say the docs should mention this 
(at the very least they need to say that the Glib dynamic module loading 
mechanism is being used).

Now to try to work out why my widget cannot receive any click events but other 
widgets can!

Graham
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-10 Thread Graham Cobb
On Sunday 10 January 2010 19:50:20 Graham Cobb wrote:
 Now to try to work out why my widget cannot receive any click events but
 other widgets can!

Well, it turns out it is because the buttons I want to click on in my home 
page applet are within a GtkScrolledWindow.  I can receive the clicks if I 
get rid of the scrolled window (but, not everything fits).  Does anyone know 
if it would work if I used a HildonPannableArea (I won't get a chance to try 
it until next weekend)?

Graham
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-09 Thread Graham Cobb
On Thursday 07 January 2010 15:48:34 Anderson Lizardo wrote:
 2010/1/7 Kimmo Hämäläinen kimmo.hamalai...@nokia.com:
  We had several of this kind of crashes that happen when you remove and
  add it back. Usually the problem was in the Glib types that the applet
  uses: if it tries to register new types that are already there, or
  something similar.  I guess Glib should print out some warnings for you?
  (notice that hildon-home probably closes stdout by default)
...
 I usually also debug on scratchbox/x86 , where I can kill hildon-home
 and restart it again with

 hildon-home 

 which then shows debug messages on the console.

Thanks for the hints -- very useful.  I have already found and fixed several 
bugs with unloading the plugin!

A couple of notes for future reference for anyone who is searching for 
hildon-home crashes when unloading an HDHomePluginItem home widget...

1) HDHomePluginItem provides a useful optimised timer capability 
(hd_home_plugin_item_heartbeat_signal_add) but if you use this, you WILL 
crash hildon-home when your plugin is unloaded, unless you destroy the event 
source in your class finalize function.  For example, in gpesummary I have 
added:

if (current_timer) 
g_source_destroy(g_main_context_find_source_by_id(NULL,current_timer));

This should really be added to the documentation for 
hd_home_plugin_item_heartbeat_signal_add (reported in bug 4337).

2) Make sure that any libraries you use are not running any timers (or any 
other callbacks) which could fire later.  For example, in gpesummary, I have 
to explicitly close the event database as otherwise libeventdb leaves a timer 
running which will cause a crash when it fires (of course, that is good 
practice anyway in order to free up the memory!).

Maybe hildon-home should be using a separate GMainContext for each plugin -- 
would that mean it could automatically destroy all the event sources 
associated with the plugin before unloading it?

Graham
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-09 Thread Graham Cobb
On Thursday 07 January 2010 15:48:34 Anderson Lizardo wrote:
 2010/1/7 Kimmo Hämäläinen kimmo.hamalai...@nokia.com:
  On Wed, 2010-01-06 at 22:46 +0100, ext Graham Cobb wrote:
  In Fremantle, the GPE Summary applet causes hildon-home to crash if it
  is removed and then re-added.  I have not been able to work out what the
  problem is.
 
  We had several of this kind of crashes that happen when you remove and
  add it back. Usually the problem was in the Glib types that the applet
  uses: if it tries to register new types that are already there, or
  something similar.  I guess Glib should print out some warnings for you?
  (notice that hildon-home probably closes stdout by default)

 As a side note, python-hildon suffered from these issues because the
 latest hildon-home (or hildon-desktop?) versions seemed to incorporate
 some gtype registration functions which were missing before (i.e. ones
 usually generated by glib-mkenums). The python bindings tried to
 register the same types again, which caused problems (the errors shown
 on console gave a hint about this).

I can now reliably unload my plugin but I cannot add it back again.

I hit this GType problem.  My plugin (actually some of the libraries it relies 
on) use GTypes.  So, of course, they register them.  When reloaded, the 
attempt to register them again fails (and generates warning messages).  But 
the functions for the type are now associated with code which has been 
unmapped from memory!  So, when I use one of the types it crashes.

As there is no way (that I am aware of) for GTypes to be unregistered, or to 
be reregistered, is there some way for me to stop hildon-home actually 
unmapping my code? At least that would mean that the plugin could be re-added 
to the desktop, although no newer version would be usable until a reboot.

This seems to be an unsolvable problem: no desktop plugin can use (or use a 
library which uses) GTypes!

Am I missing something?

Graham
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-09 Thread Jan Arne Petersen

Hi,

On 01/09/2010 02:52 PM, Graham Cobb wrote:

On Thursday 07 January 2010 15:48:34 Anderson Lizardo wrote:

2010/1/7 Kimmo Hämäläinenkimmo.hamalai...@nokia.com:

On Wed, 2010-01-06 at 22:46 +0100, ext Graham Cobb wrote:

In Fremantle, the GPE Summary applet causes hildon-home to crash if it
is removed and then re-added.  I have not been able to work out what the
problem is.


We had several of this kind of crashes that happen when you remove and
add it back. Usually the problem was in the Glib types that the applet
uses: if it tries to register new types that are already there, or
something similar.  I guess Glib should print out some warnings for you?
(notice that hildon-home probably closes stdout by default)


As a side note, python-hildon suffered from these issues because the
latest hildon-home (or hildon-desktop?) versions seemed to incorporate
some gtype registration functions which were missing before (i.e. ones
usually generated by glib-mkenums). The python bindings tried to
register the same types again, which caused problems (the errors shown
on console gave a hint about this).


I can now reliably unload my plugin but I cannot add it back again.

I hit this GType problem.  My plugin (actually some of the libraries it relies
on) use GTypes.  So, of course, they register them.  When reloaded, the
attempt to register them again fails (and generates warning messages).  But
the functions for the type are now associated with code which has been
unmapped from memory!  So, when I use one of the types it crashes.

As there is no way (that I am aware of) for GTypes to be unregistered, or to
be reregistered, is there some way for me to stop hildon-home actually
unmapping my code? At least that would mean that the plugin could be re-added
to the desktop, although no newer version would be usable until a reboot.


You could define a g_module_check_init like this:

const gchar *
g_module_check_init (GModule *module)
{
g_module_make_resident(module);

return NULL;
}

to prevent the module of being unloaded (see 
http://maemo.org/api_refs/5.0/5.0-final/glib/glib-Dynamic-Loading-of-Modules.html#glib-Dynamic-Loading-of-Modules.description).


Best regards,
Jan Arne
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-08 Thread Anderson Lizardo
2010/1/7 Kimmo Hämäläinen kimmo.hamalai...@nokia.com:
 On Wed, 2010-01-06 at 22:46 +0100, ext Graham Cobb wrote:
 In Fremantle, the GPE Summary applet causes hildon-home to crash if it is
 removed and then re-added.  I have not been able to work out what the problem
 is.

 We had several of this kind of crashes that happen when you remove and
 add it back. Usually the problem was in the Glib types that the applet
 uses: if it tries to register new types that are already there, or
 something similar.  I guess Glib should print out some warnings for you?
 (notice that hildon-home probably closes stdout by default)

As a side note, python-hildon suffered from these issues because the
latest hildon-home (or hildon-desktop?) versions seemed to incorporate
some gtype registration functions which were missing before (i.e. ones
usually generated by glib-mkenums). The python bindings tried to
register the same types again, which caused problems (the errors shown
on console gave a hint about this).

The fix consisted on not running glib-mkenums for hildon types. Maybe
not related to this problem, but anyway.

 Any hints on how best to debug this hildon-home crash?

 It could help to disable all other plugins than the one that you are
 debugging and using gdb or good old printfs I guess.

I usually also debug on scratchbox/x86 , where I can kill hildon-home
and restart it again with

hildon-home 

which then shows debug messages on the console.

Regards,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Debugging applet causing hildon-home crash

2010-01-07 Thread Kimmo Hämäläinen
On Wed, 2010-01-06 at 22:46 +0100, ext Graham Cobb wrote:
 In Fremantle, the GPE Summary applet causes hildon-home to crash if it is 
 removed and then re-added.  I have not been able to work out what the problem 
 is.

We had several of this kind of crashes that happen when you remove and
add it back. Usually the problem was in the Glib types that the applet
uses: if it tries to register new types that are already there, or
something similar.  I guess Glib should print out some warnings for you?
(notice that hildon-home probably closes stdout by default)

 Any hints on how best to debug this hildon-home crash?

It could help to disable all other plugins than the one that you are
debugging and using gdb or good old printfs I guess.

-Kimmo

 Graham
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Debugging applet causing hildon-home crash

2010-01-06 Thread Graham Cobb
In Fremantle, the GPE Summary applet causes hildon-home to crash if it is 
removed and then re-added.  I have not been able to work out what the problem 
is.

Any hints on how best to debug this hildon-home crash?

Graham
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers