GNOME Bugzilla – Bug 755327
Logs force quit while the field value in search text is a number
Last modified: 2015-09-22 10:51:14 UTC
If field_value of search text is a number, for example "_MESSAGE=628" or "_COMM=systemd _MESSAGE=25", Logs will force stop.
Created attachment 311733 [details] [review] patch for this bug
Review of attachment 311733 [details] [review]: ::: src/gl-eventviewlist.c @@ +157,2 @@ g_scanner_get_next_token (scanner); + if (scanner->token == G_TOKEN_INT) Does this also deal with other token types, such as G_TOKEN_HEX and G_TOKEN_FLOAT?
Review of attachment 311733 [details] [review]: Yes, this is good. However, there are more unchecked uses of v_identifier in that file. Please always check the token type before accessing the union, otherwise we might see more crashes like this. More generally, why is gnome-logs doing the matching itself? I think it would be much more efficient to let the journal do the matching (it has indices for many fields).
Created attachment 311744 [details] [review] patch updated
Review of attachment 311744 [details] [review]: Works for me! Pushed to master as commit 5e18cf0c9ca2c3146e7a58bd0ccc42386e1c4290.
(In reply to Lars Uebernickel from comment #3) > More generally, why is gnome-logs doing the matching itself? I think it > would be much more efficient to let the journal do the matching (it has > indices for many fields). It has always done so, by using the filtering and sorting in GtkListBox. It was the simplest approach at the time, but now that GListModel is used, we should be using the journal APIs (so that we can search for items that are not shown in the list box, at the very least).