Ticket #1107 (new defect)

Opened 5 years ago

[PATCH] Segmentation fault with lack of permissions to write to the trace directory

Reported by: scriptor Owned by: dgollub
Priority: normal Milestone:
Component: OpenSync Version: 0.38
Severity: normal Keywords: lack of write permissions to the trace directory, segmentation fault


Segmentation fault occurs when osynctool has no write permissions to the trace directory.

For example:

export OSYNC_TRACE="/tmp/trace"
chmod a-rwx /tmp/trace
chown -R root:root /tmp/trace

And then running osynctool as simple user results in:

#0  0xb7f50424 in __kernel_vsyscall ()
#1  0x4ad3f460 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x4ad40e28 in abort () at abort.c:88
#3  0x4ad7cfed in __libc_message (do_abort=2,
    fmt=0x4ae57e68 "*** glibc detected *** %s: %s: 0x%s ***\n")
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:170
#4  0x4ad83e1f in malloc_printerr (ptr=<value optimized out>,
    str=<value optimized out>, action=<value optimized out>) at malloc.c:5994
#5  malloc_consolidate (av=0x4ae85140) at malloc.c:4905
#6  0x4ad8592d in _int_malloc (av=0x4ae85140, bytes=8160) at malloc.c:4229
#7  0x4ad87765 in __libc_malloc (bytes=8160) at malloc.c:3551
#8  0x4ad2b79d in __gconv_open (toset=0xb6553f10 "UTF-8//",
    fromset=0xb6553ef0 "ANSI_X3.4-1968//", handle=0xb6553f38, flags=0)
    at gconv_open.c:284
#9  0x4ad2b102 in iconv_open (tocode=0x4af9d368 "UTF-8",
    fromcode=0x824db00 "ANSI_X3.4-1968") at iconv_open.c:72
#10 0x4af2c0ce in ?? () from /lib/libglib-2.0.so.0
#11 0x4af2c11c in g_iconv_open () from /lib/libglib-2.0.so.0
#12 0x4af2c70a in ?? () from /lib/libglib-2.0.so.0
#13 0x4af2cb55 in g_convert () from /lib/libglib-2.0.so.0
#14 0x4af2cf81 in g_locale_to_utf8 () from /lib/libglib-2.0.so.0
#15 0x4af6531c in g_strerror () from /lib/libglib-2.0.so.0
#16 0x4af7ac6e in g_io_channel_new_file () from /lib/libglib-2.0.so.0
#17 0xb7eddd1a in osync_trace (type=TRACE_EXIT, message=0xb7f1e7cf "%s")
    at /home/a0037/dev/libopensync/opensync/debug/opensync_trace.c:216
#18 0xb7ed84a9 in osync_thread_unref (thread=0x8256538)
    at /home/a0037/dev/libopensync/opensync/common/opensync_thread.c:105
#19 0xb7f03420 in osync_queue_disconnect (queue=0x8255b10, error=0xb655420c)
    at /home/a0037/dev/libopensync/opensync/ipc/opensync_queue.c:1176
#20 0xb7ed0b54 in _osync_client_hup_handler (message=0x8253378,
    at /home/a0037/dev/libopensync/opensync/client/opensync_client.c:1560
#21 0xb7f01566 in _incoming_dispatch (source=0x824dcb0, callback=0,
    at /home/a0037/dev/libopensync/opensync/ipc/opensync_queue.c:391
#22 0x4af43238 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#23 0x4af468e3 in ?? () from /lib/libglib-2.0.so.0
#24 0x4af46e02 in g_main_loop_run () from /lib/libglib-2.0.so.0
#25 0x4af6dc6f in ?? () from /lib/libglib-2.0.so.0
#26 0x4aec251f in start_thread (arg=0xb6554b90) at pthread_create.c:297
#27 0x4adf804e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

I attach a patch against libopensync/opensync/debug/opensync_trace.c to solve this.


opensync_trace.c.diff (742 bytes) - added by scriptor 5 years ago.
Patch against libopensync/opensync/debug/opensync_trace.c

Change History

Changed 5 years ago by scriptor

Patch against libopensync/opensync/debug/opensync_trace.c

Note: See TracTickets for help on using tickets.