Skip Menu |

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

Report information
The Basics
Id: 83237
Status: rejected
Priority: 0/
Queue: Win32-API

People
Owner: BULKDD [...] cpan.org
Requestors: compuvision.sr [...] gmail.com
Cc:
AdminCc:

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



Can't use string ("Win32::API::Struct") as a HASH ref while "strict refs" in use at C:/strawberry/perl/vendor/lib/Win32/A PI/Struct.pm line 158. Had to use force to install Win32:SystemInfo module. my %mHash = (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) # Failes on this line!! Problem wasn't there with 0.62 Thanks in advance
Subject: Can't use string ("Win32::API::Struct") as a HASH ref while "strict refs"
Can't use string ("Win32::API::Struct") as a HASH ref while "strict refs" in use at C:/strawberry/perl/vendor/lib/Win32/A PI/Struct.pm line 158. Had to use force to install Win32:SystemInfo module. my %mHash = (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) # Failes on this line!! Problem wasn't there with 0.62 Thanks in advance Same as last bug, I just noticed that there was no subject and that I could upgrade from 0,73->0,75 and haven't figured out a way to remove the last entry
On Sat Feb 09 09:27:24 2013, gepebril wrote: Show quoted text
> Can't use string ("Win32::API::Struct") as a HASH ref while "strict > refs" in use at C:/strawberry/perl/vendor/lib/Win32/A PI/Struct.pm line > 158. Had to use force to install Win32:SystemInfo module. my %mHash = > (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); if > (Win32::SystemInfo::MemoryStatus(%mHash)) # Failes on this line!! > Problem wasn't there with 0.62 Thanks in advance > > Same as last bug, I just noticed that there was no subject and that I > could upgrade from 0,73->0,75 and haven't figured out a way to remove > the last entry
So what is the failing code? I tried a "make test" on Win32:SystemInfo and it passed. I also tried Show quoted text
___________________________________________________________ use Win32::SystemInfo; my %mHash = (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) {0;}
___________________________________________________________ and saw nothing (like warnings/dies) in console. Using ::API 0.75 on 32bit winxp. Also
______________________________________________________________________ C:\Documents and Settings\Owner\Desktop\cpan libs\w32si>perl test.pl 1..3 ok 1 ok 2 ok 3 C:\Documents and Settings\Owner\Desktop\cpan libs\w32si>
______________________________________________________________________
From: compuvision.sr [...] gmail.com
Thanks for the reply and testing. Show quoted text
> So what is the failing code? I tried a "make test" on Win32:SystemInfo > and it passed. I also tried
I never done this make test, do you have the cli how to test that? Show quoted text
> and saw nothing (like warnings/dies) in console. Using ::API 0.75 on > 32bit winxp.
I tried to replicate my old environment with autobundle and it worked, but not for the Win32::SystemInfo module. It mentioned I could only install it with force. I just found out that my old environment is 5.12.3.0-32bit and not 5.12.3.0-64bit which I used on the new environment. The problem only occurs on the new environment. I run on both environments Win7 64 bits. So early conclusion is that the problem only occurs on 64 bits versions of Strawberry Perl, not on the 32 bits version. I will check it hopefully tomorrow.
From: compuvision.sr [...] gmail.com
I will check it hopefully tomorrow. Yup the problem didn't occur in the 32 bits (latest) version of Perl Strawberry. Should Win32::SystemInfo be compatible with the 64 release of Strawberry Perl?
On Tue Feb 12 15:57:54 2013, gepebril wrote: Show quoted text
> I will check it hopefully tomorrow. > > Yup the problem didn't occur in the 32 bits (latest) version of Perl > Strawberry. Should Win32::SystemInfo be compatible with the 64 release > of Strawberry Perl?
I reproduced it ("Can't use string ("Win32::API::Struct") as a HASH ref while "strict refs"") only on x64 Perl with a nmake test. 32 bit Perl passed an nmake test. Win32::API is supposed to support x64 as good as 32 bits. If the user's app that uses Win32::API is written *correctly*, his app will work transparently on x64 and 32 bit. I will investigate it further tomorrow. On Mon Feb 11 17:41:59 2013, gepebril wrote: Show quoted text
> Thanks for the reply and testing. >
> > So what is the failing code? I tried a "make test" on Win32:SystemInfo > > and it passed. I also tried
> I never done this make test, do you have the cli how to test that?
Google "perl make test" no quotes. I specifically used nmake (not make) since I use Visual C, not Cygwin/Linux.
From: compuvision.sr [...] gmail.com
Show quoted text
> I reproduced it ("Can't use string ("Win32::API::Struct") as a HASH ref > while "strict refs"") only on x64 Perl with a nmake test. 32 bit Perl > passed an nmake test. Win32::API is supposed to support x64 as good as > 32 bits. If the user's app that uses Win32::API is written *correctly*, > his app will work transparently on x64 and 32 bit. I will investigate it > further tomorrow.
Aha, thanks for taking the time to try to reproduce it. Good news. A bug is bug when it can be reproduced. I used the sample from the Cpan module Win32::SystemInfo so that part should be correctly. Or are you referring to Win:System32Info that is not using Win32::API correctly? Show quoted text
> Google "perl make test" no quotes. I specifically used nmake (not make) > since I use Visual C, not Cygwin/Linux.
Ok, I forgot. You have to use make when you don't use cpan -> install but download the module manually. As for the last two years everything with Perl went so smoothly I stopped using it.
From: compuvision.sr [...] gmail.com
Tobyink has mentioned regarding this issue: - That particular message usually comes from using a sub designed to be used as an object method as a class method instead. - For more info: http://www.perlmonks.org/?node_id=1017850
On Wed Feb 13 06:12:08 2013, gepebril wrote: Show quoted text
> Tobyink has mentioned regarding this issue: > - That particular message usually comes from using a sub designed to be > used as an object method as a class method instead. - > For more info: http://www.perlmonks.org/?node_id=1017850
the failure comes from "$MEMORYSTATUSEX->{dwLength} = Win32::API::Struct->sizeof($MEMORYSTATUSEX);" which was added in https://github.com/iamthechad/perl-win32-systeminfo/commit/6d1264e1899a54f1ec518ec1db4be8ea133401b3 The reason it works on 32 bits is because 2 different paths are taken in ::SystemInfo, starting at https://github.com/iamthechad/perl-win32-systeminfo/blob/e311b78194335a8cfedf8951f495264072f0161d/SystemInfo.pm#L121 . Looking at Win32::API's docs, its unclear in ::Type and ::Struct's POD what is an object method and what is a class method. I looked in ::API's test kit and all ::Struct::sizeof calls were on objects not classes. The problem in ::SystemInfo on x64 is already covered by https://rt.cpan.org/Ticket/Display.html?id=48008 . So what do you want me to do? Add class method support to the ::Struct::sizeof method, or improve the POD and say its object method only? The author of ::SystemInfo last responded in 2009 in the ::SystemInfo bug. He will ultimately have to respond to get this mess fixed. He doesn't seem to be around much anymore. His http://www.megatome.com/ blog's last post is oct 25 2012 and last CPAN upload 4.5 years ago, blog's contact page is broken http://www.megatome.com/contact/ which is domain parked to http://visitorcontact.com/embed/1876 but his github https://github.com/iamthechad?tab=activity had a push 2 days ago so there is some hope. Im filing a github bug ticket to try to contact him.
RT-Send-CC: steven.hartland [...] multiplay.co.uk, killing [...] multiplay.co.uk, mmusgrove [...] cpan.org
On Wed Feb 13 12:52:50 2013, BULKDD wrote: Show quoted text
> > The author of ::SystemInfo last responded in 2009 in the ::SystemInfo > bug. He will ultimately have to respond to get this mess fixed. He > doesn't seem to be around much anymore. His http://www.megatome.com/ > blog's last post is oct 25 2012 and last CPAN upload 4.5 years ago, > blog's contact page is broken http://www.megatome.com/contact/ which > is > domain parked to http://visitorcontact.com/embed/1876 but his github > https://github.com/iamthechad?tab=activity had a push 2 days ago so > there is some hope. Im filing a github bug ticket to try to contact > him. > >
The module is basically abandoned according to https://github.com/iamthechad/perl-win32-systeminfo/issues/1#issuecomment-13513853 . So what do you want to do? CCing possibly interested people also.
From: compuvision.sr [...] gmail.com
@bulk88 Thanks for al the time and research. So What I understand from this webpage: https://github.com/iamthechad/perl-win32-systeminfo/issues/1 is that iamthechad is the owner of the module and don't have time any more to fix it. It seems if that is the case you can make the specific module available for adoption, so somebody else can take over. Sounds like a nice solution. I found that other people have also probs with the 64 bits version Until this happens I will continue to work on the 32 bits Perl version
On Thu Feb 14 13:56:10 2013, gepebril wrote: Show quoted text
> @bulk88 > > Thanks for al the time and research. > > So What I understand from this webpage: > https://github.com/iamthechad/perl-win32-systeminfo/issues/1 is that > iamthechad is the owner of the module and don't have time any more to > fix it. It seems if that is the case you can make the specific module > available for adoption, so somebody else can take over. Sounds like a > nice solution. > > I found that other people have also probs with the 64 bits version > > Until this happens I will continue to work on the 32 bits Perl version
So, I don't blog much and I haven't fixed my broken contact form. It's taken me a couple of days to build an environment where I could work on this since I've moved away from Windows. I've updated 48008, but the gist right now is that the changes identified fail under ActivePerl. I haven't even tried any other distros yet. I've started a feature branch at https://github.com/iamthechad/perl-win32-systeminfo/tree/v012 in case anybody wants to take a look.
RT-Send-CC: cjohnston [...] cpan.org
On Fri Feb 15 00:24:06 2013, CJOHNSTON wrote: Show quoted text
> > So, I don't blog much and I haven't fixed my broken contact form. It's > taken me a couple of days to build an environment where I could work on > this since I've moved away from Windows. > > I've updated 48008, but the gist right now is that the changes > identified fail under ActivePerl. I haven't even tried any other distros > yet. I've started a feature branch at > https://github.com/iamthechad/perl-win32-systeminfo/tree/v012 in case > anybody wants to take a look.
I tested the newly released 0.12 of Win32-SystemInfo ( http://search.cpan.org/~cjohnston/Win32-SystemInfo-0.12/ ). nmake test and Show quoted text
__________________________________________ use Win32::SystemInfo; my %mHash = (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) {0;}
__________________________________________ don't fail anymore as they did in 0.11. So I am closing this bug.
From: compuvision.sr [...] gmail.com
Show quoted text
> I tested the newly released 0.12 of Win32-SystemInfo ( > http://search.cpan.org/~cjohnston/Win32-SystemInfo-0.12/ ). nmake test
and Show quoted text
> __________________________________________ > use Win32::SystemInfo; > my %mHash = (TotalPhys => 0, AvailPhys => 0, MemLoad => 0); > if (Win32::SystemInfo::MemoryStatus(%mHash)) {0;} > __________________________________________ > don't fail anymore as they did in 0.11. So I am closing this bug.
Thanks very much!