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 642490 - notify_desktop_launch() "g_variant_new_bytestring: assertion `string != NULL' failed" warnings
notify_desktop_launch() "g_variant_new_bytestring: assertion `string != NULL'...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-02-16 18:42 UTC by Sebastien Bacher
Modified: 2011-02-16 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdesktopappinfo: Handle g_get_prgname() being NULL (1.13 KB, patch)
2011-02-16 18:50 UTC, Colin Walters
accepted-commit_now Details | Review

Description Sebastien Bacher 2011-02-16 18:42:13 UTC
The issue happen on glib 2.28.0 and is due to the patch from https://bugzilla.gnome.org/show_bug.cgi?id=641395 which does

"  g_variant_builder_add (&extras_variant, "{sv}",
			 "origin-prgname",
			 g_variant_new_bytestring (g_get_prgname ()));"

or g_get_prgname () can return NULL if neither gtk_main() or g_get_prgname() have been called

it leads to those warnings to be displayed

""(process:19746): GLib-CRITICAL **: g_variant_new_bytestring: assertion `string != NULL' failed

(process:19746): GLib-CRITICAL **: g_variant_new_variant: assertion `value != NULL' failed

(process:19746): GLib-CRITICAL **: g_variant_get_type: assertion `value != NULL' failed

(process:19746): GLib-CRITICAL **: g_variant_type_is_subtype_of: assertion `g_variant_type_check (type)' failed

(process:19746): GLib-CRITICAL **: g_variant_builder_add_value: assertion `!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed

(process:19746): GLib-CRITICAL **: g_variant_builder_end: assertion `GVSB(builder)->offset >= GVSB(builder)->min_items' failed

(process:19746): GLib-CRITICAL **: g_variant_get_type: assertion `value != NULL' failed

(process:19746): GLib-CRITICAL **: g_variant_type_is_subtype_of: assertion `g_variant_type_check (type)' failed

(process:19746): GLib-CRITICAL **: g_variant_builder_add_value: assertion `!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed"
Comment 1 Sebastien Bacher 2011-02-16 18:43:07 UTC
the warning comes from calling g_app_info_launch() from an example program using glib and gio but not gtk
Comment 2 Colin Walters 2011-02-16 18:50:17 UTC
Created attachment 181037 [details] [review]
gdesktopappinfo: Handle g_get_prgname() being NULL

Reported-By: Sebastien Bacher <seb128@ubuntu.com>
Comment 3 Matthias Clasen 2011-02-16 18:52:09 UTC
Review of attachment 181037 [details] [review]:

Looks ok; please cherry-pick to 2.28 as well