User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Jessie segfaults with dhcpcd

Thu Dec 08, 2016 10:38 am

I tried to study the dhcpcd a bit to see how it works.

A single static address works ok with

Code: Select all

interface eth0
static ip_address=192.168.0.14/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254
Then I decided to try the goodies with arping and profiles.

Code: Select all

interface eth0
arping 192.168.0.254

profile 192.168.0.14
static ip_address=192.168.0.14/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254
This fails. A closer look to repositories showed that the packet arping is missing from the jessie-lite distribution.

After including this it still fails.

So I added some more options and a fallback profile.

Code: Select all

interface eth0
arping 192.168.0.254
arping 10.88.0.146
fallback stm

profile 192.168.0.14
static ip_address=192.168.0.14/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254

profile 10.88.0.146
static ip_address=10.88.0.14/16
static routers=10.88.0.146
static domain_name_servers=8.8.8.8

profile stm
static ip_address=81.16.76.76/29
static routers=81.16.76.74
static domain_name_servers=8.8.8.8
Does not work either. So I decided to run this code manually.

Code: Select all

sudo dhcpcd -k
sudo dhcpcd
The code actually crashes.

I then tried to run it using gdb and the stack gets corrupted.

This software does not seem to be up to prime time yet. A bad decision to introduce it to Raspbian at this stage.

Or perhaps I do something terribly wrong?

The distro is from 2016-11-25 and my Pi is a B model (the old one with 26 pins).

The command "arping 10.88.0.146" works as it should.
Last edited by karrika on Thu Dec 15, 2016 5:20 am, edited 4 times in total.

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Jessie has no arping and dhcpcd is not mature imho

Sat Dec 10, 2016 11:19 am

I just tried to use arping on the full Jessie image. It does not contain arping either.

Has anyone ever got dhcpcd to work with arping on a Raspberry Pi? If you have a working example with two different arping/profile combinations I would love to get the dhcpcd.conf file for replicating the behaviour on my Raspberry Pi.

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Jessie has no arping and dhcpcd is not mature imho

Sat Dec 10, 2016 3:06 pm

For some unknown reason this works with Raspberry Pi 3. Both the arping and profile are ok. But packet arping is not even installed...

I am completely puzzled now...

Code: Select all

denyinterfaces wlan0

interface eth0
arping 10.88.0.146
arping 192.168.0.254
fallback stm

profile 10.88.0.146
static ip_address=10.88.0.6/16
static routers=10.88.0.146
static domain_name_servers=8.8.8.8

profile 192.168.0.254
static ip_address=192.168.0.6/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254

profile stm
static ip_address=10.99.0.6/16
static routers=10.99.0.146
static domain_name_servers=8.8.8.8

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Jessie-lite problems with dhcpcd

Thu Dec 15, 2016 5:20 am

After a reboot even Raspberry Pi 3 just crashes.

Code: Select all

root@raspberrypi:/home/karri# dhcpcd
dhcpcd[1637]: control_open: Connection refused
dhcpcd[1637]: version 6.7.1 starting
dhcpcd[1637]: dev: loaded udev
dhcpcd[1637]: DUID 00:01:00:01:1e:dc:11:9b:00:e0:4c:53:44:58
dhcpcd[1637]: eth0: IAID eb:78:65:a3
dhcpcd[1637]: eth0: IAID eb:78:65:a3
dhcpcd[1637]: eth0: IAID eb:78:65:a3
dhcpcd[1637]: eth0: soliciting an IPv6 router
dhcpcd[1637]: eth0: soliciting a DHCP lease
dhcpcd[1637]: eth0: hardware address 00:0d:b9:28:15:58 claims 192.168.0.254
dhcpcd[1637]: eth0: selected profile 192.168.0.254
dhcpcd[1637]: eth0: IAID eb:78:65:a3
Segmentation fault

User avatar
pi-anazazi
Posts: 745
Joined: Fri Feb 13, 2015 9:22 pm
Location: EU

Re: Jessie segfaults with dhcpcd

Thu Dec 15, 2016 10:48 am

DHCP and raspian are no good friends, huh?

viewtopic.php?f=28&t=156650&p=1022085#p1022085
Kind regards

anazazi

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Jessie segfaults with dhcpcd

Thu Dec 15, 2016 11:03 am

Right....

I should gather some energy, compile everything from sources, fix the segfaults, send patches to the maintainer.

But I just don't have the energy to do it today. Perhaps tomorrow.

User avatar
pi-anazazi
Posts: 745
Joined: Fri Feb 13, 2015 9:22 pm
Location: EU

Re: Jessie segfaults with dhcpcd

Thu Dec 15, 2016 1:03 pm

...wish I would know how to do things like that, have no idea, though. ;-)

Would be great to see networking improving in raspian!
Kind regards

anazazi

ViktorP
Posts: 1
Joined: Wed Jan 18, 2017 9:16 am

Re: Jessie segfaults with dhcpcd

Wed Jan 18, 2017 3:01 pm

Well, after distro-upgrade today (2017/01/18) the situation with Raspberry Pi 2 got better but not still fully functional. When running dhcpcd manually, it works great even with arping. But when dhcpcd is run during boot sequence, it still have Segmentation Fault error. See my sessions:
First, Raspberry is restarted with Ethernet cable unplugged (fallback is used):
Using username "pi".
pi@placevik-raspi's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jan 18 15:17:18 2017
pi@placevik-raspi:~ $ su - viktor
Password:
root@placevik-raspi:~ # uname -a
Linux placevik-raspi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux
root@placevik-raspi:~ # cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


root@placevik-raspi:~ # cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

timeout 5

interface eth0
arping 192.168.137.1
#arping 192.168.1.1
fallback nodhcp

profile 192.168.137.1
static ip_address=192.168.137.2/24
static routers=192.168.137.1
static domain_name_servers=192.168.137.1

profile 192.168.1.1
static ip_address=192.168.1.3/24

profile nodhcp
static ip_address=192.168.1.2/24


root@placevik-raspi:~ # journalctl -u dhcpcd
-- Logs begin at Wed 2017-01-18 15:17:02 CET, end at Wed 2017-01-18 15:19:50 CET. --
Jan 18 15:17:09 placevik-raspi systemd[1]: Starting dhcpcd on all interfaces...
Jan 18 15:17:09 placevik-raspi dhcpcd[342]: version 6.7.1 starting
Jan 18 15:17:09 placevik-raspi dhcpcd[342]: dev: loaded udev
Jan 18 15:17:10 placevik-raspi dhcpcd[342]: eth0: adding address fe80::f910:fdcd:5759:5387
Jan 18 15:17:10 placevik-raspi dhcpcd[342]: forked to background, child pid 362
Jan 18 15:17:11 placevik-raspi systemd[1]: Started dhcpcd on all interfaces.
Jan 18 15:17:14 placevik-raspi dhcpcd[362]: eth0: waiting for carrier
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: carrier acquired
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: DUID 00:01:00:01:1f:cb:3a:e4:b8:27:eb:a8:1f:3a
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:49 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:49 placevik-raspi dhcpcd[362]: eth0: soliciting a DHCP lease
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: selected profile nodhcp
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: using static address 192.168.1.2/24
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: adding route to 192.168.1.0/24
Jan 18 15:18:06 placevik-raspi dhcpcd[362]: eth0: no IPv6 Routers available
~
~
root@placevik-raspi:~ # echo Now, starting Windows 10 Internet Connection Sharing
Now, starting Windows 10 Internet Connection Sharing
With start of Window 10 ICS Ethernet address range changed to 192.168.137.x/24 so the session was interrupted. But disconnecting a reconnecting patch cable the dhcpcd correctly applied arping and assigned IP address:
Using username "pi".
pi@placevik-raspi's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jan 18 15:18:30 2017 from 192.168.1.1
pi@placevik-raspi:~ $ su - viktor
Password:
root@placevik-raspi:~ # journalctl -u dhcpcd
-- Logs begin at Wed 2017-01-18 15:17:02 CET, end at Wed 2017-01-18 15:28:06 CET. --
Jan 18 15:17:09 placevik-raspi systemd[1]: Starting dhcpcd on all interfaces...
Jan 18 15:17:09 placevik-raspi dhcpcd[342]: version 6.7.1 starting
Jan 18 15:17:09 placevik-raspi dhcpcd[342]: dev: loaded udev
Jan 18 15:17:10 placevik-raspi dhcpcd[342]: eth0: adding address fe80::f910:fdcd:5759:5387
Jan 18 15:17:10 placevik-raspi dhcpcd[342]: forked to background, child pid 362
Jan 18 15:17:11 placevik-raspi systemd[1]: Started dhcpcd on all interfaces.
Jan 18 15:17:14 placevik-raspi dhcpcd[362]: eth0: waiting for carrier
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: carrier acquired
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: DUID 00:01:00:01:1f:cb:3a:e4:b8:27:eb:a8:1f:3a
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:48 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:49 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:49 placevik-raspi dhcpcd[362]: eth0: soliciting a DHCP lease
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: selected profile nodhcp
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: using static address 192.168.1.2/24
Jan 18 15:17:54 placevik-raspi dhcpcd[362]: eth0: adding route to 192.168.1.0/24
Jan 18 15:18:06 placevik-raspi dhcpcd[362]: eth0: no IPv6 Routers available
Jan 18 15:25:19 placevik-raspi dhcpcd[362]: eth0: carrier lost
Jan 18 15:25:19 placevik-raspi dhcpcd[362]: eth0: deleting address fe80::f910:fdcd:5759:5387
Jan 18 15:25:19 placevik-raspi dhcpcd[362]: eth0: deleting route to 192.168.1.0/24
Jan 18 15:25:21 placevik-raspi dhcpcd[362]: eth0: carrier acquired
Jan 18 15:25:21 placevik-raspi dhcpcd[362]: eth0: adding address fe80::f910:fdcd:5759:5387
Jan 18 15:25:21 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:25:21 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:25:21 placevik-raspi dhcpcd[362]: eth0: soliciting a DHCP lease
Jan 18 15:25:26 placevik-raspi dhcpcd[362]: eth0: offered 192.168.137.57 from 192.168.137.1
Jan 18 15:25:31 placevik-raspi dhcpcd[362]: eth0: leased 192.168.137.57 for 604800 seconds
Jan 18 15:25:31 placevik-raspi dhcpcd[362]: eth0: adding route to 192.168.137.0/24
Jan 18 15:25:31 placevik-raspi dhcpcd[362]: eth0: adding default route via 192.168.137.1
Jan 18 15:25:34 placevik-raspi dhcpcd[362]: eth0: hardware address 00:d0:59:81:eb:90 claims 192.168.137.1
Jan 18 15:25:34 placevik-raspi dhcpcd[362]: eth0: selected profile 192.168.137.1
Jan 18 15:25:34 placevik-raspi dhcpcd[362]: eth0: IAID eb:a8:1f:3a
Jan 18 15:25:35 placevik-raspi dhcpcd[362]: eth0: soliciting an IPv6 router
Jan 18 15:25:35 placevik-raspi dhcpcd[362]: eth0: using static address 192.168.137.2/24
Jan 18 15:25:35 placevik-raspi dhcpcd[362]: eth0: changing route to 192.168.137.0/24
Jan 18 15:25:35 placevik-raspi dhcpcd[362]: eth0: changing default route via 192.168.137.1
Jan 18 15:25:36 placevik-raspi dhcpcd[362]: eth0: removing route to 192.168.137.0/24
Jan 18 15:25:36 placevik-raspi dhcpcd[362]: eth0: removing default route via 192.168.137.1
Jan 18 15:26:57 placevik-raspi dhcpcd[362]: eth0: no IPv6 Routers available
root@placevik-raspi:~ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:a8:1f:3a brd ff:ff:ff:ff:ff:ff
inet 192.168.137.2/24 brd 192.168.137.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::f910:fdcd:5759:5387/64 scope link
valid_lft forever preferred_lft forever
root@placevik-raspi:~ #
Up to now, everything is working fine. Now, I will restart Raspberry Pi with Ethernet cable connected. So, the situation should be the same like in previous session.
But... I cannot connect to Raspberry... Ethernet cable plug/unplug does not help. What is happening?
OK. I am restarting Raspberry with Ethernet cable disconnected. When it aplly fallback static address (one minute?) I am connecting the Ethernet cable and opening a SSH session:
Using username "pi".
pi@placevik-raspi's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jan 18 15:17:18 2017
pi@placevik-raspi:~ $ su - viktor
Password:
root@placevik-raspi:~ # journalctl --list-boots
0 1d0c87e9732b471b832432f1fbe325fd Wed 2017-01-18 15:17:02 CET—Wed 2017-01-18 1 5:20:40 CET
root@placevik-raspi:~ # grep dhcpcd /var/log/syslog |tail -n 40
Jan 18 15:18:08 placevik-raspi dhcpcd[360]: eth0: carrier acquired
Jan 18 15:18:08 placevik-raspi dhcpcd[360]: DUID 00:01:00:01:1f:cb:3a:e4:b8:27:eb:a8:1f:3a
Jan 18 15:18:08 placevik-raspi dhcpcd[360]: eth0: IAID eb:a8:1f:3a
Jan 18 15:18:08 placevik-raspi dhcpcd[360]: eth0: soliciting an IPv6 router
Jan 18 15:18:08 placevik-raspi dhcpcd[360]: eth0: IAID eb:a8:1f:3a
Jan 18 15:18:09 placevik-raspi dhcpcd[360]: eth0: rebinding lease of 192.168.137.57
Jan 18 15:18:09 placevik-raspi dhcpcd[360]: eth0: soliciting an IPv6 router
Jan 18 15:18:09 placevik-raspi dhcpcd[360]: eth0: hardware address 00:d0:59:81:eb:90 claims 192.168.137.1
Jan 18 15:18:09 placevik-raspi dhcpcd[360]: eth0: selected profile 192.168.137.1
Jan 18 15:18:09 placevik-raspi dhcpcd[360]: eth0: IAID eb:a8:1f:3a
Jan 18 15:18:09 placevik-raspi systemd[1]: dhcpcd.service: main process exited, code=killed, status=11/SEGV
Jan 18 15:18:09 placevik-raspi dhcpcd[559]: dhcpcd[559]: sending signal TERM to pid 360
Jan 18 15:18:09 placevik-raspi dhcpcd[559]: sending signal TERM to pid 360
Jan 18 15:18:09 placevik-raspi dhcpcd[559]: dhcpcd not running
Jan 18 15:18:09 placevik-raspi dhcpcd[559]: dhcpcd[559]: dhcpcd not running
Jan 18 15:18:09 placevik-raspi systemd[1]: dhcpcd.service: control process exited, code=exited status=1
Jan 18 15:18:09 placevik-raspi systemd[1]: Unit dhcpcd.service entered failed state.

Return to “Raspberry Pi OS”