[PATCH] D42206: If kevent() is interrupted by signal (or is being debugged) and we get EINTR, retry

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 07:23:07 PST 2019


krytarowski added a comment.
Herald added a project: LLVM.

'attaching a debugger produces an observable side-effect (EINTR) in the debugged process is considered a bug by the linux kernel folks'

There are differences between Linux and BSD.

On BSD we try hard to make return of such syscall peacefully valid input (like returning already received bytes int read(2)), while on Linux there is hard interruption of operation.

Also we can introduce EINTR easily on BSD in arbitrary moments with ctrl-T (SIGINFO) that is used in many programs to pass information and the unprepared ones can misbehave due to EINTR.

So even if this could be a bug to cause EINTR in some scenarios on BSD under a debugger, it's a program fault to not handle it.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D42206/new/

https://reviews.llvm.org/D42206





More information about the llvm-commits mailing list