Skip Menu |
 

This queue is for tickets about the IO-Socket-SSL CPAN distribution.

Report information
The Basics
Id: 104659
Status: resolved
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

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



Subject: output from ps is different on Cygwin
Download (untitled) / with headers
text/plain 167b
Thte output from ps is different on Cygwin, so the test fails due to that. However, the /proc/<pid>/statm interface works and is generally preferrable when it exists.
Subject: perl-IO-Socket-SSL.src1.patch
--- origsrc/IO-Socket-SSL-2.015/t/memleak_bad_handshake.t 2015-04-17 14:06:34.000000000 +0200 +++ src/IO-Socket-SSL-2.015/t/memleak_bad_handshake.t 2015-05-23 22:02:45.936309200 +0200 @@ -84,7 +84,7 @@ exit; sub getsize { my $pid = shift; - open( my $ps,'-|',"ps -o vsize -p $pid 2>/dev/null" ) or return; - $ps && <$ps> or return; # header - return int(<$ps>); # size + open my $STATM, "</proc/$pid/statm" || die "Cannot open /proc/$pid/statm!\n"; + my @data = <$STATM>; @_ = split '', "@data"; + return int($_[0]); }
Download (untitled) / with headers
text/plain 467b
Am So 24. Mai 2015, 07:00:21, https://me.yahoo.com/howdidwegetherereally#f714d schrieb: Show quoted text
> Thte output from ps is different on Cygwin, so the test fails due to > that. However, the /proc/<pid>/statm interface works and is generally > preferrable when it exists.
Sorry, but /proc/pid is a Linux specific thing and does not exist on *BSD (at least not OpenBSD). This means it is not usable cross-platform. How does the output from 'ps -o vsize -p pid' looks on Cygwin?
Download (untitled) / with headers
text/plain 834b
On Sun May 24 13:09:07 2015, SULLR wrote: Show quoted text
> Am So 24. Mai 2015, 07:00:21, > https://me.yahoo.com/howdidwegetherereally#f714d schrieb:
> > Thte output from ps is different on Cygwin, so the test fails due to > > that. However, the /proc/<pid>/statm interface works and is > > generally > > preferrable when it exists.
> > Sorry, but /proc/pid is a Linux specific thing and does not exist on > *BSD (at least not OpenBSD). > This means it is not usable cross-platform.
Sure, but the reason for using it is another non-portability, so I don't see where it's a loss. Show quoted text
> How does the output from 'ps -o vsize -p pid' looks on Cygwin?
~ (2002) ps -o vsize -p 1892 ps: unknown option -- o Try `ps --help' for more information. No, there's no other option to give the output you want. Can you see how that's not going to be helpful? :-)
Download (untitled) / with headers
text/plain 402b
Show quoted text
> Sure, but the reason for using it is another non-portability, so I > don't see where it's a loss.
I consider *BSD actually more important than cygwin :) But anyway, the code now tries to detect support for /proc/*/statm and will use it if supported. If not it will fall back to using ps. See https://github.com/noxxi/p5-io-socket-ssl/commit/6c69321bfc529a314b959038e8f0a433943910f3 Thanks, Steffen
Download (untitled) / with headers
text/plain 759b
On Tue May 26 17:15:21 2015, SULLR wrote: Show quoted text
> I consider *BSD actually more important than cygwin :)
If you must. :-) Show quoted text
> But anyway, the code now tries to detect support for /proc/*/statm and > will use it if supported.
Thanks. BTW, pagesize isn't necessarily 4kB (it actually is 64kB on Cygwin), although statm may always report it in 4kB chunks anyway (as it does on Cygwin currently). If you really must have the memory size in actual kB, then field #23 of /proc<pid>/stat gives you the vmsize in bytes (that is the information that ps would access on Linux). Show quoted text
> If not it will fall back to using ps. > See https://github.com/noxxi/p5-io-socket- > ssl/commit/6c69321bfc529a314b959038e8f0a433943910f3
Works for me, one local patch I can drop. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.