Description of problem:
Gnome session hung and gnome-shell dumped a core. The crash is because of null in source_device passed to _clutter_input_device_reset_scroll_info() in clutter-device-manager-xi2.c.
Version-Release number of selected component (if applicable):
1.20.0 and higher.
One time occurrence only. Steps Not provided by the customer.
Gnome session hung and gnome-shell dumped a core.
The NULL values to be checked in clutter-device-manager-xi2.c, which resolves the problem.
I have created a patch in the upstream: https://bugzilla.gnome.org/show_bug.cgi?id=778807. I'm working on the patch for RHEL 7.2.
(In reply to Jos Collin from comment #0)
> I'm working on the patch for RHEL 7.2.
Please ignore this statement in the above Additional info.
@Keigo We have already discussed this via email how to proceed.
Today, we have a bi-weekly meeting with HPE-Japan.
In this meeting, we think the code in the clutter doesn't follow an usual practice, NULL check.
From gnome developer guide, g_hash_table_lookup() will return NULL if the key is not found.
g_hash_table_lookup (GHashTable *hash_table,
Looks up a key in a GHashTable. Note that this function cannot distinguish between a key that is not present and one which is present and has the value NULL. If you need this distinction, use g_hash_table_lookup_extended().
hash_table : a GHashTable
key : the key to look up
the associated value, or NULL if the key is not found.
In clutter code, there are so many places which doesn't check whether the pointer is NULL or not.
HPE and I think that the code should have NULL check code like fopen(), malloc() in C code to confirm whether the function returns expected pointer or not before pass it to latter part of the code.
Current code looks too optimistic regarding the return value of g_has_table_lookup().
Actually, NULL reference check in another part of the function, clutter_device_manager_xi2_translate_event() was merged.
So, we think that introducing null check for every g_has_table_lookup() looks usual fix.
How do you think about it?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.