Summary: | [cc_cdg] crash after change net.inet.tcp.cc.cdg.smoothing_factor | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | iron.udjin | ||||||
Component: | kern | Assignee: | Michael Tuexen <tuexen> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | aoimidori27, emaste, hiren, net, tuexen | ||||||
Priority: | --- | Keywords: | patch | ||||||
Version: | 10.1-STABLE | Flags: | tuexen:
mfc-stable12+
tuexen: mfc-stable11+ |
||||||
Hardware: | amd64 | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
iron.udjin
2014-09-19 03:05:09 UTC
Hi, I tried to reproduce your problem on my machine (OS version: 10.0-RELEASE), but nothing happens. Do you still encounter this problem? Hello, Thank you for reply. I can reproduce it on my desktop with 10.1-STABLE r274707 and server with 10.1-STABLE r274618. It bug appear when I run these commands and after that produce some network activity. For example, open browser or download something. How can I debug it or catch any traceback before system restart? Thanks I could reproduce your problem and found why this problem occurs. You need to attach a patch to your kernel in order to fix it. Wait for a moment. I will generate it soon. Hi, I found you don't need a patch. The reasonable solution is set smoothing_factor to one instead of zero. # sysctl net.inet.tcp.cc.cdg.smoothing_factor=1 This configuration helps connections to behave what you like exactly. Could you try this? Yes, it helps. But according to CC_CDG(4): smoothing_factor - Number of samples used for moving average smoothing (0 means no smoothing). Default is 8. That's why I tried to set 0. If smoothing_factor=0 is abnormal setting for this tunable, documentation needs to be changed and restrict possibility to set smoothing_factor to 0. In any case, it's not normal behaviour when OS freezes and restarts, IMHO. Thanks This is completely an implementation issue. I am proposing to my fix to a BSD developer. What can I help you exactly? This bug is not critical for me as we have a workaround. I guess it would be good to add some comments to CC CDG(4) to avoid other users face the same problem. Thank you for help. Np, thanks you for your bug report! Created attachment 149717 [details]
cc_cdg bug fix
Hi again, Could you test my attaching patch? If it works correctly, your finding bug fix merge into the main tree. I just tested attached patch on my server. It still restarts when I set net.inet.tcp.cc.cdg.smoothing_factor=0 Could u check if ur revision is proper? If the revision is okay, show me the commands to rebuild ur kernel, please. uname -a FreeBSD dev 10.1-STABLE FreeBSD 10.1-STABLE #5 r274887M: Sat Nov 22 22:03:30 EET 2014 root@dev:/usr/obj/usr/src/sys/TG_DEV.debug amd64 make -j20 buildworld NOCLEAN=YES && make -j20 buildkernel KERNCONF=TG_DEV.debug NOCLEAN=YES && make installworld && make installkernel KERNCONF=TG_DEV.debug I just deveted everything in /usr/obj/ and buld world and kernel again. The same result. Server restarts. Updated 10.1-BETA and 10.1-RC versioned bugs to 10.1-STABLE. Created attachment 201680 [details]
packetdrill script for reproducing the issue
I added a potential fix in review D19071. I just tested fix on my desktop PC. It works fine and doesn't restart. Also packetdrill script has successfully executed without PC restarts. Please commit changes. Thank you! Forgot to mention: tested on 12.0-STABLE r343713M (In reply to iron.udjin from comment #18) Thanks testing! The fix needs to be MFCed to stable/11 and stable/12 after getting it into head. A commit references this bug: Author: tuexen Date: Fri Feb 8 20:42:50 UTC 2019 New revision: 343920 URL: https://svnweb.freebsd.org/changeset/base/343920 Log: Ensure that when using the TCP CDG congestion control and setting the sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing is disabled. Without this patch, a division by zero orrurs. PR: 193762 Reviewed by: lstewart@, rrs@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19071 Changes: head/sys/netinet/cc/cc_cdg.c A commit references this bug: Author: tuexen Date: Mon Feb 25 12:25:44 UTC 2019 New revision: 344514 URL: https://svnweb.freebsd.org/changeset/base/344514 Log: MFC r343920: Ensure that when using the TCP CDG congestion control and setting the sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing is disabled. Without this patch, a division by zero orrurs. PR: 193762 Reviewed by: lstewart@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19071 Changes: _U stable/12/ stable/12/sys/netinet/cc/cc_cdg.c |