[Sugar-devel] Activity updater crash

2013-05-07 Thread Daniel Narvaez
Hi Walter,

the updater crash seems to be a bug in your code

It looks like you should use get_data to get a python array from GBytes.
(unref_to_array shouldn't really be exposed in python)

diff --git a/extensions/cpsection/updater/backends/aslo.py
b/extensions/cpsectio
index e244af0..7c41ae6 100644
--- a/extensions/cpsection/updater/backends/aslo.py
+++ b/extensions/cpsection/updater/backends/aslo.py
@@ -116,7 +116,7 @@ class _UpdateFetcher(object):
 self._process_result()
 return
 else:
-xml_data = data.unref_to_array()
+xml_data = data.get_data()
 self._xml_data += str(xml_data)

 stream.read_bytes_async(self._CHUNK_SIZE, GLib.PRIORITY_DEFAULT,
None,



-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Activity updater crash

2013-05-07 Thread Daniel Narvaez
On 7 May 2013 22:59, Walter Bender walter.ben...@gmail.com wrote:

 Hi Walter,


 the updater crash seems to be a bug in your code

 It looks like you should use get_data to get a python array from GBytes.
 (unref_to_array shouldn't really be exposed in python)


 Thanks. /me wonders why it ever worked. I'll try to wrap up the other
 changes you requested ASAP so we can put this one to bed.


It's memory corruption, so  it could have worked once if really lucky :)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Activity updater crash

2013-05-07 Thread Walter Bender
On Tue, May 7, 2013 at 5:00 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 On 7 May 2013 22:59, Walter Bender walter.ben...@gmail.com wrote:

 Hi Walter,


 the updater crash seems to be a bug in your code

 It looks like you should use get_data to get a python array from GBytes.
 (unref_to_array shouldn't really be exposed in python)


 Thanks. /me wonders why it ever worked. I'll try to wrap up the other
 changes you requested ASAP so we can put this one to bed.


 It's memory corruption, so  it could have worked once if really lucky :)


I guess I should have bought a lottery ticket, because it worked many many
times in my testing.

-walter



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Activity updater crash

2013-05-07 Thread Daniel Narvaez
On 7 May 2013 23:01, Walter Bender walter.ben...@gmail.com wrote:


 It's memory corruption, so  it could have worked once if really lucky :)


 I guess I should have bought a lottery ticket, because it worked many many
 times in my testing.


Hehe. It might be that the glib we are now building with sugar-build is
more aggressive reporting double frees (it probably have more debug stuff
enabled than the glib shipped with your distro).
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Activity updater crash

2013-05-07 Thread Walter Bender
On Tue, May 7, 2013 at 4:20 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 Hi Walter,

 the updater crash seems to be a bug in your code

 It looks like you should use get_data to get a python array from GBytes.
 (unref_to_array shouldn't really be exposed in python)


Thanks. /me wonders why it ever worked. I'll try to wrap up the other
changes you requested ASAP so we can put this one to bed.

-walter


 diff --git a/extensions/cpsection/updater/backends/aslo.py
 b/extensions/cpsectio
 index e244af0..7c41ae6 100644
 --- a/extensions/cpsection/updater/backends/aslo.py
 +++ b/extensions/cpsection/updater/backends/aslo.py
 @@ -116,7 +116,7 @@ class _UpdateFetcher(object):
  self._process_result()
  return
  else:
 -xml_data = data.unref_to_array()
 +xml_data = data.get_data()
  self._xml_data += str(xml_data)

  stream.read_bytes_async(self._CHUNK_SIZE, GLib.PRIORITY_DEFAULT,
 None,



 --
 Daniel Narvaez




-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel