Description of problem: When I query the NS records for a certain domain using Net::DNS::Resolver::Recurse, the perl script gets stuck in a infinite loop, rapidly expanding in size until it is killed by the OOM killer. How reproducible: Can be reproduced every time you query certain domain(s). I've reproduced it on four different Fedora 20 systems, once of which was a virgin system booted from the Fedora Live DVD. The problem does _not_ occur on CentOS/RHEL 6.5 or CentOS/RHEL 7. Steps to Reproduce: 1. Create a perl script that queries NS records for domain villamontanavista.co.uk 2. Run the script 3. Watch top and see the script grow in size until the OOM killer steps in. Actual results: Perl script devours all available memory until it is killed by OOM Killer Expected results: DNS records should be handled by the script and it should exit almost instantly Additional info: This perl script will always trigger the bug on Fedora 20: ========================= #!/usr/bin/perl use strict; use Net::DNS; use Net::DNS::Resolver::Recurse; use Data::Dumper; select STDERR; $| = 1; select STDOUT; $| = 1; my $res = Net::DNS::Resolver::Recurse->new; $res->hints(); $res->recursion_callback(sub { my $packet = shift; print "==============\n".Dumper($packet)."\n--------------------\n"; for ($packet->additional){ print $_->string."\n"; } }); $res->tcp_timeout(10); $res->udp_timeout(10); print "Starting recursion\n"; my $packet=$res->query_dorecursion("villamontanavista.co.uk","NS"); print "Finished recursion\n"; ========================= Some strace output (goes on like this until killed): brk(0) = 0x18a1000 brk(0x18c2000) = 0x18c2000 brk(0) = 0x18c2000 brk(0x18e3000) = 0x18e3000 brk(0) = 0x18e3000 brk(0x1904000) = 0x1904000 brk(0) = 0x1904000 brk(0x1925000) = 0x1925000 brk(0) = 0x1925000 brk(0x1946000) = 0x1946000 brk(0) = 0x1946000 brk(0x1967000) = 0x1967000 brk(0) = 0x1967000 brk(0x1988000) = 0x1988000 brk(0) = 0x1988000
I've done a bit more work on this and determined that: * The problem exists in the upstream Net::DNS v0.80 * This can be reproduced on Ubuntu Trusty with Net::DNS built from CPAN I've reported the bug here: https://rt.cpan.org/Public/Bug/Display.html?id=99429
Thanks for the report, John. A workaround patch has been submitted on RT.
confirmed fixed in 0.81
perl-Net-DNS-0.81-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/perl-Net-DNS-0.81-1.fc19
perl-Net-DNS-0.81-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/perl-Net-DNS-0.81-1.fc21
Package perl-Net-DNS-0.81-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing perl-Net-DNS-0.81-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-13988/perl-Net-DNS-0.81-1.fc21 then log in and leave karma (feedback).
perl-Net-DNS-0.81-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
perl-Net-DNS-0.81-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.