Skip Menu |

This queue is for tickets about the Net-Traceroute CPAN distribution.

Report information
The Basics
Id: 107066
Status: open
Priority: 0/
Queue: Net-Traceroute

People
Owner: Nobody in particular
Requestors: alvin2038 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Running Net::Traceroute in a loop results in cumulative defunct traceroute processes
Date: Sun, 13 Sep 2015 23:43:13 +0800
To: bug-Net-Traceroute [...] rt.cpan.org
From: Alvin Koh <alvin2038 [...] gmail.com>
Hi, Running Net::Traceroute in a loop results in cumulative defunct traceroute processes. Net::Traceroute 1.15 Perl 5.18.2 Mac OS X 10.10.5 and SUSE Linux 11 Reproduction: Run this script in a terminal session. #!/usr/bin/perl use Net::Traceroute; while (1) { $tr = Net::Traceroute->new(host => "203.116.165.172", debuglvl => 9, max_ttl => 2, timeout => 1); if($tr->found) { my $hops = $tr->hops; if($hops > 1) { print "LAN Router IP is " . $tr->hop_query_host($tr->hops - 1, 0) . "\n"; print "ISP Gateway IP is " . $tr->hop_query_host($tr->hops, 0) . "\n"; } } sleep 30; } In another session window, #!/bin/bash while true do date; ps -ef | grep "traceroute" | grep -v grep | grep -v perl sleep 30 done With each iteration of Net::Traceroute, the second session will show an additional defunct traceroute process. On OS X: Sun Sep 13 23:03:16 SGT 2015 Sun Sep 13 23:03:46 SGT 2015 501 17724 17723 0 11:03PM ttys000 0:00.00 (traceroute) Sun Sep 13 23:04:16 SGT 2015 501 17724 17723 0 11:03PM ttys000 0:00.00 (traceroute) 501 17735 17723 0 11:04PM ttys000 0:00.00 (traceroute) Sun Sep 13 23:04:46 SGT 2015 501 17724 17723 0 11:03PM ttys000 0:00.00 (traceroute) 501 17735 17723 0 11:04PM ttys000 0:00.00 (traceroute) 501 17744 17723 0 11:04PM ttys000 0:00.00 (traceroute) Sun Sep 13 23:05:16 SGT 2015 501 17724 17723 0 11:03PM ttys000 0:00.00 (traceroute) 501 17735 17723 0 11:04PM ttys000 0:00.00 (traceroute) 501 17744 17723 0 11:04PM ttys000 0:00.00 (traceroute) 501 17755 17723 0 11:05PM ttys000 0:00.00 (traceroute) On Linux: Sun Sep 13 23:28:26 SGT 2015 Sun Sep 13 23:28:56 SGT 2015 root 15589 15588 0 23:28 pts/0 00:00:00 [traceroute] <defunct> Sun Sep 13 23:29:26 SGT 2015 root 15589 15588 0 23:28 pts/0 00:00:00 [traceroute] <defunct> root 15598 15588 0 23:29 pts/0 00:00:00 [traceroute] <defunct> Sun Sep 13 23:29:56 SGT 2015 root 15589 15588 0 23:28 pts/0 00:00:00 [traceroute] <defunct> root 15598 15588 0 23:29 pts/0 00:00:00 [traceroute] <defunct> root 15607 15588 0 23:29 pts/0 00:00:00 [traceroute] <defunct> Best regards Alvin
Hi Alvin, I'm having the same problem. Did you already solved this by yourself? Thanks xiconfjs Am So 13. Sep 2015, 17:43:28, alvin2038@gmail.com schrieb: Show quoted text
> Running Net::Traceroute in a loop results in cumulative defunct > traceroute processes. > > Net::Traceroute 1.15 > Perl 5.18.2 > Mac OS X 10.10.5 and SUSE Linux 11 > > (...) > > Best regards > Alvin
Hi Alvin, so on my debian systems using the "timeout" arg causes this phenomenon. I'm pretty sure is related to the [1] in combination with the "delete ${*$tr_pipe}{io_pipe_pid};" (line 354 @ Traceroute.pm) which cuts all strings to the forked traceroute process. Comment the "delete" line fixes the defunct fork problem, but as expected, disables the option to exit the fork in the set timeout seconds. My workaround for this: not using the "timeout" arg and try to control the runtime of the timeout with the "query_timeout" arg. Thanks xiconfjs [1] https://rt.cpan.org/Ticket/Display.html?id=28281 Am So 18. Aug 2019, 20:10:56, xicon.spam.test.account@googlemail.com schrieb: Show quoted text
> Hi Alvin, > > I'm having the same problem. Did you already solved this by yourself? > > > Thanks > xiconfjs > > Am So 13. Sep 2015, 17:43:28, alvin2038@gmail.com schrieb:
> > Running Net::Traceroute in a loop results in cumulative defunct > > traceroute processes. > > > > Net::Traceroute 1.15 > > Perl 5.18.2 > > Mac OS X 10.10.5 and SUSE Linux 11 > > > > (...) > > > > Best regards > > Alvin
> >