Skip to content

dhcpcd segfaults during RELEASE when it tries to DISCOVER #552

@rsmarples

Description

@rsmarples

Can you help me confirm, I understood your d41c505#diff-66945e1e112a14eb5cb5931e2d600af419ed1f4c9a1567669f3de19d0f104c94

  1. --exit sets STOPPING.

  2. Each protocol sees STOPPING → calls *_release() → triggers *_deconfigure() → reason="RELEASE".

  3. e.g. DHCPv6 RELEASE should be sent to network to signal removal of lease and we should receive ACK on dhcpcd

  4. dhcp_free() and dhcpcd_dropped() run in correct order.

  5. When all interfaces drop, the main loop exits cleanly.

If we don't have RELEASE ACK timeout callbacks (which also run from eloop) such as
dhcp_discover, dhcp_start, dhcp_bind, dhcp_renew (dhcp.c)
or
dhcp6_* callbacks: dhcp6_start, dhcp6_recvif, dhcp6_freedrop, dhcp6_finishrelease
will be triggered?
I think that's how I saw mentioned dhcp_discover() crash

Program terminated with signal SIGSEGV, Segmentation fault.
#0 dhcp_discover (arg=0x5589e589a0) at dhcp.c:2006
2006 dhcp.c: No such file or directory.
(gdb) bt
#0 dhcp_discover (arg=0x5589e589a0) at dhcp.c:2006
#1 0x00000055757cce64 in eloop_start (eloop=0x5589e47830, signals=signals@entry=0x7fdf70e068) at eloop.c:1201
#2 0x00000055757c5ab4 in main (argc=, argv=, envp=) at dhcpcd.c:2707

(gdb) bt full
#0 dhcp_discover (arg=0x5589e589a0) at dhcp.c:2006
ifp = 0x5589e589a0
state = 0x0
ifo = 0x5589e58bc0
#1 0x00000055757cce64 in eloop_start (eloop=0x5589e47830, signals=signals@entry=0x7fdf70e068) at eloop.c:1201
error =
t = 0x5589e47250
ts = {tv_sec = 0, tv_nsec = 763219470}
tsp =
PRETTY_FUNCTION = "eloop_start"

I captured tcpdump during dhcp --exit, but I didn't saw DHCPv6 RELEASE?
On which interface it would be sent?

I appended as well:
6c47ee7
7b15c54
ae22cf0
93305c2
7ef3ba1

Please help.

Originally posted by @Sime-Zupanovic in #536 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions