rb-kqueue icon indicating copy to clipboard operation
rb-kqueue copied to clipboard

Errno::EFAULT (Bad address - KQueue failed: There was an error reading or writing the kevent structure.)

Open hasandiwan opened this issue 3 years ago • 2 comments

Error occurs if I leave unicorn running too long on the system (uname output below). I didn't notice it with webrick. and haven't tried thin or any other rails appserver as yet:

$ uname -a
FreeBSD freebsd 12.2-STABLE FreeBSD 12.2-STABLE r368787 GENERIC  amd64

hasandiwan avatar Jan 06 '22 04:01 hasandiwan

I have also see this error on 13.1-STABLE FreeBSD 13.1-STABLE with rb-kqueue-0.2.8 under ruby-version ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [amd64-freebsd13]

In this case the code is esentially:

    @kq = KQueue::Queue.new
    @kq.watch_file(XYZ_DIR, :write) { process_var_tmp_xyz }
    @kq.run

The error occurred at: @kq.watch_file(XYZ_DIR, :write) { process_var_tmp_xyz }

EFAULT may imply that keven(8) could not copy in/out the kevent(8) parameters, but of course this code works 99.99999% of the time.

I have not found a way to reproduce.

baukus avatar May 14 '24 18:05 baukus

I just updated to FreeBSD 14.1-RELEASE-p2 and started to get this error using guard. The tests run, but when it stops to wait for some chances to run tests again, it finishes and show the error message. But - the weird part - it suddenly worked again few minutes after I found this issue, nothing changed. I really didn't understand.

taq avatar Jul 09 '24 16:07 taq