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 689136 - Crash in dconf_writer_real_end(): change is NULL (when $XDG_CONFIG_HOME/dconf does not exist)
Crash in dconf_writer_real_end(): change is NULL (when $XDG_CONFIG_HOME/dconf...
Status: RESOLVED FIXED
Product: dconf
Classification: Core
Component: writer
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-27 08:45 UTC by Martin Pitt
Modified: 2013-01-02 19:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reproducer (484 bytes, text/x-sh)
2012-11-27 08:45 UTC, Martin Pitt
  Details
service: try mkdir_with_parents() on failed writes (1.32 KB, patch)
2013-01-02 19:22 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Martin Pitt 2012-11-27 08:45:06 UTC
Created attachment 229973 [details]
reproducer

I noticed that in my jhbuild session with temporary XDG dirs, dconf-service crashes when I try to change a gsettings key.

Program received signal SIGSEGV, Segmentation fault.
0x000000000040a0ca in dconf_writer_real_end (writer=0x43c020)
    at dconf-writer.c:162
162           g_free (change->tag);

change is NULL:

(gdb) p change
$1 = (TaggedChange *) 0x0

Backtrace:
  • #0 dconf_writer_real_end
    at dconf-writer.c line 162
  • #1 dconf_writer_end
    at dconf-writer.c line 207
  • #2 dconf_writer_handle_change
    at dconf-writer.c line 281
  • #3 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #4 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #5 g_cclosure_marshal_generic
    at gclosure.c line 1454
  • #6 g_type_iface_meta_marshal
    at gclosure.c line 1021
  • #7 g_closure_invoke
    at gclosure.c line 777
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3605
  • #9 g_signal_emitv
    at gsignal.c line 3056
  • #10 _dconf_dbus_writer_skeleton_handle_method_call
    at dconf-generated.c line 1091
  • #11 call_in_idle_cb
    at gdbusconnection.c line 4737
  • #12 g_idle_dispatch
    at gmain.c line 4887
  • #13 g_main_dispatch
    at gmain.c line 2784
  • #14 g_main_context_dispatch
    at gmain.c line 3288
  • #15 g_main_context_iterate
    at gmain.c line 3359
  • #16 g_main_context_iteration
    at gmain.c line 3420
  • #17 g_application_run
    at gapplication.c line 1620
  • #18 main
    at main.c line 31


(gdb) p change
$1 = (TaggedChange *) 0x0


I wrote a little shell script which reproduces the crash. It works fine on version 0.5.2 (which I have in current Ubuntu raring), but fails in jhbuild, i. e. on current git master.
Comment 1 Martin Pitt 2012-11-27 08:49:05 UTC
I noticed that when I run the script on 0.5.2, it properly creates

  /tmp/testhome/config/dconf/user
  /tmp/testhome/runtime/dconf/user

However, in jhbuild it only creates /tmp/testhome/runtime/dconf/user. It does create the /tmp/testhome/config/ dir, but not the "dconf" subdirectory.

When I add

  mkdir -p $XDG_CONFIG_HOME/dconf

after the three exports in the reproducer, the crash is gone. So it seems somewhere between 0.5.2 and current git an important mkdir was called?
Comment 2 Martin Pitt 2012-11-27 08:55:04 UTC
(In reply to comment #1)

> after the three exports in the reproducer, the crash is gone. So it seems
> somewhere between 0.5.2 and current git an important mkdir was called?

Err, "dropped", not "called".
Comment 3 Allison Karlitskaya (desrt) 2013-01-02 19:19:48 UTC
There are two issues here.

 - the missing mkdir

 - dconf crashing when uncommited changes happen (due to a typo)



3928089f34a17102b958fe39959215a447192ae0 fixes the crash.

Attaching a patch for the mkdir.
Comment 4 Allison Karlitskaya (desrt) 2013-01-02 19:22:14 UTC
Created attachment 232558 [details] [review]
service: try mkdir_with_parents() on failed writes

If we fail to write the database file, try g_mkdir_with_parents() to
create the parent directory and try again.
Comment 5 Allison Karlitskaya (desrt) 2013-01-02 19:23:30 UTC
Attachment 232558 [details] pushed as a2bad17 - service: try mkdir_with_parents() on failed writes