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 743700 - [PATCH] nm-dhcp-client.c:295nm_dhcp_client_set_state assertion failed
[PATCH] nm-dhcp-client.c:295nm_dhcp_client_set_state assertion failed
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: Wi-Fi
1.0.x
Other Linux
: Normal major
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-29 14:36 UTC by Dan Milon
Modified: 2015-05-27 08:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
network manager connection configuration file (414 bytes, text/plain)
2015-01-29 14:36 UTC, Dan Milon
  Details
syslog output while crash happened (5.77 KB, text/plain)
2015-01-29 14:40 UTC, Dan Milon
  Details
core dump of network manager that was generated after the assertion error (502.13 KB, application/octet-stream)
2015-01-29 14:47 UTC, Dan Milon
  Details
0001-dhcp-gracefully-recover-from-failed-DHCP-BOUND-state.patch (2.18 KB, patch)
2015-01-29 19:06 UTC, Dan Williams
none Details | Review

Description Dan Milon 2015-01-29 14:36:55 UTC
Created attachment 295757 [details]
network manager connection configuration file

While trying to connect to a WPA2 protected wifi network, network manager crashes.
Comment 1 Dan Milon 2015-01-29 14:38:07 UTC
Attached are the network manager configuration file and the syslog output.
Comment 2 Dan Milon 2015-01-29 14:40:03 UTC
Created attachment 295758 [details]
syslog output while crash happened
Comment 3 Dan Milon 2015-01-29 14:47:35 UTC
Created attachment 295764 [details]
core dump of network manager that was generated after the assertion error
Comment 4 Dan Winship 2015-01-29 15:20:38 UTC
looks like this is another dhcpcd backend bug :-/

workaround: install dhclient
Comment 5 Dan Milon 2015-01-29 15:31:01 UTC
Indeed, with dhclient it worked as expected.
Comment 6 Dan Williams 2015-01-29 18:10:53 UTC
What version of dhcpcd do you have?
Comment 7 Dan Milon 2015-01-29 18:22:11 UTC
$ dhcpcd --version
dhcpcd 6.6.7
Comment 8 Dan Williams 2015-01-29 19:05:29 UTC
It appears that dhcpcd is attempting to get an IPv6 lease, when NetworkManager is trying to launch it in IPv4-only mode (since you don't have IPv6 enabled for this connection).

NM *should* be passing the "-4" option to dhcpcd, but it looks like that may not be happening in your case, possibly due to configure-time logic problems.
Comment 9 Dan Williams 2015-01-29 19:06:00 UTC
Created attachment 295776 [details] [review]
0001-dhcp-gracefully-recover-from-failed-DHCP-BOUND-state.patch
Comment 10 Lubomir Rintel 2015-02-07 16:40:44 UTC
+			if (ip_config == NULL) {
+				g_warn_if_fail (ip_config != NULL);

This looks a bit weird. I guess you're using g_warn_if_fail() and not g_assert_not_reached() so that the condition that led to the warning gets logged too? Maybe nm_log_warn() might make more sense?

Overall LGTM
Comment 11 Dan Williams 2015-02-17 14:55:08 UTC
Converted that to a nm_log_warn() and pushed.

511a7395bff0253f8d1e0d7f35849151d9caa98f master
7daf63461de4195b1626ca15f835fc7cbc56e847 nm-1-0
416cd4ff709b7228ba28765991ea256c9484ac74 nm-0-9-10 (configure.ac bits only)
Comment 12 joakim.tjernlund 2015-05-25 21:38:00 UTC
This patch broke NM 1.0.2:

$ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --docdir=/usr/share/doc/networkmanager-1.0.2 --disable-maintainer-mode --disable-gtk-doc --disable-more-warnings --disable-static --localstatedir=/var --disable-lto --disable-config-plugin-ibft --disable-ifnet --without-netconfig --with-dbus-sys-dir=/etc/dbus-1/system.d --with-udev-dir=/lib/udev --with-config-plugins-default=keyfile --with-iptables=/sbin/iptables --with-libsoup=yes --enable-concheck --with-crypto=gnutls --with-session-tracking=consolekit --with-suspend-resume=upower --enable-bluez5-dun --enable-introspection --enable-ppp --disable-wimax --without-dhclient --with-dhcpcd --without-modem-manager-1 --with-nmtui --with-resolvconf --without-selinux --disable-teamdctl --disable-tests --enable-vala --without-valgrind --with-wext --with-pppd-plugin-dir=/usr/lib64/pppd/2.4.7

....

configure:23483: checking for dhcpcd
configure:23502: found /sbin/dhcpcd
configure:23514: result: /sbin/dhcpcd
configure:23528: WARNING: Cannot use dhcpcd, version 4.x or higher is required
configure:23540: WARNING: Could not find a suitable DHCP client, falling back to dhclient

for some reason autoconf strips [ so [[ becomes [ in configure
Comment 13 joakim.tjernlund 2015-05-25 21:46:04 UTC
Futhermore, runtime tests like dhcpcd --version breaks cross compile.
You should have some easy way avoid the runtime tests.
Also, dhcpcd can be complied with or without IPv6 so testin for
dhcpcd version is not enough to claim IPv6 support.
Comment 14 Thomas Haller 2015-05-26 10:16:17 UTC
(reopening based on comment 12)
Comment 15 Thomas Haller 2015-05-27 08:25:54 UTC
The error in the configure script is fixed by

http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6baca260d11b4c2f92e8765ff0f66786e507022a


As discussed in https://mail.gnome.org/archives/networkmanager-list/2015-May/msg00068.html , we might detect v6 support at runtime.
Comment 16 Thomas Haller 2015-05-27 08:45:19 UTC
(In reply to joakim.tjernlund from comment #13)
> Futhermore, runtime tests like dhcpcd --version breaks cross compile.
> You should have some easy way avoid the runtime tests.
> Also, dhcpcd can be complied with or without IPv6 so testin for
> dhcpcd version is not enough to claim IPv6 support.

See bug 749946