On Fri, 2007-09-28 at 12:29 +0930, Iain Buchanan wrote:
> On Thu, 2007-09-27 at 18:20 +0100, Mark Ellis wrote:
> > On Thu, 2007-09-27 at 10:58 +0930, Iain Buchanan wrote:
> > > Hi all!
> > > 
> > > I load trayicon and then plug in my device.  It then segfaults at line
> > > 630 of odccm-client.c:
> 
> [snip]
> 
> > Does it always do this, or is it intermittent ? 
> 
> It always segfaults, yes.
> 
> > Unfortunately I don't
> > have time at the moment to do much, but I'll give you some ideas in case
> > you can try yourself.
> 
> I _can_ try myself, but that doesn't mean I'll get anywhere :)
> 
>  I'm having a hard time getting the line number from gdb though... it
> may in fact be from line 451, since odccm_device_get_rapi_connection is
> called from two places.  This is line 451:
> 
>   goto exit;
> error_exit:
>   g_object_unref(new_proxy);
>   if (device) g_object_unref(device); // here!
> exit:
>   return;
> }
> 

Ok, just put some g_debug or printf statements before and after those
two calls to odccm_device_get_rapi_connection to identify where we are
going wrong.

> It seems that get_device_name_via_rapi fails with the message
> "CeRegOpenKeyEx failed getting device name", and so returns NULL.  And
> because that fails, odccm_device_get_rapi_connection returns FALSE, and
> therefore odccm_device_connected_cb tries to g_object_unref(device).
> 
> If I comment out this line "if (device) g_object_unref(device);" then
> trayicon doesn't segfault, but it still doesn't detect the device when I
> plug it in (makes sense).  However, it _does_ detect the name when I
> unplug it.  Attached is the output with the unref line commented, with
> some line breaks just before I plugged the device in, and just before I
> unplugged it.
> 
> That's about as far as I got...

> > I suspect there are two different problems, one that causes the name
> > lookup failure below, and another that causes a segfault when unreffing
> > the device object.
> 
> I think it's because it can't get the name that it causes this chain of
> events.
> 

Indeed, the cause is lack of name, which is in fact lack of connection
I'd guess.

> > Taking the unref action, my best guess is that when the object is
> > finalized in device.c, it tries to free an invalid pointer.
> > 
> > Not enough information to speculate on the name lookup failure. What
> > dccm are you using ? Any useful output from it ?
> 
> odccm.  It shows this when I plug in my device:
> 
> ** (odccm:30213): DEBUG: device_info_received
> ** (odccm:30213): DEBUG: 82 36 34 2c 45 c6 87 98 67 5f 40 1f 60 86 6d d0
> 05 00 00 00 01 00 00 00 03 00 00 00 49 00 4f 00 32 00 00 00 05 01 c3 00
> 11 0a 00 00 05 00 00 00 7e f7 98 00 5c 38 ce 60 0f 00 00 00 50 6f 63 6b
> 65 74 50 43 00 53 53 44 4b 00 00 08 00 00 00 58 64 61 20 41 74 6f 6d 00
> 02 00 00 00 04 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00
> ** (odccm:30213): DEBUG: device_info_received: registering object path
> '/org/synce/odccm/Device/_2C343682_C645_9887_675F_401F60866DD0_'
> 
> the hex translates to this:
> 
> �64,[EMAIL PROTECTED]
> ~��\8�`PocketPCSSDXda Atom
> 
> IO2 is my devices name, and it is an Xda.  So odccm is seeing the name.
> 
> trayicon gets the same device info string:
> 
> ** (synce-trayicon:26369): DEBUG: odccm_device_connected_cb: Received
> connect from
> odccm: /org/synce/odccm/Device/_2C343682_C645_9887_675F_401F60866DD0_
> 
> [snip]
> 
> > Hmm, I might make the -f option not connect to the session manager,
> > would stop unexpected restarts when debugging.
> > 
> > > And also, once it has restarted, it doesn't recognise my device.
> > > 
> > > Any suggestions?  thanks!
> > 
> > It won't recognise an already connected device on startup, it's on my
> > (growing) list :)
> 
> Try the attached patch to main.c for not restarting when the -f option
> is specified.  There are lots of ways it could have been done, this is
> just one :)
> 
> What else on your todo list is this easy?!!

Cool, thanks ! Unfortunately the list is in my head, must write it
down.....

> 
> Well, sorry about the huge email, but thanks for any help you can
> continue to provide!

This is all good !

Mark

PS Is it just me or did it suddenly get very busy around here ?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to