<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-crea="font-wrapper" style="font-family: Tahoma; font-size: 16px; direction: ltr">Hey,<br><div style="font-family: Tahoma; font-size: 16px"></div><br><div></div><div data-anchor="reply-title">On Tue, Jun 19, 2018 at 15:30, Simon McVittie <smcv@collabora.com> wrote:</div><blockquote><div>On Tue, 19 Jun 2018 at 12:32:19 +0000, <a target="_blank" href="mailto:magnus@minimum.se" style="cursor: inherit;">magnus@minimum.se</a> wrote:<br><blockquote>The system is on a quite old kernel (3.18.44)</blockquote><br>...<br><blockquote>At this point, things go wrong when<br>recvmsg() is called on bus->input_fd with flags MSG_DONTWAIT|MSG_NOSIGNAL|<br>MSG_CMSG_CLOEXEC. This syscall returns -22 (Invalid argument) which propagates<br>all the way up to the user.</blockquote><br><br>(I hate the way kernel/syscall/libc error-reporting isn't accompanied<br>by a human-readable message that could tell you *which* argument is<br>invalid... compare with GLib/D-Bus errors)<br><br>MSG_NOSIGNAL is meaningless for recvmsg()<br><<a target="_blank" href="https://www.spinics.net/lists/linux-man/msg10557.html" style="cursor: inherit;">https://www.spinics.net/lists/linux-man/msg10557.html</a>> so it's possible<br>that your older kernel doesn't allow it, but newer kernels allow and<br>ignore it? sd-bus should probably only use that flag for sendmsg()<br>and the rest of the send(2) family.<br></div></blockquote><div><span>You are right, if I remove the MSG_NOSIGNAL flag to recvmsg() everything works (systemd-logind, busctl etc). I was unable to locate the place in my kernel code where it actually rejects MSG_NOSIGNAL for recvmsg(), but I think your theory is sane: 3.18.44 rejects it, newer kernels ignore it.</span></div><div><span><br></span></div><div><span>I can send a patch that removes use of MSG_NOSIGNAL in recvmsg() if you are willing to accept it. I think there should be no side effects for users of newer kernels.<br></span></div><blockquote><div>smcv<br>_______________________________________________<br>systemd-devel mailing list<br><a target="_blank" href="mailto:systemd-devel@lists.freedesktop.org" style="cursor: inherit;">systemd-devel@lists.freedesktop.org</a><br><a target="_blank" href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" style="cursor: inherit;">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></div></blockquote></div></body></html>