Endless loop in /usr/lib/udev/udev-configure-printer

未关闭
#299 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
c

调研方向

从 udev/udev-configure-printer.c 和 system-config-printer-1.4.8-2.el7.3 源代码包开始;将该源代码与当前仓库代码进行比较。使用提供的 strace 重现 connect/close 循环,并检查 CUPS 重启前后的行为。完成的标准是找出可重现的原因,并验证能够防止客户端陷入循环的更改。

由索引模型根据 Issue 内容生成。

描述

This happend today:

  • cups server did not print anymore
  • a client is looping in connect->fd->close->connect

Cause is unknown. Maybe the cups server hit a rate limit because it prints:

Flooding server log:

Dec 11 04:37:32 cupsserver kernel: STATE_INVALID_DROP: IN=ens32 OUT= MAC=xx SRC=<clientip> DST=<cupsserver> LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=51545 DF PROTO=TCP SPT=43770 DPT=631 WINDOW=0 RES=0x00 RST URGP=0

The client is in an endless loop, this flooded the server, which prints the above message until the HD ist full, then
cups does not print anymore.

The endless loop of the client straced, from connect->close->to connect again.

connect(5, {sa_family=AF_INET, sin_port=htons(631),sin_addr=inet_addr("cupsserver")}, 16) = -1 EINPROGRESS (Operation now in progress)
fcntl(5, F_SETFL, O_RDWR)               = 0
poll([{fd=5, events=POLLIN|POLLOUT}], 1, 250) = 1 ([{fd=5, revents=POLLOUT}])
getpeername(5, {sa_family=AF_INET, sin_port=htons(631),sin_addr=inet_addr(10.x.y.z)}, [256->16]) = 0
uname({sysname="Linux", nodename="client.linux", ...}) = 0
sendto(5, "OPTIONS * HTTP/1.1\r\nConnection: Upgrade\r\nHost: cupsserver.domain.de:631\r\nUpgrade: TLS/1.1,TLS/1.0\r\nUser-Agent: CUPS/1.6.3 (Linux 3.10.0-1160.80.1.el7.x86_64; x86_64) IPP/2.0\r\n\r\n", 173, 0, NULL, 0) =
poll([{fd=5, events=POLLIN}], 1, 60000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "HTTP/1.1 101 Switching Protocols\r\nDate: Mon, 12 Dec 2022 09:19:10 GMT\r\nServer: CUPS/1.6 IPP/2.1\r\nConnection: Keep-Alive\r\nKeep-Alive: timeout=30\r\nContent-Language: en_US\r\nConnection: Upgrade\r\
sendto(5, "\26\3\1\1\20\1\0\1\f\...)"
recvfrom(5, "\26\3\3\0:\2\0", 7, 0, NULL, NULL) = 7
recvfrom(5, "\0006\3\3\3034\210\241\33f\302\367Q\2217\307iT\32\220n\325\\17\0\1\1", 56, 0, NULL, NULL) = 56
recvfrom(5, "\26\3\3\26\326", 5, 0, NULL, NULL) = 5
recvfrom(5, "\v\0\26\322\0\26\317\010\f\6Bayern1\0210\17\6\3U\4\7\f\10M...)
recvfrom(5, "\26\3\3\0\4", 5, 0, NULL, NULL) = 5
recvfrom(5, "\16\0\0\0", 4, 0, NULL, NULL) = 4
sendto(5, "\26\3\3\1\6\2...)"
recvfrom(5, "\26\3\3\0\252", 5, 0, NULL, NULL) = 5
recvfrom(5, "\4\0\0\246\0\0\1,\0\...")
recvfrom(5, "\24\3\3\0\1", 5, 0, NULL, NULL) = 5
recvfrom(5, "\1", 1, 0, NULL, NULL)     = 1
recvfrom(5, "\26\3\3\0(", 5, 0, NULL, NULL) = 5
recvfrom(5, "\230/\230\351\257\7\201h\237\347A\v\12e\27\376", 40, 0, NULL, NULL) = 40
poll([{fd=5, events=POLLIN}], 1, 60000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\27\3\3\0\306", 5, 0, NULL, NULL) = 5
recvfrom(5, "\230/\23...")
sendto(5, "...)
close(5)                                = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 5
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
setsockopt(5, SOL_TCP, TCP_NODELAY, [1], 4) = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
fcntl(5, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(5, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(5, {sa_family=AF_INET, sin_port=htons(631),sin_addr=inet_addr("cupsserver")}, 16) = -1 EINPROGRESS (Operation now in progress)

When looking at the source code:

https://github.com/OpenPrinting/system-config-printer/blob/master/udev/udev-configure-printer.c

I dont see this loop, the pid is always the same, so its whithin this process.
The compiled version is from:

system-config-printer-1.4.8-2.el7.3.src.rpm

Which is rather old based on system-config-printer-1.4.1.tar.xz.

Restarting cups exited the client binary, no problem anymore.

The reason for the endless looping client is unknown.

主要语言
Python
星标
209
派生
111
平均合并
2 天 3 小时
30 天内合并 PR
8

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenPrinting/system-config-printer 的其他 Issue

查看 OpenPrinting/system-config-printer 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。