View Issue Details

IDProjectCategoryView StatusLast Update
0004419unrealircdpublic2015-10-26 10:27
Reportersyzop Assigned Tosyzop  
PrioritynormalSeverityblockReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.4-beta4 
Target Version4.0.0-rc1Fixed in Version4.0.0-rc2 
Summary0004419: epoll error & REHASH never succeeds - remote includes bug?
Description1) boot
2) add new listen block
3) /REHASH. All is good.
4) Then /REHASH again
[Fri Sep 18 18:19:58 2015] - [BUG?] epoll returned error 2 (No such file or directory)
And... rehash never succeeds
subsequent /REHASH says "A rehash is already in progress"
TagsNo tags attached.
3rd party modules

Activities

syzop

2015-10-10 15:28

administrator   ~0018739

This issue has something to do with remote includes.

In my tests it's writing some data and then closing fd #14, causing the epoll error. This fd #14 is the listener, so shouldn't be closed.
Fd #14 was previously used to retrieve a remote include (via HTTPS), and then to copy a file.

Seems the curl code to finish the remote include thing is called too late and doing some unnecessary closing.

write(14, "\25\3\3\0\32\206\303`\346:\255b.)\356\314HnRx\317,\304o\0260`\320\373;X", 31) = 31
close(14) = 0

open("/home/syzop/unrealircd/cache/f7579c5cba0233f2d308651ca6822254", O_WRONLY|O_CREAT, 0600) = 14
write(14, "help test {\n\t\"ok seems it succee"..., 110) = 110
close(14) = 0

socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 14
setsockopt(14, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(14, SOL_SOCKET, SO_RCVBUF, [8192], 4) = 0
setsockopt(14, SOL_SOCKET, SO_SNDBUF, [8192], 4) = 0
fcntl(14, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(14, F_SETFL, O_RDWR|O_NONBLOCK) = 0
bind(14, {sa_family=AF_INET, sin_port=htons(5123), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(14, 128) = 0
epoll_ctl(8, EPOLL_CTL_ADD, 14, {EPOLLIN, {u32=8659008, u64=8659008}}) = 0
poll([{fd=14, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
write(14, "\27\3\3\0\224\235&N2\353\321\314\23\370\22\314\36*\200\230\0351\243\3076\247\327\24\6\346\346\201"..., 153) = -1 EPIPE (Broken pipe) [MARK]
close(14) = 0 [MARK]
..etc...

The last two lines with MARK are wrong. Fd was closed long before and re-used for 2 other purposes already...

syzop

2015-10-26 10:26

administrator   ~0018788

Workaround for libcurl bug. Fixes 0004419. This caused an un-/REHASH'able server if you used remote includes (epoll_ctl error) and were adding new listen blocks at runtime, for example.

https://github.com/unrealircd/unrealircd/commit/243045a887e0b755d028de138848610e36646ee5

See also related case from another libcurl user:
http://curl.haxx.se/mail/tracker-2014-04/0038.html (be sure to read entire thread)

Issue History

Date Modified Username Field Change
2015-09-18 18:25 syzop New Issue
2015-09-18 18:25 syzop Assigned To => syzop
2015-09-18 18:25 syzop Status new => confirmed
2015-10-10 15:28 syzop Note Added: 0018739
2015-10-17 14:37 syzop Severity major => block
2015-10-17 14:37 syzop Summary epoll error & REHASH never succeeds => epoll error & REHASH never succeeds - remote includes bug?
2015-10-26 10:26 syzop Note Added: 0018788
2015-10-26 10:26 syzop Status confirmed => resolved
2015-10-26 10:26 syzop Fixed in Version => 4.0.0-rc2
2015-10-26 10:26 syzop Resolution open => fixed