FreeBSD 10.1-BETA1 r271827.
1) # kldload cc_cdg
2) # sysctl net.inet.tcp.cc.algorithm=cdg
3) # sysctl net.inet.tcp.cc.cdg.smoothing_factor=0
After that system works 5-10 sec, freezes and restarts. I could reproduce it on my server and desktop.
Hi, I tried to reproduce your problem on my machine (OS version: 10.0-RELEASE), but nothing happens. Do you still encounter this problem?
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?
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.
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.
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
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.
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.
Forgot to mention: tested on 12.0-STABLE r343713M
(In reply to iron.udjin from comment #18)
The fix needs to be MFCed to stable/11 and stable/12 after getting it into head.
A commit references this bug:
Date: Fri Feb 8 20:42:50 UTC 2019
New revision: 343920
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.
Reviewed by: lstewart@, rrs@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19071