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 789030 - Segmentation fault after g_type_create_instance call on startup
Segmentation fault after g_type_create_instance call on startup
Status: RESOLVED DUPLICATE of bug 788716
Product: gnome-control-center
Classification: Core
Component: shell
3.26.x
Other Linux
: High critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-15 20:36 UTC by Andre Esteve
Modified: 2017-11-02 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stack trace (11.60 KB, text/plain)
2017-10-15 20:36 UTC, Andre Esteve
  Details
Stack trace with debug symbols (5.58 KB, text/plain)
2017-10-17 05:47 UTC, Andre Esteve
  Details
Patch for prevent NULL deference (671 bytes, patch)
2017-10-17 06:21 UTC, Andre Esteve
none Details | Review
Crash when clicking on the Network tab (7.51 KB, text/plain)
2017-10-17 06:26 UTC, Andre Esteve
  Details
Patch for prevent NULL deference (1.44 KB, patch)
2017-10-17 06:31 UTC, Andre Esteve
none Details | Review

Description Andre Esteve 2017-10-15 20:36:59 UTC
Created attachment 361643 [details]
Stack trace

Invoking the gnome-control-center process crashes with SEGFAULT when opening from the shell or UI.

I have the following version of these components:

Name            : gnome-control-center
Version         : 3.26.1-1

Name            : glib2
Version         : 2.54.1-2


Example of shell output:

[andre@scout ~]$ gnome-control-center 
(gnome-control-center:4018): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(gnome-control-center:4018): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(gnome-control-center:4018): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(gnome-control-center:4018): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(gnome-control-center:4018): libnm-CRITICAL **: ((libnm/nm-client.c:810)): assertion '<dropped>' failed
Segmentation fault (core dumped)

Please let me know what other details would be helpful.
Comment 1 Rui Matos 2017-10-16 16:19:14 UTC
Can you install debug symbols for gnome-control-center and NetworkManager and get a new stack trace?
Comment 2 Andre Esteve 2017-10-17 05:47:15 UTC
Created attachment 361706 [details]
Stack trace with debug symbols
Comment 3 Andre Esteve 2017-10-17 05:57:04 UTC
(In reply to Rui Matos from comment #1)
> Can you install debug symbols for gnome-control-center and NetworkManager
> and get a new stack trace?

Attached a new one. I built from the git master branch at commit 956532132.
I still need to find and build network manager, but from what I get so far, looks like nm_client_get_devices() returns NULL and the segfault occurs when defering it at load_wifi_devices().
Comment 4 Andre Esteve 2017-10-17 06:21:13 UTC
Created attachment 361707 [details] [review]
Patch for prevent NULL deference

Sorry for the message spam, I am still learning bugzilla.

I'm attaching the diff that I made locally to NULL-check the return of nm_client_get_devices() to prevent the NULL deference.

With this, gnome-control-center works fine, with the exception of the WiFi tab showing a frowny face saying "Oops something went wrong ... NetworkManager needs to be running". Which seems fair - I think I don't have NM running - I don't think I even installed it, at least explicitly. Could this be related with the NULL returned by the mn call?
Comment 5 Andre Esteve 2017-10-17 06:26:14 UTC
Created attachment 361708 [details]
Crash when clicking on the Network tab

I spoke too soon. When I click on the Network tab, I got another segfault. Seems to be a similar issue. Adding call stack.
Comment 6 Andre Esteve 2017-10-17 06:31:03 UTC
Created attachment 361711 [details] [review]
Patch for prevent NULL deference

Updating patch attachment to include NULL check on the result of nm_client_get_connections() when adding connections.

With this, clicking on the network tab doesn't crash anymore. It shows that the NetworkManager needs to be running message.

Previous versions of control center never gave me any troubles, and I don't believe I ever had NM installed on this system.

Possibly in the past these nm_* calls would return a non-NULL pointer that would have ->len member set to 0, then those for loops would simply not execute. Maybe this issue is actually on the NM library that now returns NULL if NM is not running?
Comment 7 Andre Esteve 2017-10-25 03:33:19 UTC
Not sure if I am supposed to change status?
Comment 8 Rui Matos 2017-11-01 13:20:23 UTC
(In reply to Andre Esteve from comment #6)
> Possibly in the past these nm_* calls would return a non-NULL pointer that
> would have ->len member set to 0, then those for loops would simply not
> execute. Maybe this issue is actually on the NM library that now returns
> NULL if NM is not running?

Might be. What's you NM library version?
Comment 9 Andre Esteve 2017-11-02 05:37:01 UTC
(In reply to Rui Matos from comment #8)
> (In reply to Andre Esteve from comment #6)
> > Possibly in the past these nm_* calls would return a non-NULL pointer that
> > would have ->len member set to 0, then those for loops would simply not
> > execute. Maybe this issue is actually on the NM library that now returns
> > NULL if NM is not running?
> 
> Might be. What's you NM library version?

Name            : libnm
Version         : 1.8.4-1
Description     : NetworkManager client library
Comment 10 Andre Esteve 2017-11-02 05:53:32 UTC
I updated today to gnome-control-center 3.26.2-1 and the issue is gone.
libnm has been on 1.8.4-1 on my box since October, so likely not there where the issue was.

Anyways, I think we can close this bug, since 3.26.2-1 doesn't crash.

Thank you!
Comment 11 Rui Matos 2017-11-02 09:46:13 UTC

*** This bug has been marked as a duplicate of bug 788716 ***