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 780640 - crash in gupnp_root_device_constructor()
crash in gupnp_root_device_constructor()
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-28 07:39 UTC by Sven Neumann
Modified: 2017-04-30 04:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avoid the crash by leeting the GUPnPRootDevice construction fail (3.67 KB, patch)
2017-03-28 07:46 UTC, Sven Neumann
committed Details | Review
patch for gupnp-1.0 branch (2.53 KB, patch)
2017-03-28 08:52 UTC, Sven Neumann
committed Details | Review

Description Sven Neumann 2017-03-28 07:39:19 UTC
We are seeing crashes in gupnp_root_device_constructor(). The crash occurs if the network interface that GUPnPContext uses is not any longer usable. There is a race here. The context manager may not have taken the context down yet, but the network interface is already not any longer usable. Let me show you this in a log excerpt:


Mar 28 01:23:59 daemon.info connmand[143]: wlan0 {add} address 192.168.0.14/24 label wlan0 family 2
Mar 28 01:23:59 daemon.info connmand[143]: wlan0 {add} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK>
Mar 28 01:23:59 daemon.info connmand[143]: wlan0 {add} route 192.168.0.1 gw 0.0.0.0 scope 253 <LINK>
Mar 28 01:23:59 daemon.info connmand[143]: wlan0 {add} route 0.0.0.0 gw 192.168.0.1 scope 0 <UNIVERSE>
Mar 28 01:24:00 daemon.notice wpa_supplicant[150]: wlan0: CTRL-EVENT-DISCONNECTED bssid=cc:35:40:77:64:60 reason=7
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {update} flags 36867 <UP>
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {newlink} index 5 address FC:C2:DE:FA:58:3C mtu 1500
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {newlink} index 5 operstate 2 <DOWN>
Mar 28 01:24:00 user.notice raumfeld: ** (master-process:200): WARNING **: GUPnPContext: Unable to listen on 192.168.0.14:0 Could not listen on address 192.168.0.14, port 0
Mar 28 01:24:00 user.notice raumfeld: (master-process:200): libsoup-WARNING **: (soup-uri.c:627):soup_uri_copy: runtime check failed: (SOUP_URI_IS_VALID (uri))
Mar 28 01:24:00 user.notice raumfeld: (master-process:200): Caught signal 11
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {del} address 192.168.0.14/24 label wlan0
Mar 28 01:24:00 daemon.notice wpa_supplicant[150]: wlan0: No network configuration found for the current AP
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {del} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK>
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {RX} 33922 packets 29145588 bytes
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {TX} 56205 packets 16843513 bytes
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {newlink} index 5 address FC:C2:DE:FA:58:3C mtu 1500
Mar 28 01:24:00 daemon.info connmand[143]: wlan0 {newlink} index 5 operstate 5 <DORMANT>


As you can see the network interface comes up, a new GUPnPContext is created, but at the time the GUPnPRootDevice should be brought up the link is already down again and gupnp_context_get_server() returns NULL because soup_server_listen() failed.
Comment 1 Sven Neumann 2017-03-28 07:46:45 UTC
Created attachment 348864 [details] [review]
avoid the crash by leeting the GUPnPRootDevice construction fail
Comment 2 Sven Neumann 2017-03-28 08:52:29 UTC
Created attachment 348868 [details] [review]
patch for gupnp-1.0 branch