mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
44 stars 46 forks source link

datetime: migrate from dbus-glib to gdbus #403

Closed yetist closed 9 months ago

yetist commented 10 months ago

Please review and test it, thanks.

raveit65 commented 10 months ago

Not sure what really needs to be tested. What i did...

Seems system works like before. Hopefully calling core team for a code review.

raveit65 commented 10 months ago

I got a abrt alarm with this branch

Core was generated by `/usr/libexec/msd-datetime-mechanism'.
Program terminated with signal SIGABRT, Aborted.
warning: Section `.reg-xstate/6645' in core file too small.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44        return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
[Current thread is 1 (Thread 0x7fd11b7fe6c0 (LWP 6645))]

Thread 1 (Thread 0x7fd11b7fe6c0 (LWP 6645)):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {140535759129056}}
        ret = <optimized out>
#1  0x00007fd1218138b3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fd1217c2abe in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007fd1217ab87f in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {13448795082, 4, 40, 140536189591120, 140535759126816, 4, 0, 18446744073709551615, 18446744073709551615, 4, 3892144125831159296, 140536086254880, 140536188584510, 140536086256032, 140535759134880, 140536086254928}}, sa_flags = 564141890, sa_restorer = 0x7fd11b7fd550}
#4  0x00007fd1217ac60f in __libc_message (fmt=fmt@entry=0x7fd12192652f "%s\n") at ../sysdeps/posix/libc_fatal.c:150
        ap = {{gp_offset = 16, fp_offset = 32721, overflow_arg_area = 0x7fd11b7fd660, reg_save_area = 0x7fd11b7fd5f0}}
        fd = 2
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
#5  0x00007fd12181d775 in malloc_printerr (str=str@entry=0x7fd121929680 "malloc(): unaligned fastbin chunk detected") at malloc.c:5651
#6  0x00007fd121820ccc in _int_malloc (av=av@entry=0x7fd108000030, bytes=bytes@entry=16) at malloc.c:3839
        fb = <optimized out>
        pp = <optimized out>
        nb = <optimized out>
        idx = <optimized out>
        bin = <optimized out>
        victim = <optimized out>
        size = <optimized out>
        victim_index = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        block = <optimized out>
        bit = <optimized out>
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        tcache_unsorted_count = <optimized out>
        tcache_nb = <optimized out>
        tc_idx = <optimized out>
        return_cached = <optimized out>
        __PRETTY_FUNCTION__ = "_int_malloc"
#7  0x00007fd121821c34 in __GI___libc_malloc (bytes=bytes@entry=16) at malloc.c:3305
        ar_ptr = 0x7fd108000030
        victim = <optimized out>
        tbytes = <optimized out>
        __PRETTY_FUNCTION__ = "__libc_malloc"
#8  0x00007fd1219c53ca in g_malloc (n_bytes=16) at ../glib/gmem.c:130
        mem = <optimized out>
#9  0x00007fd121a04354 in g_variant_new_dict_entry (value=0x7fd108004f00, key=0x7fd1080057c0) at ../glib/gvariant.c:938
        __n = 2
        __s = 8
        __p = <optimized out>
        dict_type = <optimized out>
        children = <optimized out>
        __func__ = "g_variant_new_dict_entry"
#10 g_variant_new_dict_entry (key=key@entry=0x7fd1080057c0, value=value@entry=0x7fd108004f00) at ../glib/gvariant.c:928
        __func__ = "g_variant_new_dict_entry"
#11 0x00007fd121c55c85 in parse_value_from_blob.isra.0 (buf=buf@entry=0x7fd11b7fd9a0, type=type@entry=0x7fd121c8bbe8, max_depth=max_depth@entry=66, just_align=just_align@entry=0, error=error@entry=0x7fd11b7fd888, indent=<optimized out>) at ../gio/gdbusmessage.c:1904
        key_type = <optimized out>
        value_type = <optimized out>
        key = 0x7fd1080057c0
        value = 0x7fd108004f00
        ret = 0x0
        local_error = 0x0
        type_string = <optimized out>
#12 0x00007fd121c5636e in parse_value_from_blob.isra.0 (buf=buf@entry=0x7fd11b7fd9a0, type=<optimized out>, max_depth=max_depth@entry=67, just_align=just_align@entry=0, error=error@entry=0x7fd11b7fd990, indent=<optimized out>) at ../gio/gdbusmessage.c:1834
        item = <optimized out>
        builder = {u = {s = {partial_magic = 0, type = 0x55fe0f0f1e30, y = {94549662703153, 140535759132576, 0, 18446744073709551615, 140535759134704, 8, 2, 3, 1033660112, 0, 0, 0, 0, 0}}, x = {0, 94549662703152, 94549662703153, 140535759132576, 0, 18446744073709551615, 140535759134704, 8, 2, 3, 1033660112, 0, 0, 0, 0, 0}}}
        offset = 47
        target = 70
        array_len = <optimized out>
        element_type = 0x7fd121c8bbe8
        fixed_size = <optimized out>
        ret = 0x0
        local_error = 0x0
        type_string = <optimized out>
#13 0x00007fd121c1f1aa in g_dbus_message_new_from_blob (blob=<optimized out>, blob_len=<optimized out>, capabilities=<optimized out>, error=0x7fd11b7fdad0) at ../gio/gdbusmessage.c:2254
        local_error = 0x0
        mbuf = {len = 142, valid_len = 142, pos = 56, data = 0x7fd108000c10 "l\002\001\001F", byte_order = G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN}
        message = 0x7fd108005fa0
        endianness = <optimized out>
        major_protocol_version = 1 '\001'
        message_body_len = 70
        headers = <optimized out>
        item = <optimized out>
        iter = {x = {14, 140536189197113, 140536189161662, 140536086256272, 0, 140535759127040, 140536086256256, 140536189152638, 0, 41, 227802600155, 140536189595428, 140536086256192, 140536190460275, 140535759128096, 140536086256336}}
        signature = <optimized out>
        __func__ = "g_dbus_message_new_from_blob"
#14 0x00007fd121c2e09b in _g_dbus_worker_do_read_cb (input_stream=<optimized out>, res=<optimized out>, user_data=0x7fd1100058e0) at ../gio/gdbusprivate.c:754
        message = <optimized out>
        worker = 0x7fd1100058e0
        error = 0x0
        bytes_read = <optimized out>
#15 0x00007fd121bbe09c in g_task_return_now (task=0x7fd108004620) at ../gio/gtask.c:1309
#16 0x00007fd121bbe0d5 in complete_in_idle_cb (task=task@entry=0x7fd108004620) at ../gio/gtask.c:1323
#17 0x00007fd1219bb48d in g_idle_dispatch (source=0x7fd108004200, callback=0x7fd121bbe0c0 <complete_in_idle_cb>, user_data=0x7fd108004620) at ../glib/gmain.c:6163
        idle_source = 0x7fd108004200
        again = <optimized out>
#18 0x00007fd1219bf48c in g_main_dispatch (context=0x7fd110005c40) at ../glib/gmain.c:3460
        dispatch = 0x7fd1219bb460 <g_idle_dispatch>
        prev_source = 0x0
        begin_time_nsec = 227802602019
        was_in_call = 0
        user_data = 0x7fd108004620
        callback = 0x7fd121bbe0c0 <complete_in_idle_cb>
        cb_funcs = 0x7fd121aaa380 <g_source_callback_funcs>
        cb_data = 0x55fe0f0f1650
        need_destroy = <optimized out>
        source = 0x7fd108004200
        current = 0x7fd108000bf0
        i = 0
#19 g_main_context_dispatch (context=0x7fd110005c40) at ../glib/gmain.c:4200
#20 0x00007fd121a1d648 in g_main_context_iterate.isra.0 (context=0x7fd110005c40, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4276
        max_priority = 0
        timeout = 0
        some_ready = 1
        nfds = 1
        allocated_nfds = <optimized out>
        fds = <optimized out>
        begin_time_nsec = 227802600005
#21 0x00007fd1219bea8f in g_main_loop_run (loop=0x7fd110005d70) at ../glib/gmain.c:4479
        __func__ = "g_main_loop_run"
#22 0x00007fd121c264b2 in gdbus_shared_thread_func (user_data=0x7fd110005c10) at ../gio/gdbusprivate.c:284
        data = 0x7fd110005c10
#23 0x00007fd1219ed983 in g_thread_proxy (data=0x55fe0f0eb860) at ../glib/gthread.c:831
        thread = 0x55fe0f0eb860
        __func__ = "g_thread_proxy"
#24 0x00007fd121811907 in start_thread (arg=<optimized out>) at pthread_create.c:444
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140536187000336, 7190617160282381817, 140536086259392, -120, 11, 140536094648464, 7190617160294964729, 7190632082909666809}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#25 0x00007fd121897870 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

It happened silent in the background, no idea what it caused.

raveit65 commented 9 months ago

@yetist I did not get the seqfault again but it would be interesting to know what it caused. Did you ever get the segfault? @mate-desktop/core-team Any chance of a another reviewer?

raveit65 commented 9 months ago

@yetist open questions... @mate-desktop/core-team Anyone else like to do a code review?

yetist commented 9 months ago

I got a abrt alarm with this branch

It happened silent in the background, no idea what it caused.

I'm guessing that after setting the timeout in the reset_killtimer function, we should not call exit directly to exit, but the application should use g_main_loop_quit.

yetist commented 9 months ago

@raveit65

The branch has been updated. Please test more to see if the segfault still exists.

raveit65 commented 9 months ago

@yetist i will test your changes a while. Changing time an date works like before after installation.

raveit65 commented 9 months ago

I will test again latest changes.

raveit65 commented 9 months ago

@yetist I am happy to review next plugin.