Bug 28795

Summary: Crash if can't write log
Product: Telepathy Reporter: Guillaume Desmottes <guillaume.desmottes>
Component: loggerAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: bpepple, pochu27
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard: r+
i915 platform: i915 features:
Attachments: Check if we could open the file log before writing to it

Description Guillaume Desmottes 2010-06-28 06:05:49 UTC
Original bug report: https://bugzilla.gnome.org/show_bug.cgi?id=622818

If we chmod 000 the logs directory, the logger crash when trying to write.


#0  ___vfprintf_chk (fp=0x0, flag=1, format=0x7ffff7bd23f4 "%s", ap=0x7fffffffe010) at vfprintf_chk.c:31
#1  0x00007ffff6c7a208 in IA__g_fprintf (file=0x0, format=0x1 <Address 0x1 out of bounds>) at /build/buildd/glib2.0-2.25.9/glib/gprintf.c:86
#2  0x00007ffff7bcb38c in _log_store_xml_write_to_store (store=<value optimized out>, message=<value optimized out>, error=<value optimized out>) at log-store-xml.c:412
#3  add_message_text_chat (store=<value optimized out>, message=<value optimized out>, error=<value optimized out>) at log-store-xml.c:484
#4  add_message_text (store=<value optimized out>, message=<value optimized out>, error=<value optimized out>) at log-store-xml.c:521
#5  log_store_xml_add_message (store=<value optimized out>, message=<value optimized out>, error=<value optimized out>) at log-store-xml.c:557
#6  0x00007ffff7bc7e23 in _tpl_log_manager_add_message (manager=<value optimized out>, message=0x619200, error=0x7fffffffe258) at log-manager.c:276
#7  0x00007ffff7bbf39c in on_sent_signal_cb (proxy=<value optimized out>, arg_Timestamp=<value optimized out>, arg_Type=<value optimized out>, 
    arg_Text=<value optimized out>, user_data=<value optimized out>, weak_object=<value optimized out>) at channel-text.c:1166
#8  0x00007ffff65cc8a4 in _tp_cli_channel_type_text_invoke_callback_for_sent (tpproxy=0x664000, error=<value optimized out>, args=0x659cc0, 
    generic_callback=0x7ffff7bbf130 <on_sent_signal_cb>, user_data=<value optimized out>, weak_object=<value optimized out>) at _gen/tp-cli-channel-body.h:11459
#9  0x00007ffff66433ec in tp_proxy_signal_invocation_run (p=0x6453a0) at proxy-signals.c:266
#10 0x00007ffff6c37272 in g_main_dispatch (context=0x614190) at /build/buildd/glib2.0-2.25.9/glib/gmain.c:2044
#11 IA__g_main_context_dispatch (context=0x614190) at /build/buildd/glib2.0-2.25.9/glib/gmain.c:2597
#12 0x00007ffff6c3b1b8 in g_main_context_iterate (context=0x614190, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.25.9/glib/gmain.c:2675
#13 0x00007ffff6c3b6c5 in IA__g_main_loop_run (loop=0x63cf20) at /build/buildd/glib2.0-2.25.9/glib/gmain.c:2883
#14 0x00000000004018cb in main (argc=<value optimized out>, argv=<value optimized out>) at telepathy-logger.c:187
Comment 1 Emilio Pozuelo Monfort 2010-12-06 07:06:12 UTC
Created attachment 40828 [details] [review]
Check if we could open the file log before writing to it

http://git.collabora.co.uk/?p=user/pochu/telepathy-logger.git;a=commitdiff;h=8ccbb77e4dc5852633fc6a656a5027852f6509fd
Comment 2 Emilio Pozuelo Monfort 2010-12-06 07:23:19 UTC
*** Bug 32032 has been marked as a duplicate of this bug. ***
Comment 3 Guillaume Desmottes 2010-12-06 07:23:20 UTC
++
Comment 4 Emilio Pozuelo Monfort 2010-12-06 08:04:36 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.