Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 352960 - net-misc/dhcpcd-5.2.8 is corrupting /var/lib/dhcpcd/dhcpcd-wlan0.lease
Summary: net-misc/dhcpcd-5.2.8 is corrupting /var/lib/dhcpcd/dhcpcd-wlan0.lease
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 13:25 UTC by ta2002
Modified: 2012-04-05 18:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ta2002 2011-01-27 13:25:00 UTC
This never happened before upgrading to 5.2.8. Now, it is happening
about one third of the time I boot.

Basically, there is a problem with /var/lib/dhcpcd/dhcpcd-wlan0.lease,
so when I try to start dhcpcd, I get something like this in /var/log/messages:

dhcpcd[3803]: version 5.2.8 starting
dhcpcd[3803]: wlan0: rebinding lease of 0.0.0.0
dhcpcd[3803]: wlan0: acknowledged from 192.168.0.1
dhcpcd[3803]: wlan0: leased 0.0.0.0 for 86400 seconds
dhcpcd[3803]: wlan0: router 0.0.0.0 requires a host route
dhcpcd[3803]: wlan0: router 192.168.0.1 requires a host route
dhcpcd[3803]: forked to background, child pid 3832

Obviously, I don't understand why the client wants 0.0.0.0 as an address.

The only way I know to work around this is to delete
/var/lib/dhcpcd/dhcpcd-wlan0.lease and restart dhcpcd.

This is not convenient for systems where users do no have root access.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-01-31 03:06:46 UTC
Please paste your `emerge --info' output in a comment.
Comment 2 ta2002 2011-01-31 11:23:37 UTC
(In reply to comment #1)
> Please paste your `emerge --info' output in a comment.

Portage 2.1.9.25 (default/linux/x86/10.0/desktop, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-i686-Intel-R-_Pentium-R-_III_Mobile_CPU_1000MHz-with-gentoo-1.12.14
Timestamp of tree: Mon, 31 Jan 2011 01:30:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -Os -pipe -fomit-frame-pointer -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=pentium3 -Os -pipe -fomit-frame-pointer -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acpi alsa ass audiofile berkdb bwscheduler bzip2 cairo caps cdio cjk client consolekit cracklib crypt css cups cxx dbus dga dhcp directfb djvu downloadorder dri dvd dvdnav ebook encode exceptions exif expat fam fbcon ffmpeg flac gallium gcj ggi gif glibc-omitfp gmp gphoto2 gpm gstreamer gtk hal handbook hardcoded-tables iconv idea imap imlib infowidget ipfilter ipv6 jabber javascript jbig joystick jpeg kde lcms libkms libnotify libwww live lm_sensors logviewer lzma mad matroska mbox mdns-bundled memlimit mmx mmxext mp3 mpeg mudflap mysql nas ncurses netapi network nls no-old-linux nodrm nptl nptlonly ntp ogg opengl openmedia openmp oscar osdmenu pango pcre pdf perl pm-utils png ps qt3support raptor readline redland rss rtc rtmp samba scanfolder scanner sdl search semantic-desktop sensord server shm silc smbclient smtp sndfile speex spell sse ssl stats svg sysfs tcpd theora threads threadsafe tiff timidity tremor truetype udev unicode upnp usb userlocales vcd vorbis webinterface wifi x86 xcb xinerama xml xorg xv xvid yahoo zlib zrtp" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="savage" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 William Hubbs gentoo-dev 2011-02-01 17:41:33 UTC
Hi,

the first thing that catches my eye is your CFLAGS, which appear to be unsafe. In particular, "-mfpmath=sse" should not be used.
I recommend changing them to something like:

CFLAGS="-march=native -O2 -pipe"

and rebuilding your system.

Also, can you please test with dhcpcd-5.2.10-r2 and see if you still get the issue? Please feel free to re-open and report back.

Thanks for the report.
Comment 4 ta2002 2011-02-04 12:29:29 UTC
(In reply to comment #3)
> the first thing that catches my eye is your CFLAGS, which appear to be unsafe.
> In particular, "-mfpmath=sse" should not be used.

The gcc manual states (about -mfpmath=sse):

"The resulting code should be considerably faster in the majority of
cases and avoid the numerical instability problems of 387 code,"

It is the default setting for x86_64. Please explain why you feel it
is unsafe for x86.

> I recommend changing them to something like:
> 
> CFLAGS="-march=native -O2 -pipe"

The -fomit-frame-pointer flag is specifically recommended by the
gentoo documentation (see http://en.gentoo-wiki.com/wiki/Safe_Cflags).

Also, the -Os flag is not discouraged (it is actually a subset of the
-O2 optimizations).

> Also, can you please test with dhcpcd-5.2.10-r2 and see if you
> still get the issue? Please feel free to re-open and report back.

I will try that, but do you have any reason to believe that the problem
has been fixed (since older dhcpcd versions have worked for years without
any difficulty, it seems reasonable to assume that changes in version 5
caused the problem)?
Comment 5 William Hubbs gentoo-dev 2011-02-04 20:23:14 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > the first thing that catches my eye is your CFLAGS, which appear to be unsafe.
> > In particular, "-mfpmath=sse" should not be used.
> The gcc manual states (about -mfpmath=sse):
> "The resulting code should be considerably faster in the majority of
> cases and avoid the numerical instability problems of 387 code,"
> It is the default setting for x86_64. Please explain why you feel it
> is unsafe for x86.

This is a new flag to me personally, and until I know something about cflags, I tend to suggest not using them. However, based on what the gcc manual says, it should be ok to use this.

> > I recommend changing them to something like:
> > 
> > CFLAGS="-march=native -O2 -pipe"
> The -fomit-frame-pointer flag is specifically recommended by the
> gentoo documentation (see http://en.gentoo-wiki.com/wiki/Safe_Cflags).

This site is an independent community based wiki, and not the official gentoo documentation. The official documentation is located at http://www.gentoo.org/doc/en/index.xml, and the document of interest for this bug is http://www.gentoo.org/doc/en/gcc-optimization.xml. However, it looks like this may need to be updated, at least wrt -fomit-frame-pointer.

You may not need to specify -fomit-frame-pointer; it may be enabled by default on your system. To check that, you can run this command:

gcc -Q -Os --help=opt | grep frame

> Also, the -Os flag is not discouraged (it is actually a subset of the
> -O2 optimizations).

Our documentation does discourage it unless you are in a situation where you really need it, but that may need to be updated also. I'm not an expert on the cflags, so I'm not sure about that.

If you think the optimization guide needs updates, please feel free to file a bug  against it.

> > Also, can you please test with dhcpcd-5.2.10-r2 and see if you
> > still get the issue? Please feel free to re-open and report back.
> I will try that, but do you have any reason to believe that the problem
> has been fixed (since older dhcpcd versions have worked for years without
> any difficulty, it seems reasonable to assume that changes in version 5
> caused the problem)?

If you test with dhcpcd-5.2.10-r2 and the issue goes away, that will close this bug, because that version is going stable soon.
Comment 6 ta2002 2011-03-29 06:54:54 UTC
(In reply to comment #3)
> Also, can you please test with dhcpcd-5.2.10-r2 and see if you still get the
> issue? Please feel free to re-open and report back.

I have upgraded to dhcpcd-5.2.10-r2, and am still having this problem, but (thanks to a small piece of dumb luck), I have discovered that the problem seems to be coming from somewhere else.

This problem is particularly likely to happen if something does not get shut down "cleanly." Earlier today, the network router went offline for a few minutes with a problem. When it came back up, EVERY dhcp machine on the network had this problem, and I had to spend a significant amount of time physically going to each machine to erase /var/lib/dhcpcd/dhcpcd-wlan0.lease.

One machine however, had a gentoo live dvd in it. It had the same problem, BUT it is was using dhclient instead of dhcpcd, so I had to erase /var/lib/dhcp/dhclient.leases to get the machine to take an address other than 0.0.0.0.

So, with the file there, we get this in the log when attempting to reconnect:

dhclient: Listening on LPF/wlan0/01:23:45:67:89:ab
dhclient: Sending on   LPF/wlan0/01:23:45:67:89:ab
dhclient: Sending on   Socket/fallback
dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
dhclient: DHCPACK from 192.168.0.1
dhclient: bound to 0.0.0.0 -- renewal in 36489 seconds.


And, erasing the file gives us a successful connection:

dhclient: Listening on LPF/wlan0/01:23:45:67:89:ab
dhclient: Sending on   LPF/wlan0/01:23:45:67:89:ab
dhclient: Sending on   Socket/fallback
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
dhclient: DHCPOFFER from 192.168.0.1
dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
dhclient: DHCPACK from 192.168.0.1
avahi-daemon[9548]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.2.
avahi-daemon[9548]: New relevant interface wlan0.IPv4 for mDNS.
avahi-daemon[9548]: Registering new address record for 192.168.0.2 on wlan0.IPv4.
avahi-daemon[9548]: Withdrawing address record for 192.168.0.2 on wlan0.
avahi-daemon[9548]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.2.
avahi-daemon[9548]: Interface wlan0.IPv4 no longer relevant for mDNS.
avahi-daemon[9548]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.2.
avahi-daemon[9548]: New relevant interface wlan0.IPv4 for mDNS.
avahi-daemon[9548]: Registering new address record for 192.168.0.2 on wlan0.IPv4.
dhclient: bound to 192.168.0.2 -- renewal in 35980 seconds.

Obviously with the live dvd, everything was compiled "correctly," and there are no unusual (non-default) options set. Perhaps the addition log messages from the other dhcp client will help you track down the cause of this.
Comment 7 ta2002 2011-03-29 23:31:22 UTC
The /var/lib/dhcp/dhclient.leases file (plain text) is much more informative than the binary dhcpcd-wlan0.lease file.

From the machine running the gentoo live dvd (in its broken state):

$ cat var/lib/dhcp/dhclient.leases
lease {
  interface "wlan0";
  fixed-address 192.168.0.2;
  option subnet-mask 255.255.255.224;
  option dhcp-lease-time 86400;
  option routers 192.168.0.1;
  option dhcp-message-type 5;
  option dhcp-server-identifier 192.168.0.1;
  option domain-name-servers 192.168.0.1;
  option domain-name "my.domain";
  renew 2 2011/03/29 15:14:06;
  rebind 3 2011/03/30 02:14:26;
  expire 3 2011/03/30 05:14:26;
}
lease {
  interface "wlan0";
  fixed-address 0.0.0.0;
  option subnet-mask 255.255.255.224;
  option routers 192.168.0.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.0.1;
  option dhcp-server-identifier 192.168.0.1;
  option domain-name "my.domain";
  renew 2 2011/03/29 20:20:53;
  rebind 3 2011/03/30 08:09:49;
  expire 3 2011/03/30 11:09:49;
}
Comment 8 William Hubbs gentoo-dev 2012-04-05 18:03:01 UTC
Please update to dhcpcd-5.5.6 and let us know if this still is an issue.