You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memleak in EM.connect when name resolution fails #987
There's a memleak when the DNS resolver of EM.connect fails, e.g. when /etc/hosts don't contain the entry.
If I do a Resolv.getaddress before the EM.connect, no memory is leaked.
Minimal reproduction:
require'eventmachine'require'resolv'moduleMyClientdefpost_initputs"post_init"enddefreceive_datadataputs"received: #{data}"enddefunbindputs"terminated"endendNAME='name.does.not.exist'EM.rundoloopdoprint'.'# ip = Resolv.getaddress NAME# EM.connect ip, 80, MyClient # no leakEM.connectNAME,80,MyClient# leakrescueEM::ConnectionError,Resolv::ResolvErrorendend
Activity
paddor commentedon Jul 3, 2024
I think
freeaddrinfo()inEventMachine_t::name2addressneeds to be called unconditionally:eventmachine/ext/em.cpp
Line 1548 in 4237412
EDIT: That does not help unfortunately.
I tried this: