! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Unable to Add/Edit Application Autostart Entries (git)
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description ToZ editbugs 2017-01-04 12:30:19 CET
Created attachment 6946 
Fix callback signals

With xfce4-session built from git (after the gtk3 migration work), trying to add or edit an application autostart entry results in a segmentation fault after a 
"(xfce4-session-settings:9094): Gtk-CRITICAL **: gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)' failed" message.

It appears that when the "notify::text" signal callbacks for the "command_entry" and "name_entry" GtkEntry objects are created, they are called immediately, before the second GtkEntry object is created resulting in a failure in the xfae_dialog_update() function to properly process the objects. Here is the output of a gdb session:

---------------------------------
(gdb) file /usr/bin/xfce4-session-settings 
Reading symbols from /usr/bin/xfce4-session-settings...done.
(gdb) run
Starting program: /usr/bin/xfce4-session-settings 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeacfd700 (LWP 5230)]
[New Thread 0x7fffea4fc700 (LWP 5231)]
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

(xfce4-session-settings:5226): GLib-GObject-CRITICAL **: g_object_new_valist: object class 'GtkGrid' has no property named 'width'

(xfce4-session-settings:5226): Gtk-CRITICAL **: gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)' failed

Thread 1 "xfce4-session-s" received signal SIGSEGV, Segmentation fault.
xfae_dialog_update (dialog=0x69a760) at xfae-dialog.c:164
warning: Source file is more recent than executable.
164	                                     GTK_RESPONSE_OK,
(gdb) p command
$1 = (const gchar *) 0x0
(gdb) p name
$2 = (const gchar *) 0x7ffff74f6d4e ""
(gdb) p *dialog->command_entry
Cannot access memory at address 0x0
(gdb) p *dialog->name_entry
$3 = {parent_instance = {g_type_instance = {g_class = 0xca84b0}, ref_count = 5, 
    qdata = 0xcb39d0}, priv = 0xcb63b0}
(gdb) 
---------------------------------

Note, that the command_entry object does not exist at the time the callback function is called. Moving the signal callback function calls after the second GtkEntry object is created fixes this issue. Attached is a patch that does this.
Comment 1 ToZ editbugs 2017-01-04 12:32:19 CET
Created attachment 6947 
Fix grid properties

Attached is a minor secondary patch that removes non-existent grid properties from the declaration of the grid object in xfae_dialog_init(). This removes a couple of errant messages.
Comment 2 Eric Koegel editbugs 2017-05-01 06:01:41 CEST
Thanks ToZ! Pushed both to master in:

commit 49d9a01514ec3ccabde9f2f6e33deda947bfc97c
Author: Eric Koegel <eric.koegel@gmail.com>
Date:   Mon May 1 06:57:56 2017 +0300

    Remove non-existent grid properties (Bug #13271)
    
    Attached is a minor secondary patch that removes non-existent
    grid properties from the declaration of the grid object in
    xfae_dialog_init(). This removes a couple of errant messages.
    Reported and fixed by ToZ.
https://git.xfce.org/xfce/xfce4-session/commit/?id=49d9a01514ec3ccabde9f2f6e33deda947bfc97c

commit 193b09a9c159d1d16ad69e4298f48c2b531e9392
Author: Eric Koegel <eric.koegel@gmail.com>
Date:   Mon May 1 06:55:05 2017 +0300

    Add/Edit Application Autostart Entries (Bug #13271)
    
    With xfce4-session built from git (after the gtk3
    migration work), trying to add or edit an application
    autostart entry results in a segmentation fault after a
    "(xfce4-session-settings:9094): Gtk-CRITICAL **:
    gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)'
    failed" message.
https://git.xfce.org/xfce/xfce4-session/commit/?id=193b09a9c159d1d16ad69e4298f48c2b531e9392
Comment 3 haarp 2017-06-21 12:27:09 CEST
*** Bug 13670 has been marked as a duplicate of this bug. ***
Comment 4 Skunnyk editbugs 2017-12-17 23:32:39 CET
*** Bug 13907 has been marked as a duplicate of this bug. ***

Bug #13271

Reported by:
ToZ
Reported on: 2017-01-04
Last modified on: 2017-12-17
Duplicates (2):
  • 13670 Segmentation fault when trying to add/edit app autostart
  • 13907 xfce4-session-settings segfaults when trying to add autostart entry

People

Assignee:
Xfce Bug Triage
CC List:
6 users

Version

Version:
Unspecified

Attachments

Fix callback signals (1.52 KB, patch)
2017-01-04 12:30 CET , ToZ
no flags
Fix grid properties (609 bytes, patch)
2017-01-04 12:32 CET , ToZ
no flags

Additional information