Skip Menu |

This queue is for tickets about the Win32-Process-Info CPAN distribution.

Report information
The Basics
Id: 44727
Status: resolved
Priority: 0/
Queue: Win32-Process-Info

People
Owner: Nobody in particular
Requestors: erikweidel [...] web.de
Cc:
AdminCc:

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



When using Subprocesses() with the WMI-variant, I get the output: "Use of uninitialized value in numeric ge (>=) at C:/strawberry/perl/site/lib/Win32/Process/Info.pm line 670" two times. After adding some debug output to Info.pm, I have found out, that the "CreationDate" is undefined for some processes. On my Windows XP SP3, these are the "Idle" process and the "System" process. I used the Process Explorer from Sysinternals to double-check that and it did not show a "Start Time" for these processes either. I have created the attached patch to prevent the output. It is just a "cosmetic" patch but I thought, you might be interested :-) Erik
Subject: Info.pm.patch
--- Info.pm.orig Fri Jun 13 02:48:02 2008 +++ Info.pm Wed Apr 1 14:11:59 2009 @@ -667,7 +667,8 @@ $key_found++; # TRW 1.011_01 next unless $prox{$proc->{ParentProcessId}}; $prox{$pop} or next; # TRW 1.011_01 - $proc->{CreationDate} >= $prox{$pop}{CreationDate} or next; # TRW 1.011_01 + defined($proc->{CreationDate}) && defined($prox{$pop}{CreationDate}) && + $proc->{CreationDate} >= $prox{$pop}{CreationDate} or next; # TRW 1.011_01 # TRW 1.011_01 push @{$subs{$proc->{ParentProcessId}}}, $proc->{ProcessId}; push @{$subs{$pop}}, $proc->{ProcessId}; }
On Wed Apr 01 10:48:41 2009, erikweidel wrote: Show quoted text
> When using Subprocesses() with the WMI-variant, I get the output: > "Use of uninitialized value in numeric ge (>=) at > C:/strawberry/perl/site/lib/Win32/Process/Info.pm line 670" two times. > > After adding some debug output to Info.pm, I have found out, that the > "CreationDate" is undefined for some processes. On my Windows XP SP3, > these are the "Idle" process and the "System" process. I used the > Process Explorer from Sysinternals to double-check that and it did not > show a "Start Time" for these processes either. > > I have created the attached patch to prevent the output. > It is just a "cosmetic" patch but I thought, you might be interested :-)
Thank you very much for the problem report, and most especially for the patch. I guess it's obvious this part of the code has had its share of problems. I'll try to get a release out in the not-too-distant future. If you don't see one in a couple weeks (to CPAN - I can't be responsible for Active State, though lately they haven't done too badly), please feel free to rattle my cage. Tom Wyant
Win32-Process-Info-1.013 uploaded to CPAN. It may take a day or so to make it to the mirrors, and at least another couple for ActiveState to pick it up. I will watch ActiveState's repository, and close this bug a week or so after it hits, unless I hear otherwise. I hope you're not trying to use the WMI variant in a daemon process of some sort. It leaks memory, the leak being in one of the Win32::OLE modules, and thus inaccessible to me. Tom Wyant
Subject: Re: [rt.cpan.org #44727] Uninitialized value warning in Subprocesses()
Date: Mon, 06 Apr 2009 09:24:04 +0200
To: bug-Win32-Process-Info [...] rt.cpan.org
From: erikweidel [...] web.de
Sorry for the late response. I was on holiday for the weekend :-) Thanks a lot for the quick update and the hint concerning the memory leak! I have indeed a daemon process and wanted to use it there. I think i have to find another method now ... :-( Erik Show quoted text
> -----Ursprüngliche Nachricht----- > Von: "Tom Wyant via RT" <bug-Win32-Process-Info@rt.cpan.org> > Gesendet: 03.04.09 04:53:25 > An: erikweidel@web.de > Betreff: [rt.cpan.org #44727] Uninitialized value warning in Subprocesses()
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=44727 > > > Win32-Process-Info-1.013 uploaded to CPAN. It may take a day or so to > make it to the mirrors, and at least another couple for ActiveState to > pick it up. > > I will watch ActiveState's repository, and close this bug a week or so > after it hits, unless I hear otherwise. > > I hope you're not trying to use the WMI variant in a daemon process of > some sort. It leaks memory, the leak being in one of the Win32::OLE > modules, and thus inaccessible to me. > > Tom Wyant >
Show quoted text
________________________________________________________________________ Neu bei WEB.DE: Kostenlose maxdome Movie-FLAT! https://register.maxdome.de/xml/order/LpWebDe?ac=OM.MD.MD008K15726T7073a
Subject: Re: [rt.cpan.org #44727] Uninitialized value warning in Subprocesses()
Date: Mon, 06 Apr 2009 13:21:48 +0200
To: bug-Win32-Process-Info [...] rt.cpan.org
From: erikweidel [...] web.de
Hi Tom, i have tried to install your new version 1.013 using Strawberry Perl and the CPAN-Shell. Unfortunately it hangs during the "test"-target in an endless-loop. It looks like you missed one occurrence when replacing @_ with @args :-) Here is my patch: --- Info.pm.orig Mon Apr 6 11:14:14 2009 +++ Info.pm Mon Apr 6 11:14:23 2009 @@ -796,8 +796,8 @@ my ($self, $hash, @args) = @_; $hash ||= {}; while (@args) { - my $key = shift; - my $val = shift; + my $key = shift @args; + my $val = shift @args; $val = $self->{_xfrm}{$key}->($self, $val) if (exists $self->{_xfrm}{$key}); $hash->{$key} = $val; Erik Show quoted text
> -----Ursprüngliche Nachricht----- > Von: "Tom Wyant via RT" <bug-Win32-Process-Info@rt.cpan.org> > Gesendet: 03.04.09 04:53:25 > An: erikweidel@web.de > Betreff: [rt.cpan.org #44727] Uninitialized value warning in Subprocesses()
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=44727 > > > Win32-Process-Info-1.013 uploaded to CPAN. It may take a day or so to > make it to the mirrors, and at least another couple for ActiveState to > pick it up. > > I will watch ActiveState's repository, and close this bug a week or so > after it hits, unless I hear otherwise. > > I hope you're not trying to use the WMI variant in a daemon process of > some sort. It leaks memory, the leak being in one of the Win32::OLE > modules, and thus inaccessible to me. > > Tom Wyant >
Show quoted text
__________________________________________________________________________ Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele ausländische Netze zum gleichen Preis! https://produkte.web.de/webde_sms/sms
On Mon Apr 06 07:22:25 2009, erikweidel wrote: Show quoted text
> Hi Tom, > > i have tried to install your new version 1.013 using Strawberry Perl > and the CPAN-Shell. > Unfortunately it hangs during the "test"-target in an endless-loop. > It looks like you missed one occurrence when replacing @_ with @args > :-) > Here is my patch: > > --- Info.pm.orig Mon Apr 6 11:14:14 2009 > +++ Info.pm Mon Apr 6 11:14:23 2009 > @@ -796,8 +796,8 @@ > my ($self, $hash, @args) = @_; > $hash ||= {}; > while (@args) { > - my $key = shift; > - my $val = shift; > + my $key = shift @args; > + my $val = shift @args; > $val = $self->{_xfrm}{$key}->($self, $val) > if (exists $self->{_xfrm}{$key}); > $hash->{$key} = $val; >
Oooops. This is my bad for not checking. I have been maintaining this for a while without Windows, using the PT variant. Oddly enough, this passed, not only for me but for various CPAN testers. Should have known to skip 1.013. Anyhow, 1.014 just went to CPAN, and should appear there some time today. Maybe this will pass ActiveState's PPM build as well. Thank you very much for the feedback and the patch. Tom Wyant
ActiveState successfully built 1.014 about a week ago. Give this, and absent any further feedback, I'm marking this resolved. It turned out the reason my (and the CPAN testers') testing did not uncover the problem in version 1.013 is that the hosed utility routine was not called by the RT variant. This has been fixed in the CVS repository, and should be out in 1.015 (whenever this happens).