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 776818 - Crash when accessing applications logs
Crash when accessing applications logs
Status: RESOLVED FIXED
Product: gnome-logs
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-logs maintainer(s)
gnome-logs maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-01-03 14:43 UTC by Lionel Landwerlin
Modified: 2017-02-06 09:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for debugging (2.23 KB, patch)
2017-01-05 12:20 UTC, Jonathan Kang
none Details | Review
shot (21.43 KB, image/png)
2017-01-09 14:27 UTC, Lionel Landwerlin
  Details
Patch fixing crash (1.82 KB, patch)
2017-01-24 03:18 UTC, Jonathan Kang
committed Details | Review

Description Lionel Landwerlin 2017-01-03 14:43:04 UTC
Here is the backtrace :

Thread 1 "gnome-logs" received signal SIGSEGV, Segmentation fault.
__strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32	../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
(gdb) bt
  • #0 __strchr_sse2
    at ../sysdeps/x86_64/multiarch/../strchr.S line 32
  • #1 get_current_boot_id
    at src/gl-eventviewlist.c line 375
  • #2 query_add_journal_range_filter
    at src/gl-eventviewlist.c line 550
  • #3 create_query_object
    at src/gl-eventviewlist.c line 619
  • #4 on_notify_category
    at src/gl-eventviewlist.c line 645
  • #5 g_closure_invoke
    at gclosure.c line 804
  • #6 signal_emit_unlocked_R
    at gsignal.c line 3635
  • #7 g_signal_emit_valist
    at gsignal.c line 3391
  • #8 g_signal_emit
    at gsignal.c line 3447
  • #9 g_object_dispatch_properties_changed
    at gobject.c line 1064
  • #10 g_object_notify_by_spec_internal
    at gobject.c line 1157
  • #11 g_object_notify_by_pspec
    at gobject.c line 1267
  • #12 on_gl_category_list_row_selected
    at src/gl-categorylist.c line 143
  • #13 g_closure_invoke
    at gclosure.c line 804
  • #14 signal_emit_unlocked_R
    at gsignal.c line 3635
  • #15 g_signal_emit_valist
    at gsignal.c line 3391
  • #16 g_signal_emit
    at gsignal.c line 3447
  • #17 gtk_list_box_select_row_internal
    at gtklistbox.c line 1632
  • #18 gtk_list_box_select_and_activate_full
    at gtklistbox.c line 1774
  • #19 gtk_list_box_multipress_gesture_released
    at gtklistbox.c line 1972
  • #20 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #21 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #22 g_cclosure_marshal_generic_va
    at gclosure.c line 1604
  • #23 _g_closure_invoke_va
    at gclosure.c line 867
  • #24 g_signal_emit_valist
    at gsignal.c line 3300
  • #25 g_signal_emit
    at gsignal.c line 3447
  • #26 gtk_gesture_multi_press_end
    at gtkgesturemultipress.c line 282
  • #27 g_cclosure_marshal_VOID__BOXEDv
    at gmarshal.c line 1950
  • #28 _g_closure_invoke_va
    at gclosure.c line 867
  • #29 g_signal_emit_valist
    at gsignal.c line 3300
  • #30 g_signal_emit
    at gsignal.c line 3447
  • #31 _gtk_gesture_set_recognized
    at gtkgesture.c line 345
  • #32 _gtk_gesture_check_recognized
    at gtkgesture.c line 386
  • #33 gtk_gesture_handle_event
    at gtkgesture.c line 777
  • #34 gtk_gesture_single_handle_event
    at gtkgesturesingle.c line 221
  • #35 gtk_event_controller_handle_event
    at gtkeventcontroller.c line 230
  • #36 _gtk_widget_run_controllers
    at gtkwidget.c line 7358
  • #37 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 131
  • #38 _g_closure_invoke_va
    at gclosure.c line 867
  • #39 g_signal_emit_valist
    at gsignal.c line 3300
  • #40 g_signal_emit
    at gsignal.c line 3447
  • #41 gtk_widget_event_internal
    at gtkwidget.c line 7723
  • #42 propagate_event_up
    at gtkmain.c line 2557
  • #43 propagate_event
    at gtkmain.c line 2659
  • #44 gtk_main_do_event
    at gtkmain.c line 1890
  • #45 _gdk_event_emit
    at gdkevents.c line 73
  • #46 gdk_event_source_dispatch
    at gdkeventsource.c line 121
  • #47 g_main_dispatch
    at gmain.c line 3203
  • #48 g_main_context_dispatch
    at gmain.c line 3856
  • #49 g_main_context_iterate
    at gmain.c line 3929
  • #50 g_main_context_iteration
    at gmain.c line 3990
  • #51 g_application_run
    at gapplication.c line 2381
  • #52 main
    at src/gl-main.c line 39

Comment 1 Lionel Landwerlin 2017-01-03 14:44:19 UTC
Actually, clicking any items on the left-hand side list will trigger the crash.
Comment 2 Jonathan Kang 2017-01-04 08:59:54 UTC
(In reply to Lionel Landwerlin from comment #0)
> Here is the backtrace :
> 
> Thread 1 "gnome-logs" received signal SIGSEGV, Segmentation fault.
> __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
> 32	../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
> (gdb) bt

Could you please use the command "p boot_match" in gdb the time you get these
backtrace? It seems the first parameter passed to strchr is NULL.

I suppose you built Logs from codes in master branch. So could you revert
commit f78ec9f3b37cf5e0baff31de6971e697786ee02e and see if the problem is gone?

Thanks very much.
Comment 3 Lionel Landwerlin 2017-01-04 09:21:20 UTC
boot_match is NULL indeed.
Reverting f78ec9f3b37cf5e0baff31de6971e697786ee02e didn't fix the crash.
Comment 4 Jonathan Kang 2017-01-05 12:20:42 UTC
Created attachment 342945 [details] [review]
Patch for debugging

@Lionel

I added some debug information in this patch. Could you please apply this patch,
build Logs with it and attach the command line output here?

Thanks.
Comment 5 Lionel Landwerlin 2017-01-05 12:27:07 UTC
2 lines printed :

query_add_journal_range_filter
priv->boot_match: (null)
Comment 6 Jonathan Kang 2017-01-09 02:53:36 UTC
(In reply to Lionel Landwerlin from comment #5)
> 2 lines printed :
> 
> query_add_journal_range_filter
> priv->boot_match: (null)

I suppose this is the output after clicking the category list. Can you attach
all the output after running "jhbuild run gnome-logs"? That'll be much more
helpful.
Comment 7 Lionel Landwerlin 2017-01-09 11:11:03 UTC
There is no output prior to clicking the category list.
Comment 8 Jonathan Kang 2017-01-09 13:55:41 UTC
(In reply to Lionel Landwerlin from comment #7)
> There is no output prior to clicking the category list.

This is odd. I even add some g_print functions in gl_window_init() which defenitely
will run when Logs starts up.

Can you confirm you are using the latest codes, and the patch applies correctly?
It seems Logs you built is sort of "broken".
Comment 9 Lionel Landwerlin 2017-01-09 14:02:09 UTC
on_view_boot() is never called indeed.
When the application starts a blue banner shows "Unable to read system logs".
Comment 10 Lionel Landwerlin 2017-01-09 14:03:12 UTC
Indeed launching sudo gnome-logs works :/
Comment 11 Jonathan Kang 2017-01-09 14:21:53 UTC
(In reply to Lionel Landwerlin from comment #9)
> on_view_boot() is never called indeed.
> When the application starts a blue banner shows "Unable to read system logs".

Okay. This is because you don't have right access for system logs. And Logs don't handle this scenario very well.

Can you attach the screenshot when you open logs with normal user access?
Comment 12 Lionel Landwerlin 2017-01-09 14:27:15 UTC
Created attachment 343157 [details]
shot
Comment 13 Jonathan Kang 2017-01-09 14:37:44 UTC
Thanks for the report and information.

I can confirm this bug right now. It happens when users don't have access to system
logs. I'll generate a fix soon.
Comment 14 Jonathan Kang 2017-01-23 08:46:53 UTC
(In reply to Lionel Landwerlin from comment #12)
> Created attachment 343157 [details]
> shot

It's quite odd that you cannot even view logs from the current user. Is there
any output of "journalctl"?
Comment 15 Lionel Landwerlin 2017-01-23 14:33:01 UTC
$ journalctl 
Hint: You are currently not seeing messages from other users and the system.
      Users in the 'systemd-journal' group can see all messages. Pass -q to
      turn off this notice.
No journal files were opened due to insufficient permissions.

I guess on Debian by default users are not in the right groups.
Comment 16 Jonathan Kang 2017-01-24 03:18:21 UTC
Created attachment 344083 [details] [review]
Patch fixing crash

@Lionel

Could you please test this patch to see if it works?

Thanks.
Comment 17 Emilio Pozuelo Monfort 2017-02-05 19:57:36 UTC
This happens to me as well. It happens if there is no persistent logging, e.g. there's no /var/log/journal. Then you can't view your own journal.

With persistent journal you can view your own journal even if you can't view the system journal, and then gnome-logs doesn't crash.
Comment 18 Jonathan Kang 2017-02-06 09:34:06 UTC
Comment on attachment 344083 [details] [review]
Patch fixing crash

Pushed to master as commit a6145ed0ecc7dba8bacb4f8dc5055b27bb28ff09.
Comment 19 Jonathan Kang 2017-02-06 09:35:43 UTC
I tested with commit a6145ed0ecc7dba8bacb4f8dc5055b27bb28ff09 and this bug
is fixed. Close it as RESOLVED FIXED.