After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 633907 - [PATCH] fix treatment of g_callable_get_n_args() return value
[PATCH] fix treatment of g_callable_get_n_args() return value
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-03 13:21 UTC by Dan Williams
Modified: 2010-11-11 17:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix handling of return value from g_callable_info_get_n_args (5.29 KB, patch)
2010-11-03 13:22 UTC, Dan Williams
accepted-commit_now Details | Review

Description Dan Williams 2010-11-03 13:21:27 UTC
g_callable_get_n_args() returns gint but libpeas treats the return value as guint in a few places.  If introspection is somewhat broken (and thus the callable info that libpeas passes to g_callable_get_n_args() is NULL) then libpeas will execute a couple for-loops from 0 to GUINT_MAX due to the mistype.

Patch attached that fixes that and a couple other issues I encountered.  After the patch, there are still warnings, but peas does not crash:

[dcbw@dcbw libpeas (master*)]$ gedit
Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory

** (gedit:4056): WARNING **: Could not load Gedit repository: Typelib file for namespace 'Gedit', version '3.0' not found

(gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditAppActivatable'

(gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed

(gedit:4056): libpeas-CRITICAL **: implement_interface_methods: assertion `iface_info != NULL' failed

(gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditWindowActivatable'

(gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed

(gedit:4056): libpeas-CRITICAL **: implement_interface_methods: assertion `iface_info != NULL' failed

(gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditWindowActivatable'

(gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed

(gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditViewActivatable'

(gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed
Comment 1 Dan Williams 2010-11-03 13:22:27 UTC
Created attachment 173774 [details] [review]
Fix handling of return value from g_callable_info_get_n_args
Comment 2 Steve Frécinaux 2010-11-03 13:28:58 UTC
Review of attachment 173774 [details] [review]:

This patch looks nice. You can push it but please fix the small style issue I pointed below.

Thank you very much!

::: libpeas/peas-introspection.c
@@ +38,3 @@
   GIArgument *cur_arg;
 
+  g_return_if_fail (callable_info);

Please use "callable_info != NULL" for consistency
Comment 3 Dan Williams 2010-11-11 17:30:52 UTC
Pushed as a2f98e51140286ff18a4442e2e7c39905afe40fb