Re: Gtk.IconTheme.get_icon_sizes() returns distinct lists



Hi,

Just had a quick look. So when pygobject encounters a zero terminated
array, it assumes that it is a list of pointers. In this case it is a
list of gint instead, so on a 64bit machine the length calculation is
against a 64bit word, while the data is only 32bit.
It is a binding bug, to be more specific in pygi-argument.c line 815,
AFAICT. Instead, the correct item-size needs to be used for the check
there.

Benjamin

On Fr, 2014-04-04 at 00:02 +0200, Jay Strict wrote:
============================================================
from gi.repository import Gtk


theme = Gtk.IconTheme.get_default()

for i in range(20):
     sizes = theme.get_icon_sizes('application-exit')
     print(sizes)

============================================================


results in the following (undeterministic) output:

============================================================
[22, 16, 24, 32, 48, 0, 81, 0, 1920169263, 1634235183, 1764713842, 
1936617315, 1869506351, 1932485997, 1634492771, 795176034, 1702125923, 
1769107303, 1946186597, 1936617321, 909455916, 909455992, 1886413103]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24, 32, 48, 0, 33, 0, -1686329720, 32747, -1686329720, 32747, 
32, 0, 288, 0, 11155184, 0, 11322344, 0, -3, -1, 10972016, 0, 150, 0, 
-1680381472, 32747]
[22, 16, 24, 32, 48, 0, 289, 0, 11155184, 0, 11322344, 0, -3, -1, 
10972016, 0, 150, 0, -1680381472, 32747, 73, 0, 73, 0]
[22, 16, 24, 32, 48, 0, 33, 0, -1686329736]
[22, 16, 24, 32, 48]
[22, 16, 24, 32, 48, 0]
[22, 16, 24]
[22, 16, 24, 32, 48]
[22, 16, 24, 32, 48, 0, 33, 0, 22]
[22, 16, 24, 32, 48, 0, 33, 0, -1686329736]
[22, 16, 24, 32, 48]
[22, 16, 24, 32, 48, 0, 33, 0]
[22, 16, 24, 32]
[22, 16, 24, 32, 48, 0, 33, 0, -1686329720, 32747, -1686329720, 32747]
[22, 16, 24, 32, 48, 0, 49, 0]

============================================================

Can you confirm this? Is it a bug in PyGObject?


Best regards,
Jay

_______________________________________________
python-hackers-list mailing list
python-hackers-list gnome org
https://mail.gnome.org/mailman/listinfo/python-hackers-list


Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]