-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ksmbd.control shutdown is hung and causing 100% cpu indefinitely #318
Comments
Okay, Is this problem reproducible? Or is it an issue that cannot be reproduced well? |
Because I want to reproduce it on my side to check it at detall. |
I'm not sure yet -- it happened just after a few attempts at restarting, and the only clients that had accessed it while up were a current MacOS client and a Windows 11 client (both over TCP). I do still have the repro active right now, if you have any suggestions for more debug info. |
Could you please tell me how to restart ksmbd ? |
Each time, I used I can't attach to ksmbd.control with gdb or strace. Both just hang. |
This may be interesting -- I looked at the journalctl for the ksmbd service during my couple of restarts and here is the state:
Note that PID 4013966 is the instance still in the task list. It seems the systemd service file is written such that a restart will:
The systemd service:
Based on timestamps in dmesg and systemctl, it seems the following error occurred right around the time shutdown was called:
I don't know what state it was in but perhaps there is a code path here that caused IOWAIT and blocked shutdown? |
Looking at lsof: You can see the sysfs path for "kill_server" is still open. That suggests we're in this code path, before the fd is closed: Not sure why CPU would be spinning @ 100% but that's what's still happening. |
I got a stack trace from sysrq. ksmbd.control:
And ksmbd:
Busy work queues:
|
@putnam Thanks for giving the hints. There are some suspicious points, but I wish I could reproduce it in my environment to definitively fix this issue. This can only be reproduced with a MacOS client, right? |
@putnam Can you run ksmbd(https://github.com/namjaejeon/ksmbd) on your env ? Because I want to add the debug codes to find clue. |
@putnam please share the debug prints using the following ksmbd. git clone https://github.com/namjaejeon/ksmbd --branch=ksmbd-debug |
Working on it. I have some issues compiling from source on Debian trixie:
It looks like the Makefile is missing some preprocessor step for creating the .c/.h files from the asn1 files. I tried looking through repo history and could not find anything... I also noticed the Debian kernel did not set SMB_SERVER_SMBDIRECT to |
Hm.. stranged.. I can build it on ubuntu. Can you check if the below is enable in your kernel config ?
not sure if it is possible. because other modules(rdma) should be enable in your kernel. can you install custom kernel for test ? because we can not find the way to build out of tree ksmbd(github). |
I was just testing out ksmbd and have had lots of trouble with Mac clients working reliably. On one of my restarts (systemctl restart ksmbd) it hung in such a way that now ksmbd.control is using 80-100% CPU and ksmbd shows as locked in iowait. No clients are connected right now. I tried attaching to ksmbd.control with strace and nothing prints to stdout and strace itself ends up nonresponsive and has to get SIGKILL'ed.
I am on Linux kernel 6.7.12 on Debian testing.
I have debug logging set to all in the kernel and there has been nothing printed since this group of logs from immediately after the restart:
The text was updated successfully, but these errors were encountered: