You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report! Unfortunately this looks like an upstream issue with the GIR: here's what the signals field of DBusInterfaceInfo looks like as of the GNOME 46 SDK (I think this is what you're referring to):
<fieldname="signals"writable="1">
<docxml:space="preserve"filename="gio/gdbusintrospection.h"line="143">A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.</doc>
<arrayc:type="GDBusSignalInfo**">
<typename="DBusSignalInfo"c:type="GDBusSignalInfo*"/>
</array>
</field>
Although the documentation mentions this is a null-terminated array, the array type here is missing zero-terminated="1" which would allow the translate-gir logic to create the appropriate type.
A case where this is marked up correctly in GIR is the return value of g_desktop_app_info_get_string_list:
<return-valuetransfer-ownership="full">
<docxml:space="preserve"filename="gio/gdesktopappinfo.c"line="5106">
a %NULL-terminated string array or %NULL if the specified
key cannot be found. The array should be freed with g_strfreev().</doc>
<arraylength="1"zero-terminated="1"c:type="gchar**">
<typename="utf8"/>
</array>
</return-value>
This case is correctly translated to [*:null]?[*:0]u8:
So there are a few things I'm planning to do based on this issue:
Look for other cases (based on the documentation) where the same problem exists, and work around them all by patching the upstream GIR files via gir-fixes.
Add more test coverage for translateArray just to make sure zero-terminated="1" works in other possible cases (in addition to the one mentioned above with a string array).
Open a tracking issue for the upstream GIR fixes that need to be made, and look into sending the corrections upstream so the gir-fixes patches can eventually be removed.
Currently the bindings define them as
[*]*T
pointers (for example in gio.DBusSignalInfo), when in reality they should be[*:null]?*T
.This prevents Segfaults when programs expect the arrays to terminate with null.
The text was updated successfully, but these errors were encountered: