GNOME Bugzilla – Bug 776818
Crash when accessing applications logs
Last modified: 2017-02-06 09:35:43 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
+ Trace 237034
Actually, clicking any items on the left-hand side list will trigger the crash.
(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.
boot_match is NULL indeed. Reverting f78ec9f3b37cf5e0baff31de6971e697786ee02e didn't fix the crash.
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.
2 lines printed : query_add_journal_range_filter priv->boot_match: (null)
(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.
There is no output prior to clicking the category list.
(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".
on_view_boot() is never called indeed. When the application starts a blue banner shows "Unable to read system logs".
Indeed launching sudo gnome-logs works :/
(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?
Created attachment 343157 [details] shot
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.
(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"?
$ 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.
Created attachment 344083 [details] [review] Patch fixing crash @Lionel Could you please test this patch to see if it works? Thanks.
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 on attachment 344083 [details] [review] Patch fixing crash Pushed to master as commit a6145ed0ecc7dba8bacb4f8dc5055b27bb28ff09.
I tested with commit a6145ed0ecc7dba8bacb4f8dc5055b27bb28ff09 and this bug is fixed. Close it as RESOLVED FIXED.