Can you run Inline::C? I need your help...

dagolden on 2007-11-18T16:21:09

If you have or can install Inline::C, I'd greatly appreciate your help testing IO-CaptureOutput-1.05_53.

I've recently adopted IO::CaptureOutput, which is a wonderful tool for capturing program output to STDOUT or STDERR without ties and regardless of whether the output comes from perl, XS or programs in a subprocess.

However, the tests for XS use Inline::C and the C code was found to have portability problems (i.e. segfault on some Win32 platforms). At least one fix for Microsoft Visual C++ (MSVC) then broke on someone else's Linux platform.

(Aside: the fact that it it this hard to portably print the equivalent of "Hello World" to STDOUT and STDERR just astonishes me.)

My latest attempt at updating the C code now uses different code for MSVC and other compilers and now I want to test this as far and as wide as I can.

So if you have installed Inline::C and something that can send test reports (e.g. CPAN::Reporter), please test IO-CaptureOutput-1.05_53. For example, from the CPAN shell:

cpan> test DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz

Thank you very much,

-- dagolden


Re: Can you run Inline::C?

cosimo on 2007-11-18T17:35:46

Hi!
I don't know if you are interested in non-MSVC reports, but this is the test result on Windows Vista, 32bit, with latest Strawberry Perl (mingw/gcc).

Couldn't seem to install CPAN::Reporter, because IO::CaptureOutput is a dependency...

Didn't dig into the test failure.
If you want me to do that, or test something else, just ask.

------------------

Checking if your kit is complete...
Looks good
Writing Makefile for IO::CaptureOutput
cp lib/IO/CaptureOutput.pm blib\lib\IO\CaptureOutput.pm
cp lib/IO/CaptureOutput.pod blib\lib\IO\CaptureOutput.pod
    DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz
    C:\strawberry-perl\dmake\bin\dmake.EXE -- OK
Running make test
C:\strawberry-perl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes
s(0, 'blib\lib', 'blib\arch')" t/*.t
t/capture...........ok
t/capture_exec......ok
t/noconsole.........ok
t/wperl.............1/4
# Failed test ''wperl-exec.pl' capture correct'
# in t/wperl.t at line 44.
# Structures begin differing at:
# $got->[1] = Does not exist
# $expected->[1] = 'STDERR
# '
# Looks like you failed 1 test of 4.
t/wperl............. Dubious, test returned 1 (wstat 256, 0x100)
  Failed 1/4 subtests

Test Summary Report
-------------------
t/wperl.t (Wstat: 256 Tests: 4 Failed: 1)
    Failed test number(s): 4
    Non-zero exit status: 1
Files=4, Tests=37, 6 wallclock secs ( 0.05 usr + 0.00 sys = 0.05 CPU)
Result: FAIL
Failed 1/4 test programs. 1/37 subtests failed.
dmake.EXE: Error code 129, while making 'test_dynamic'
    DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz
    C:\strawberry-perl\dmake\bin\dmake.EXE test -- NOT OK //hint// to see the cpan-testers results for installing this module, try:
    reports DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz
Failed during this command:
  DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz : make_test NO

cpan[5]>

Re: Can you run Inline::C?

dagolden on 2007-11-19T04:45:33

That's odd. It works for me on Win XP with Strawberry Perl. Maybe it's a Vista thing. Have you customized anything about your installation? (E.g. moved MinGW, not that I think that should matter.)

Could you please send me the output of "perl -V"? (If you don't mind, please email it to dagolden at cpan.org, so I can followup more conveniently).

Thanks in advance,

-- dagolden

Re: Can you run Inline::C?

cosimo on 2007-11-19T08:26:17

Follow-up on your inbox. :-)

Re: Can you run Inline::C?

fireartist on 2007-11-19T10:17:40

Has Strawberry Perl been upgraded to use a newer gcc package that supports Vista?
The last time I checked (2-3 months ago), gcc didn't work on Vista at all, and I couldn't install any perl XS modules.
I've found something in the mingw mailing lists about a "gcc-vista", but it's not listed on the SF download page.
(Sorry I can't be more helpful, I don't currently have a Vista box set up).

Re: Can you run Inline::C?

cosimo on 2007-11-19T10:50:37

The latest strawberry works and compiles just fine. Installed Inline::C without problems. I had just to add manually the "libexec/blabla/blabla/" path...

Re: Can you run Inline::C?

fireartist on 2007-11-19T11:10:35

That's good to know, thanks.
The lack of a working perl was the last issue stopping me replacing my severely outdated home G4 with a vista box.
(I don't think linux will ever be family friendly enough)

ActivePerl 5.8.8 + MinGW

bart on 2007-11-18T19:12:50

You must have done something right, because with ActivePerl 5.8.8 (build 817) and MinGW 3.2.3 it passes all tests. That is the setup where the module ActivePerl::Config overrides some settings on Config so it can use MinGW gcc as a C compiler.

So, I'm now trying to run the same tests on Windows 98... I'm expecting some more troubles because Win98 is more primitive in some regards...

Well indeed. I'm having troubles with it, actually, the same problems when trying to install Inline with CPAN (I ended up installing Inline with PPM):

NMAKE : fatal error U1073: don't know how to make '2'
I'm thinking this is actually a problem with MakeMaker, because it attempts to use 2>&1 on a platform (shell) that doesn't support it.

The problem occurred twice, somewhere between the 12th and the last test out of 15 in t/capture.

Oddly enough, the final verdict is:

All tests successful, 3 subtests skipped.
Files=4, Tests=37, 14 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
So despite 2 fatal nmake errors, it still passes...? Can we trust your tests?

The latter was with ActivePerl 5.8.8 build 822 + MinGW 3.4.2 on Windows 98.

Re:ActivePerl 5.8.8 + MinGW

dagolden on 2007-11-18T22:55:14

The final verdict makes sense -- 3 tests are skipped if Inline::C fails to build and bind the source code. (Which happens between test 12 and test 13.) Those nmake problems are from Inline itself. This is a great example of the limitations of PPM's -- you don't get to see any actual tests on your actual system.

Thanks for running the tests -- I'm glad the ActiveState/MinGW tests worked.

-- dagolden

Passes for me

mattriffle on 2007-11-18T21:37:49

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/capture.........ok
t/capture_exec....ok
t/noconsole.......ok
t/wperl...........skipped
                all skipped: not MSWin32
All tests successful, 1 test skipped.
Files=4, Tests=33, 4 wallclock secs ( 1.39 cusr + 0.42 csys = 1.81 CPU)
    make test -- OK

FreeBSD qenni.pair.com 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #1: Mon Feb 12 20:47:55 EST 2007 /usr/obj/usr/src/sys/6PAIRc i386

Cygwin and MSWin32 good.

mw487 on 2007-11-19T16:29:19

Cygwin: All tests successful.

        osname=cygwin, osvers=1.5.24(0.15642), archname=cygwin-thread-multi-64int
        uname='cygwin_nt-5.1 reini 1.5.24(0.15642) 2007-01-31 10:57 i686 cygwin '

MSWin32: All tests successful, 3 subtests skipped.

Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
    Platform:
        osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread

$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
    Platform:
        osname=cygwin, osvers=1.5.24(0.15642), archname=cygwin-thread-multi-64int
        uname='cygwin_nt-5.1 reini 1.5.24(0.15642) 2007-01-31 10:57 i686 cygwin '
        config_args='-de -Dmksymlinks -Duse64bitint -Dusethreads -Uusemymalloc -Dopt
imize=-O3 -Dman3ext=3pm -Dusesitecustomize -Dusedevel'
        hint=recommended, useposix=true, d_sigaction=define
        usethreads=define use5005threads=undef useithreads=define usemultiplicity=de
fine
        useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
        use64bitint=define use64bitall=undef uselongdouble=undef
        usemymalloc=n, bincompat5005=undef
    Compiler:
        cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdecl
aration-after-statement',
        optimize='-O3',
        cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-af
ter-statement'
        ccversion='', gccversion='3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
', gccosandvers=''
        intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
        d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
        ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lsee
ksize=8
        alignbytes=8, prototype=define
    Linker and Libraries:
        ld='ld2', ldflags =' -s -L/usr/local/lib'
        libpth=/usr/local/lib /usr/lib /lib
        libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
        perllibs=-ldl -lcrypt -lgdbm_compat
        libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a
        gnulibc_version=''
    Dynamic Linking:
        dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
        cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'

Characteristics of this binary (from libperl):
    Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                                                PERL_MALLOC_WRAP PERL_USE_SAFE_PUTENV
                                                USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                                                USE_PERLIO USE_REENTRANT_API USE_SITECUSTOMIZE
    Locally applied patches:
                CYG01 - hints.cygwin.sh ldflags -s
                CYG02 - lib-ExtUtils-Embed insensitive against leading \s
                CYG03 - lib-Test-Harness-Straps $ENV{PERL5LIB} = ''
                CYG04 - major.version.cygwin.sh cygperl-5_8.dll and not cygperl-5_8_x.dl
l
                CYG05 - add Win32CORE to core
                CYG07 - File-Spec-Cygwin-TMPDIR.patch
                Bug#38628 - allow legacy Cwd->cwd()
                Bug#40103 - File-Spec-case_tolerant.patch from 5.9.5
    Built under cygwin
    Compiled at Jul 8 2007 19:12:08
    %ENV:
        CYGWIN=""
    @INC: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8
        .
    CPAN.pm: Going to build D/DA/DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for IO::CaptureOutput
cp lib/IO/CaptureOutput.pm blib/lib/IO/CaptureOutput.pm
cp lib/IO/CaptureOutput.pod blib/lib/IO/CaptureOutput.pod /usr/bin/make -- OK
Running make test /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'b
lib/arch')" t/*.t
t/capture...........ok
t/capture_exec......ok
t/noconsole.........ok
t/wperl.............skipped: not MSWin32
All tests successful.
Files=4, Tests=33, 16 wallclock secs ( 0.03 usr 0.03 sys + 5.94 cusr 5.67 csy
s = 11.68 CPU)
Result: PASS /usr/bin/make test -- OK

cpan> exit
Lockfile removed.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

P:\>perl -V
Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
    Platform:
        osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
        uname=''
        config_args='undef'
        hint=recommended, useposix=true, d_sigaction=undef
        usethreads=define use5005threads=undef useithreads=define usemultiplicity=de
fine
        useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
        use64bitint=undef use64bitall=undef uselongdouble=undef
        usemymalloc=n, bincompat5005=undef
    Compiler:
        cc='gcc', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYP
T -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTE
XT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-st
rict-aliasing',
        optimize='-O2',
        cppflags='-DWIN32'
        ccversion='', gccversion='3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
', gccosandvers=''
        intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
        d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
        ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksi
ze=8
        alignbytes=8, prototype=define
    Linker and Libraries:
        ld='g++', ldflags ='-L"C:\ActiveStatePerl\lib\CORE"'
        libpth=\lib
        libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32
-lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -
lodbccp32 -lmsvcrt
        perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshel
l32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc
32 -lodbccp32 -lmsvcrt
        libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl58.lib
        gnulibc_version=''
    Dynamic Linking:
        dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
        cccdlflags=' ', lddlflags='-mdll -L"C:\ActiveStatePerl\lib\CORE"'

Characteristics of this binary (from libperl):
    Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                                                PERL_IMPLICIT_SYS PERL_MALLOC_WRAP
                                                PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES
                                                USE_PERLIO USE_SITECUSTOMIZE
    Locally applied patches:
                ActivePerl Build 822 [280952]
                Iin_load_module moved for compatibility with build 806
                PerlEx support in CGI::Carp
                Less verbose ExtUtils::Install and Pod::Find
                Patch for CAN-2005-0448 from Debian with modifications
                Rearrange @INC so that 'site' is searched before 'perl'
                Partly reverted 24733 to preserve binary compatibility
                MAINT31223 plus additional changes
                31490 Problem bootstraping Win32CORE
                31324 Fix DynaLoader::dl_findfile() to locate .so files again
                31214 Win32::GetLastError fails when first called
                31211 Restore Windows NT support
                31188 Problem killing a pseudo-forked child on Win32
                29732 ANSIfy the PATH environment variable on Windows
                27527,29868 win32_async_check() can loop indefinitely
                26970 Make Passive mode the default for Net::FTP
                26379 Fix alarm() for Windows 2003
                24699 ICMP_UNREACHABLE handling in Net::Ping
    Built under MSWin32
    Compiled at Jul 31 2007 19:34:48
    %ENV:
    @INC:
        C:/ActiveStatePerl/site/lib
        C:/ActiveStatePerl/lib
        .
    CPAN.pm: Going to build D/DA/DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz

Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Checking if your kit is complete...
Looks good
Writing Makefile for IO::CaptureOutput

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

cp lib/IO/CaptureOutput.pm blib\lib\IO\CaptureOutput.pm
cp lib/IO/CaptureOutput.pod blib\lib\IO\CaptureOutput.pod
    DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz
    nmake -- OK
Running make test

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

                C:\ActiveStatePerl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_har
ness(0, 'blib\lib', 'blib\arch')" t/*.t
t/capture.........Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, usi
ng dmd 0.125)
t/capture.........ok
                3/15 skipped: various reasons
t/capture_exec....ok
t/noconsole.......ok
t/wperl...........ok
All tests successful, 3 subtests skipped.
Files=4, Tests=37, 3 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU)
    DAGOLDEN/IO-CaptureOutput-1.05_53.tar.gz
    nmake test -- OK

cpan>