Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[rt.cpan.org #80217] Build failure under Cygwin on Windows

34 views
Skip to first unread message

Jerry D. Hedden via RT

unread,
Oct 16, 2012, 8:53:50 AM10/16/12
to libw...@perl.org
Tue Oct 16 08:53:50 2012: Request 80217 was acted upon.
Transaction: Ticket created by JDHEDDEN
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


Checking if your kit is complete...
Looks good
Writing Makefile for Win32::API::Callback
Writing MYMETA.yml and MYMETA.json
Writing Makefile for Win32::API
Writing MYMETA.yml and MYMETA.json

cp Type.pm blib/lib/Win32/API/Type.pm
cp Callback.pm blib/lib/Win32/API/Callback.pm
cp Test.pm blib/lib/Win32/API/Test.pm
cp Struct.pm blib/lib/Win32/API/Struct.pm
cp API.pm blib/lib/Win32/API.pm
cp IATPatch.pod blib/lib/Win32/API/Callback/IATPatch.pod
make[1]: Entering directory `/var/perl/cpan/build/Win32-API-
0.72/Callback'
/usr/bin/perl.exe /usr/lib/perl5/5.17.5/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.17.5/ExtUtils/typemap Callback.xs > Callback.xsc && mv
Callback.xsc Callback.c
gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS -fno-
strict-aliasing -pipe -fstack-protector -I/usr/local/include -
DUSEIMPORTLIB -Os -pipe -funit-at-a-time -march=pentium4 -mfpmath=sse -
mieee-fp -mmmx -msse -msse2 -DVERSION=\"0.72\" -DXS_VERSION=\"0.72\"
"-I/usr/lib/perl5/5.17.5/cygwin/CORE" Callback.c
Callback.xs: In function 'PerlCallback':
Callback.xs:229:5: warning: cast from pointer to integer of different
size
Callback.xs: In function 'XS_Win32__API__Callback__HeapBlock_new':
Callback.xs:625:18: warning: cast from pointer to integer of different
size
Callback.xs: In function 'XS_Win32__API__Callback__HeapBlock_DESTROY':
Callback.xs:653:27: warning: cast to pointer from integer of different
size
Callback.xs: In function 'XS_Win32__API__Callback__IATPatch_new':
Callback.xs:681:21: warning: cast to pointer from integer of different
size
Callback.xs:695:23: warning: cast to pointer from integer of different
size
Callback.xs:704:5: warning: cast from pointer to integer of different
size
Callback.xs:706:5: warning: cast from pointer to integer of different
size
Callback.xs: In function 'XS_Win32__API__Callback__IATPatch_Unpatch':
Callback.xs:742:19: warning: cast to pointer from integer of different
size
Callback.xs:744:13: warning: cast to pointer from integer of different
size
rm -f ../blib/arch/auto/Win32/API/Callback/Callback.dll
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--
enable-auto-image-base -s -L/usr/local/lib -fstack-protector Callback.o
-o ../blib/arch/auto/Win32/API/Callback/Callback.dll \
/usr/lib/perl5/5.17.5/cygwin/CORE/cygperl5_17_5.dll \

chmod 755 ../blib/arch/auto/Win32/API/Callback/Callback.dll
test -s Callback.bs && cp Callback.bs
../blib/arch/auto/Win32/API/Callback/Callback.bs && \
chmod 644 ../blib/arch/auto/Win32/API/Callback/Callback.bs
Makefile:444: recipe for target
`../blib/arch/auto/Win32/API/Callback/Callback.dll' failed
make[1]: [../blib/arch/auto/Win32/API/Callback/Callback.dll] Error 1
(ignored)
make[1]: Leaving directory `/var/perl/cpan/build/Win32-API-
0.72/Callback'
/usr/bin/perl.exe /usr/lib/perl5/5.17.5/ExtUtils/xsubpp -nolinenumbers
-typemap /usr/lib/perl5/5.17.5/ExtUtils/typemap -typemap typemap API.xs
> API.xsc && mv API.xsc API.c
gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS -fno-
strict-aliasing -pipe -fstack-protector -I/usr/local/include -
DUSEIMPORTLIB -Os -pipe -funit-at-a-time -march=pentium4 -mfpmath=sse -
mieee-fp -mmmx -msse -msse2 -DVERSION=\"0.72\" -DXS_VERSION=\"0.72\"
"-I/usr/lib/perl5/5.17.5/cygwin/CORE" API.c
API.c:123:55: error: expected declaration specifiers or '...' before
'__int32'
API.c: In function 'w32sv_setwstr':
API.c:131:22: error: 'wlenparam' undeclared (first use in this function)
API.c:131:22: note: each undeclared identifier is reported only once for
each function it appears in
API.c:150:15: error: 'WC_NO_BEST_FIT_CHARS' undeclared (first use in
this function)
API.c: In function 'XS_Win32__API_LoadLibrary':
API.c:371:13: warning: cast from pointer to integer of different size
API.c: In function 'XS_Win32__API_GetProcAddress':
API.c:390:15: warning: cast to pointer from integer of different size
API.c: In function 'XS_Win32__API_FreeLibrary':
API.c:414:15: warning: cast to pointer from integer of different size
API.c: In function 'XS_Win32__API_PointerTo':
API.c:506:5: warning: cast from pointer to integer of different size
API.c: In function 'XS_Win32__API_SafeReadWideCString':
API.c:701:19: error: 'WC_NO_BEST_FIT_CHARS' undeclared (first use in
this function)
API.c: In function 'XS_Win32__API_GetModuleFileName':
API.c:747:14: warning: cast to pointer from integer of different size
API.c:765:9: error: too many arguments to function 'w32sv_setwstr'
API.c:123:13: note: declared here
API.c: In function 'XS_Win32__API_Call':
API.c:1106:19: warning: cast to pointer from integer of different size
Makefile:351: recipe for target `API.o' failed
make: *** [API.o] Error 1

If you need more information, just holler. (And, if possible, it might
be good to fix those warnings.)

My 'perl -V' dump:


Summary of my perl5 (revision 5 version 17 subversion 5 patch 54805)
configuration:
Snapshot of: f7a5efebd238ec9a1dc9839d1d642288cee9de56
Platform:
osname=cygwin, osvers=1.7.16(0.26253), archname=cygwin-thread-multi-
64int
uname='cygwin_nt-5.1 med-heddenj 1.7.16(0.26253) 2012-07-20 22:55
i686 cygwin '
config_args='-de -Duse64bitint -Dusethreads -Uusemymalloc -Dusedevel
-Dversiononly=no -Dinstallusrbinperl -Uusemallocwrap -
Dinc_version_list=none -Dnoextensions=DB_File Devel/DProf Devel/Peek
GDBM_File IPC/SysV NDBM_File ODBM_File Sys/Syslog Text/Soundex
Time/Piece attrs B/Debug B/Lint -A append:ccflags= -DNO_MATHOMS -A
define:optimize=-Os -pipe -funit-at-a-time -march=pentium4 -mfpmath=sse
-mieee-fp -mmmx -msse -msse2'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
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 -U__STRICT_ANSI__ -
DNO_MATHOMS -fno-strict-aliasing -pipe -fstack-protector -
I/usr/local/include',
optimize='-Os -pipe -funit-at-a-time -march=pentium4 -mfpmath=sse -
mieee-fp -mmmx -msse -msse2',
cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS -
fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.5.3', 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', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-
symbols -Wl,--enable-auto-image-base -s -fstack-protector -
L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-ldb -ldl -lcrypt
perllibs=-ldl -lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true,
libperl=cygperl5_17_5.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,-
-export-all-symbols -Wl,--enable-auto-image-base -s -L/usr/local/lib -
fstack-protector'


Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY NO_MATHOMS PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_PRESERVE_IVUV PERL_USE_DEVEL
PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
USE_PERL_ATOF USE_REENTRANT_API
Built under cygwin
Compiled at Oct 12 2012 09:44:38
%ENV:
PERLIO="perlio"
CYGWIN="nodosfilewarning"
@INC:
/usr/lib/perl5/site_perl/5.17.5/cygwin
/usr/lib/perl5/site_perl/5.17.5
/usr/lib/perl5/5.17.5/cygwin
/usr/lib/perl5/5.17.5
.

Daniel Dragan via RT

unread,
Oct 16, 2012, 2:21:17 PM10/16/12
to libw...@perl.org
Tue Oct 16 14:21:15 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Tue Oct 16 08:53:50 2012, JDHEDDEN wrote:
> If you need more information, just holler. (And, if possible, it might
> be good to fix those warnings.)
>


> Makefile:444: recipe for target
> `../blib/arch/auto/Win32/API/Callback/Callback.dll' failed
> make[1]: [../blib/arch/auto/Win32/API/Callback/Callback.dll] Error 1
> (ignored)
> make[1]: Leaving directory `/var/perl/cpan/build/Win32-API-
> 0.72/Callback'

Why did Callback.dll fail to build? Other than the 32 to 64 cast
warnings, I dont see anything else in the compiler log.

> API.c:123:55: error: expected declaration specifiers or '...' before
> '__int32'
> API.c: In function 'w32sv_setwstr':
> API.c:131:22: error: 'wlenparam' undeclared (first use in this function)
> API.c:131:22: note: each undeclared identifier is reported only once for
> each function it appears in
> API.c:150:15: error: 'WC_NO_BEST_FIT_CHARS' undeclared (first use in
> this function)

WC_NO_BEST_FIT_CHARS is defined in Cygwin
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/winnls.h?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=src
in a WINVER conditional and it also is in a WINVER conditional on Visual
C. But Win32:: has
___________________________________________________
#ifndef WC_NO_BEST_FIT_CHARS
# define WC_NO_BEST_FIT_CHARS 0x00000400
#endif
___________________________________________________
in it. Strawberry does not keep WC_NO_BEST_FIT_CHARS in a conditional
http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-headers/include/winnls.h?revision=5147&view=markup
. I'll guess Cygwin Perl does not set WINVER but native Win32 Perl does.

Strawberry defines __int3264 in
http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-headers/include/basetsd.h?revision=5316&view=markup
and __int32 in
http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-headers/crt/_mingw.h.in?revision=5431&view=markup
. Cygwin defines __int3264 in
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/basetsd.h?rev=1.6&content-type=text/x-cvsweb-markup&cvsroot=src
but I dont have Cygwin's headers to grep to see if __int32 is defined. I
think I will try INT_PTR instead of __int3264.

Getting Win32::API working on your 32 bit with quads Cygwin will take a
couple trys since once it compiles, I bet a 32 bit with 64 ivs bug will
come up. Can you try my github version (not right now, no changes are up
right now) at https://github.com/bulk88/perl5-win32-api in the future as
part of this ticket? IDK if Cosimo has time to make new CPAN releases
which may or may not work on Cygwin, and I really wouldn't want
Win32::API to hit 1.00 any time soon.

Jerry D. Hedden via RT

unread,
Oct 16, 2012, 8:15:01 PM10/16/12
to libw...@perl.org
Tue Oct 16 20:15:00 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


> Can you try my github version (not right now, no changes are up
> right now) at https://github.com/bulk88/perl5-win32-api in the future
> as part of this ticket?
Yes, I can access it. I'd be more than happy to test any changes you
make.

Daniel Dragan via RT

unread,
Oct 16, 2012, 10:03:40 PM10/16/12
to libw...@perl.org
Tue Oct 16 22:03:39 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Tue Oct 16 20:15:00 2012, JDHEDDEN wrote:
> Yes, I can access it. I'd be more than happy to test any changes you
> make.

New version up at https://github.com/bulk88/perl5-win32-api . Try it and
report back.

Jerry D. Hedden via RT

unread,
Oct 17, 2012, 7:51:30 AM10/17/12
to libw...@perl.org
Wed Oct 17 07:51:29 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On 2012-10-16 22:03:39, BULKDD wrote:
> On Tue Oct 16 20:15:00 2012, JDHEDDEN wrote:
> > Yes, I can access it. I'd be more than happy to test any changes
you
> > make.
>
> New version up at https://github.com/bulk88/perl5-win32-api . Try it
and
> report back.

Progress. It builds, but segfaults on testing:



> make
cp Type.pm blib/lib/Win32/API/Type.pm
cp Callback.pm blib/lib/Win32/API/Callback.pm
cp Test.pm blib/lib/Win32/API/Test.pm
cp Struct.pm blib/lib/Win32/API/Struct.pm
cp API.pm blib/lib/Win32/API.pm
cp IATPatch.pod blib/lib/Win32/API/Callback/IATPatch.pod
make[1]: Entering directory `/d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/Callback'
/usr/bin/perl.exe /usr/lib/perl5/5.16.1/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.16.1/ExtUtils/typemap Callback.xs > Callback.xsc && mv
Callback.xsc Callback.c
gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS -fno-
strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time -
march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2 -
DVERSION=\"0.72\" -DXS_VERSION=\"0.72\" "-
I/usr/lib/perl5/5.16.1/cygwin/CORE" Callback.c
In file included from Callback.xs:36:
../API.h:85: warning: malformed '#pragma pack(push[, id], <n>)' -
ignored
../API.h:93: warning: #pragma pack (pop) encountered without matching
#pragma pack (push, <n>)
Callback.xs: In function `PerlCallback':
Callback.xs:229: warning: cast from pointer to integer of different size
Callback.xs: In function `XS_Win32__API__Callback__HeapBlock_new':
Callback.xs:625: warning: cast from pointer to integer of different size
Callback.xs: In function `XS_Win32__API__Callback__HeapBlock_DESTROY':
Callback.xs:653: warning: cast to pointer from integer of different size
Callback.xs: In function `XS_Win32__API__Callback__IATPatch_new':
Callback.xs:681: warning: cast to pointer from integer of different size
Callback.xs:695: warning: cast to pointer from integer of different size
Callback.xs:704: warning: cast from pointer to integer of different size
Callback.xs:706: warning: cast from pointer to integer of different size
Callback.xs: In function `XS_Win32__API__Callback__IATPatch_Unpatch':
Callback.xs:742: warning: cast to pointer from integer of different size
Callback.xs:744: warning: cast to pointer from integer of different size
rm -f ../blib/arch/auto/Win32/API/Callback/Callback.dll
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--
enable-auto-image-base -s -L/usr/local/lib Callback.o -o
../blib/arch/auto/Win32/API/Callback/Callback.dll \
/usr/lib/perl5/5.16.1/cygwin/CORE/cygperl5_16_1.dll
\

chmod 755 ../blib/arch/auto/Win32/API/Callback/Callback.dll
test -s Callback.bs && cp Callback.bs
../blib/arch/auto/Win32/API/Callback/Callback.bs && \
chmod 644 ../blib/arch/auto/Win32/API/Callback/Callback.bs
make[1]: [../blib/arch/auto/Win32/API/Callback/Callback.dll] Error 1
(ignored)
make[1]: Leaving directory `/d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/Callback'
/usr/bin/perl.exe /usr/lib/perl5/5.16.1/ExtUtils/xsubpp -nolinenumbers
-typemap /usr/lib/perl5/5.16.1/ExtUtils/typemap -typemap typemap API.xs
> API.xsc && mv API.xsc API.c
gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -DNO_MATHOMS -fno-
strict-aliasing -pipe -DUSEIMPORTLIB -Os -pipe -funit-at-a-time -
march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2 -
DVERSION=\"0.72\" -DXS_VERSION=\"0.72\" "-
I/usr/lib/perl5/5.16.1/cygwin/CORE" API.c
In file included from API.c:28:
API.h:85: warning: malformed '#pragma pack(push[, id], <n>)' - ignored
API.h:93: warning: #pragma pack (pop) encountered without matching
#pragma pack (push, <n>)
API.c: In function `XS_Win32__API_LoadLibrary':
API.c:371: warning: cast from pointer to integer of different size
API.c: In function `XS_Win32__API_GetProcAddress':
API.c:390: warning: cast to pointer from integer of different size
API.c: In function `XS_Win32__API_FreeLibrary':
API.c:414: warning: cast to pointer from integer of different size
API.c: In function `XS_Win32__API_PointerTo':
API.c:506: warning: cast from pointer to integer of different size
API.c: In function `XS_Win32__API_GetModuleFileName':
API.c:747: warning: cast to pointer from integer of different size
API.c: In function `XS_Win32__API_Call':
API.c:1106: warning: cast to pointer from integer of different size
rm -f blib/arch/auto/Win32/API/API.dll
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--
enable-auto-image-base -s -L/usr/local/lib API.o -o
blib/arch/auto/Win32/API/API.dll \
/usr/lib/perl5/5.16.1/cygwin/CORE/cygperl5_16_1.dll
\

chmod 755 blib/arch/auto/Win32/API/API.dll
test -s API.bs && cp API.bs blib/arch/auto/Win32/API/API.bs && \
chmod 644 blib/arch/auto/Win32/API/API.bs
make: [blib/arch/auto/Win32/API/API.dll] Error 1 (ignored)


> make test
chmod 755 API_test.dll
make[1]: Entering directory `/d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/Callback'
make[1]: Leaving directory `/d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/Callback'
PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_API.t .......... 1/48 # API test dll found at (./API_test.dll)
# Cygwin::winpid_to_pid()=66332
# Cygwin::winpid_to_pid()=66332
# Cygwin::winpid_to_pid()=66332
t/00_API.t .......... Failed 37/48 subtests
t/01_Struct.t ....... 1/18 # $^E=
t/01_Struct.t ....... Failed 13/18 subtests
t/02_GetProcess.t ... 1/3 # $result=66376
# $$=67856
t/02_GetProcess.t ... ok
t/03_undef.t ........ 1/3 # Win32::API 0.72
# Import:
t/03_undef.t ........ Failed 2/3 subtests
t/04_rt_48006.t ..... 1/4

Uninit warnings are intentional

Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
Use of uninitialized value in pack at /d/Xfer/bulk88-perl5-win32-api-
ce9d4d7/blib/lib/Win32/API/Struct.pm line 317.
# Size is 296. Should be 296
t/04_rt_48006.t ..... ok
t/05_more_struct.t .. ok
t/06_rt_74578.t ..... 1/3 # @pack=(LLLLLLLlLa260, ARRAY(0x802870),
ARRAY(0x802990), 296, ARRAY(0x7fa1d0))
t/06_rt_74578.t ..... ok
t/benchmark.t ....... 1/7 # API test dll found at (./API_test.dll)
t/benchmark.t ....... Failed 2/7 subtests
t/pod-coverage.t .... ok
t/pod.t ............. ok
t/v69.t ............. 1/36 # API test dll found at (./API_test.dll)
t/v69.t ............. Failed 32/36 subtests
t/v70.t ............. ok
t/v71.t ............. 1/23 # API test dll found at (./API_test.dll)
t/v71.t ............. Failed 19/23 subtests

Test Summary Report
-------------------
t/00_API.t (Wstat: 139 Tests: 11 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 48 tests but ran 11.
t/01_Struct.t (Wstat: 139 Tests: 5 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 18 tests but ran 5.
t/03_undef.t (Wstat: 139 Tests: 1 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 3 tests but ran 1.
t/benchmark.t (Wstat: 139 Tests: 5 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 7 tests but ran 5.
t/v69.t (Wstat: 139 Tests: 4 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 36 tests but ran 4.
t/v71.t (Wstat: 139 Tests: 4 Failed: 0)
Non-zero wait status: 139
Parse errors: Bad plan. You planned 23 tests but ran 4.
Files=13, Tests=90, 10 wallclock secs ( 0.13 usr 0.20 sys + 5.03 cusr
4.23 csys = 9.58 CPU)
Result: FAIL
Failed 6/13 test programs. 0/90 subtests failed.
make: *** [test_dynamic] Error 255


> perl -Mblib t/00_API.t
1..48
ok 1 - use Win32::API;
ok 2 - use Win32::API::Test;
ok 3 - use Win32;
ok 4 - loaded
# API test dll found at (./API_test.dll)
ok 5 - found API test dll
ok 6 - GetCurrentProcessId() function found
# Cygwin::winpid_to_pid()=66196
ok 7 - GetCurrentProcessId() result ok
# Cygwin::winpid_to_pid()=66196
ok 8 - GetCurrentProcessId() result ok
ok 9 - Import of GetCurrentProcessId() function from kernel32.dll
# Cygwin::winpid_to_pid()=66196
ok 10 - GetCurrentProcessId() result ok
ok 11 - Import of IsBadReadPtr function from kernel32.dll
Segmentation fault (core dumped)


> perl -Mblib t/01_Struct.t
1..18
ok 1 - use Win32::API;
ok 2 - use Win32::API::Test;
ok 3 - loaded
ok 4 - found API test dll
ok 5 - mangle_simple_struct() function
# $^E=
Segmentation fault (core dumped)


> perl -Mblib t/03_undef.t
1..3
# Win32::API 0.72
ok 1 - import sample API (PeekNamedPipe)
# Import:
Segmentation fault (core dumped)

> perl -Mblib t/benchmark.t
1..7
ok 1 - use Win32::API;
ok 2 - use Win32::API::Test;
# API test dll found at (./API_test.dll)
ok 3 - found API test dll
ok 4 - setlasterror_loop() function defined
ok 5 - QueryPerformanceCounter Win32::API obj created
Segmentation fault (core dumped)


> perl -Mblib t/v69.t
1..36
ok 1 - use Win32::API;
ok 2 - use Win32::API::Test;
ok 3 - use Win32;
# API test dll found at (./API_test.dll)
ok 4 - found API test dll
Segmentation fault (core dumped)


> perl -Mblib t/v71.t
1..23
ok 1 - use Win32::API;
ok 2 - use Win32::API::Test;
# API test dll found at (./API_test.dll)
ok 3 - found API test dll
ok 4 - find_char() function defined
Segmentation fault (core dumped)



Daniel Dragan via RT

unread,
Oct 17, 2012, 10:40:34 AM10/17/12
to libw...@perl.org
Wed Oct 17 10:40:33 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Wed Oct 17 07:51:29 2012, JDHEDDEN wrote:
>
> Progress. It builds, but segfaults on testing:
>

That is good. A new version is up at
https://github.com/bulk88/perl5-win32-api . It has a normally off
Win32::API verbose logging mode turned on. You will probably have to
redirect stderr to stdout on the console to get proper interleaving of
the 2. The TAP will be corrupt by the logging but the test line output
is still readable by a human. I am still looking at your last post, but
since I didn't quickly figure out what was wrong, I am requesting for
you to try the verbose debugging version up on github right now.

Reini Urban

unread,
Oct 17, 2012, 11:48:32 AM10/17/12
to bug-Wi...@rt.cpan.org, libw...@perl.org
On Wed, Oct 17, 2012 at 9:40 AM, Daniel Dragan via RT
<bug-Wi...@rt.cpan.org> wrote:
> On Wed Oct 17 07:51:29 2012, JDHEDDEN wrote:
>>
>> Progress. It builds, but segfaults on testing:

I can fully reproduce the errors.

> That is good. A new version is up at
> https://github.com/bulk88/perl5-win32-api . It has a normally off
> Win32::API verbose logging mode turned on. You will probably have to
> redirect stderr to stdout on the console to get proper interleaving of
> the 2. The TAP will be corrupt by the logging but the test line output
> is still readable by a human. I am still looking at your last post, but
> since I didn't quickly figure out what was wrong, I am requesting for
> you to try the verbose debugging version up on github right now.

t/00_API.t:
ok 11 - Import of IsBadReadPtr function from kernel32.dll
(PM)new: converted './API_test.dll' to
'API_test.dll'
Win32::API::new: Loading library 'API_test.dll'
(PM)parse_prototype: got PROC 'ThisFunctionDoesntExist'
(PM)parse_prototype: got PARAMS 'int a, int b'
(PM)parse_prototype: IN='int' PACKING='i' API_TYPE=3
(PM)parse_prototype: IN='int' PACKING='i' API_TYPE=3
parse_prototype: IN=[ 3 3 ]
parse_prototype: OUT='int' PACKING='i' API_TYPE=3
FAILED GetProcAddress for Proc 'ThisFunctionDoesntExist': Transport
endpoint is already connected
Segmentation fault (core dumped)

XS_Win32__API_Call (my_perl=0x200393c8, cv=0x202d8150) at API.c:866
866 params[i].t = T_NUMBER;
(gdb) bt
#0 XS_Win32__API_Call (my_perl=0x200393c8, cv=0x202d8150) at API.c:866
(gdb) p i
$1 = 0
(gdb) p params[i]
$2 = {{b = 0x8bdc4589 <Address 0x8bdc4589 out of bounds>, c = -119
'\211', s = 17801,
p = 0x8bdc4589 <Address 0x8bdc4589 out of bounds>, l = 2346468745,
f = -8.48455424e-32, d = -626.03395816886143,
q = -4574654168104680055}, t = 1 '\001'}

--
Reini Urban
http://cpanel.net/ http://www.perl-compiler.org/

Reini Urban via RT

unread,
Oct 17, 2012, 11:48:45 AM10/17/12
to libw...@perl.org
Wed Oct 17 11:48:44 2012: Request 80217 was acted upon.
Transaction: Correspondence added by rur...@x-ray.at
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


Daniel Dragan via RT

unread,
Oct 17, 2012, 1:55:57 PM10/17/12
to libw...@perl.org
Wed Oct 17 13:55:55 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Wed Oct 17 11:48:44 2012, rur...@x-ray.at wrote:
> I can fully reproduce the errors.

As you said on IRC the problem is alloca. I installed a Cygwin Perl.

$ perl -V
Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

Platform:
osname=cygwin, osvers=1.7.15(0.26053),
archname=cygwin-thread-multi-64int
uname='cygwin_nt-5.1 winxp 1.7.15(0.26053) 2012-05-09 10:25 i686
cygwin '
config_args='-de -Dlibperl=cygperl5_14.dll -Dcc=gcc-4 -Dld=g++-4
-Darchname=i686-cygwin-threads-64int -Dmksymlinks -Dusethreads -Accflags=-g'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc-4', ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g
-fno-strict-aliasing -pipe -fstack-protector',
optimize='-O3',
cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g
-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.5.3', 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', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++-4', ldflags =' -Wl,--enable-auto-import
-Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector
-L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
perllibs=-ldl -lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=cygperl5_14.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import
-Wl,--export-all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib
-fstack-protector'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_PRESERVE_IVUV
PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API
Locally applied patches:
Bug#55162 File::Spec::case_tolerant performance
CYG07 $vendorarch/auto/.rebase
CYG15 static Win32CORE
CYG17 cyg-1.7 paths-utf8
0c612ce82 Fix building static extensions on cygwin, -UUSEIMPORTLIB
1bac5ecc1 Fix 64-bit threading sv.c: S_anonymise_cv_maybe
Cygwin::sync_winenv added
Built under cygwin
Compiled at Jul 12 2012 14:17:21
%ENV:
PERL_JSON_BACKEND="JSON::XS"
PERL_YAML_BACKEND="YAML"
CYGWIN="tty"
@INC:
/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/site_perl/5.14
/usr/lib/perl5/vendor_perl/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/vendor_perl/5.14
/usr/lib/perl5/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/5.14
/usr/lib/perl5/site_perl/5.10
/usr/lib/perl5/vendor_perl/5.10
/usr/lib/perl5/site_perl/5.8
.

I got the same SEGV as others in this ticket said on benchmark.t. The
bug is limited to C funcs that Win32::API calls, that have more than 0
parameters, so this
https://metacpan.org/source/COSIMO/Win32-API-0.72/t/00_API.t#L46 didn't
crash, but 95% of everything else did. I used a assembly debugger (it
was faster for me, too much time to modify makefile.pl to include gdb
symbols), and what I think is the static linked in the DLL alloca,
returned in EAX (return value of alloca), the return instruction address
to right after the CALL alloca opcode, not a pointer to somewhere
near/in the C stack. The bug is towards the end of alloca since the
former return IP is read from the C stack into eax, then eax is pushed
on the c stack, then a retn to return. EAX now contains the return
instructionaddress (0x6E9E2772) while EBP is 0022AA48 and ESP is
0022A960 right before the retn opcode. This is a code generation problem
with Cygwin, not a problem with Win32::API. Here is what I think is
alloca is

6E9E4020 51 push ecx ; save ecx
6E9E4021 8D 4C 24 08 lea ecx,[esp+8]
6E9E4025 3D 00 10 00 00 cmp eax,1000h
6E9E402A 72 15 jb 6E9E4041
6E9E402C 81 E9 00 10 00 00 sub ecx,1000h
6E9E4032 83 09 00 or dword ptr [ecx],0
6E9E4035 2D 00 10 00 00 sub eax,1000h
6E9E403A 3D 00 10 00 00 cmp eax,1000h
6E9E403F 77 EB ja 6E9E402C
6E9E4041 29 C1 sub ecx,eax
6E9E4043 83 09 00 or dword ptr [ecx],0
6E9E4046 89 E0 mov eax,esp ;move orig esp to eax, our
new mem block
6E9E4048 89 CC mov esp,ecx ;move new sp to esp
6E9E404A 8B 08 mov ecx,dword ptr [eax]; restore ecx
from 6E9E4020
6E9E404C 8B 40 04 mov eax,dword ptr [eax+4] ;ret addr to
eax, and trash alloca-ed pointer
6E9E404F 50 push eax ;push eax on stack
6E9E4050 C3 ret ;pop off stack and jmp

Daniel Dragan via RT

unread,
Oct 17, 2012, 2:51:47 PM10/17/12
to libw...@perl.org
Wed Oct 17 14:51:46 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


the alloca was linked from /lib/gcc/i686-pc-cygwin/4.5.3/libgcc.a .
Looking at libgcc.a's disassembly it was identical to what I saw in API.dll.

for the record cygwin gcc -S output

.globl _XS_Win32__API_Call
.def _XS_Win32__API_Call; .scl 2; .type 32; .endef
_XS_Win32__API_Call:
LFB32:
.loc 1 726 0
LVL373:
pushl %ebp
LCFI161:
movl %esp, %ebp
LCFI162:
pushl %edi
LCFI163:
pushl %esi
LCFI164:
pushl %ebx
LCFI165:
subl $204, %esp
LCFI166:
.loc 1 726 0
movl 8(%ebp), %ebx
.loc 1 728 0
movl 72(%ebx), %eax
movl (%ebx), %edx
LVL374:
movl (%eax), %edi
LVL375:
subl $4, %eax
movl %eax, 72(%ebx)
movl 12(%ebx), %eax
LVL376:
movl %edx, %esi
leal (%eax,%edi,4), %ecx
LVL377:
subl %ecx, %esi
sarl $2, %esi
LVL378:
.loc 1 732 0
testl %esi, %esi
jle L331
LVL379:
.loc 1 728 0
leal 1(%edi), %ecx
LVL380:
movl %ecx, -108(%ebp)
LBB161:
.loc 1 737 0
movl (%eax,%ecx,4), %eax
movl %eax, -84(%ebp)
LVL381:
.loc 1 739 0
movl 16(%ebx), %eax
LVL382:
subl %edx, %eax
cmpl $11, %eax
jle L332
LVL383:
L192:
LBB163:
.loc 1 765 0
movl -84(%ebp), %eax
movl $LC45, 8(%esp)
movl %ebx, (%esp)
movl %eax, 4(%esp)
call _Perl_sv_isa
.loc 1 767 0
movl $0, 8(%esp)
movl $LC46, 4(%esp)
movl %ebx, (%esp)
.loc 1 765 0
movl %eax, -92(%ebp)
LVL384:
.loc 1 767 0
call _Perl_get_sv
.loc 1 768 0
movl -84(%ebp), %edx
movl 16(%edx), %edx
LBB270:
.loc 1 770 0
movl $0, 24(%esp)
LBE270:
.loc 1 767 0
movl %eax, -80(%ebp)
LVL385:
LBB269:
.loc 1 770 0
movl $0, 20(%esp)
LBE269:
.loc 1 768 0
movl %edx, -76(%ebp)
LVL386:
LBB268:
.loc 1 770 0
movl $32, 16(%esp)
movl $7, 12(%esp)
movl $LC47, 8(%esp)
movl %edx, 4(%esp)
movl %ebx, (%esp)
call _Perl_hv_common_key_len
LVL387:
.loc 1 772 0
movb $0, -109(%ebp)
.loc 1 771 0
testl %eax, %eax
je L193
.loc 1 771 0 is_stmt 0 discriminator 1
movl (%eax), %eax
LVL388:
movl %ebx, (%esp)
movl %eax, 4(%esp)
call _Perl_sv_true
testl %eax, %eax
setne -109(%ebp)
L193:
LVL389:
LBE268:
.loc 1 774 0 is_stmt 1
movl -76(%ebp), %ecx
movl $0, 24(%esp)
movl $0, 20(%esp)
movl $32, 16(%esp)
movl $5, 12(%esp)
movl $LC48, 8(%esp)
movl %ecx, 4(%esp)
movl %ebx, (%esp)
call _Perl_hv_common_key_len
LVL390:
.loc 1 775 0
movb $0, -101(%ebp)
.loc 1 764 0
movb $0, -93(%ebp)
.loc 1 775 0
testl %eax, %eax
je L194
.loc 1 775 0 is_stmt 0 discriminator 1
movl (%eax), %eax
LVL391:
testb $1, 9(%eax)
je L195
movl (%eax), %eax
movb $0, -101(%ebp)
.loc 1 764 0 is_stmt 1 discriminator 1
movb $0, -93(%ebp)
.loc 1 775 0 discriminator 1
movl 16(%eax), %edx
orl 20(%eax), %edx
setne %al
testb %al, %al
jne L333
LVL392:
L194:
.loc 1 782 0
movl -76(%ebp), %edx
.loc 1 786 0
subl $1, %esi
LVL393:
.loc 1 782 0
movl $0, 24(%esp)
movl $0, 20(%esp)
movl $32, 16(%esp)
movl %edx, 4(%esp)
movl $2, 12(%esp)
movl $LC23, 8(%esp)
movl %ebx, (%esp)
call _Perl_hv_common_key_len
LVL394:
.loc 1 783 0
movl (%eax), %eax
LVL395:
movl 16(%eax), %eax
.loc 1 784 0
movl %ebx, (%esp)
.loc 1 783 0
movl %eax, -64(%ebp)
LVL396:
.loc 1 784 0
movl %eax, 4(%esp)
call _Perl_av_len
LVL397:
movl %eax, -60(%ebp)
LVL398:
.loc 1 786 0
addl $1, %eax
LVL399:
cmpl %eax, %esi
movl %eax, -88(%ebp)
jne L334
.loc 1 790 0
movl -60(%ebp), %ecx
testl %ecx, %ecx
js L198
LBB212:
.loc 1 798 0
call _DebugBreak@0
.loc 1 799 0
movl -88(%ebp), %eax
.loc 1 802 0
leal 8(,%edi,4), %edi
.loc 1 799 0
sall $4, %eax
movl %eax, (%esp)
call __alloca
.loc 1 802 0
movl -88(%ebp), %edx
.loc 1 799 0
movl %eax, -48(%ebp)
LVL400:
.loc 1 802 0
leal 0(,%edx,4), %eax
LVL401:
movl %eax, (%esp)
call __alloca
movl -48(%ebp), %esi

Daniel Dragan via RT

unread,
Oct 17, 2012, 4:16:22 PM10/17/12
to libw...@perl.org
Wed Oct 17 16:16:19 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


The culprit from cygwin.asm
_______________________________________________________
#ifdef L_chkstk

/* Function prologue calls _alloca to probe the stack when allocating more
than CHECK_STACK_LIMIT bytes in one go. Touching the stack at 4K
increments is necessary to ensure that the guard pages used
by the OS virtual memory manger are allocated in correct sequence. */

.global ___chkstk
.global __alloca
#ifndef _WIN64
___chkstk:
__alloca:
pushl %ecx /* save temp */
leal 8(%esp), %ecx /* point past return addr */
cmpl $0x1000, %eax /* > 4k ?*/
jb Ldone

Lprobe:
subl $0x1000, %ecx /* yes, move pointer down 4k*/
orl $0x0, (%ecx) /* probe there */
subl $0x1000, %eax /* decrement count */
cmpl $0x1000, %eax
ja Lprobe /* and do it again */

Ldone:
subl %eax, %ecx
orl $0x0, (%ecx) /* less than 4k, just peek here */

movl %esp, %eax /* save old stack pointer */
movl %ecx, %esp /* decrement stack */
movl (%eax), %ecx /* recover saved temp */
movl 4(%eax), %eax /* recover return address */

/* Push the return value back. Doing this instead of just
jumping to %eax preserves the cached call-return stack
used by most modern processors. */
pushl %eax
ret
#else
___________CUT______________________

Daniel Dragan via RT

unread,
Oct 17, 2012, 4:27:51 PM10/17/12
to libw...@perl.org
Wed Oct 17 16:27:50 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Wed Oct 17 16:16:19 2012, BULKDD wrote:
> The culprit from cygwin.asm

The dirty hack fix is

______________________________________________________
/* what is the macro for cygwin platform?*/
#define _alloca(x) (void *)sv_grow(sv_newmortal(), x)
______________________________________________________

The correct fix is talking to whoever maintains cygwin.asm and fixing
the bug in cygwin.asm and waiting for a new cygwin release. I'm not sure
who's or what bug ticket system (linux GCC, binutils, mingw, cygwin,
etc) is responsible for this file. I am done with this ticket until I
hear more input.

Jerry D. Hedden via RT

unread,
Oct 17, 2012, 4:47:25 PM10/17/12
to libw...@perl.org
Wed Oct 17 16:47:25 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On 2012-10-17 16:27:50, BULKDD wrote:
> The correct fix is talking to whoever maintains cygwin.asm and fixing
> the bug in cygwin.asm and waiting for a new cygwin release.

Well, not really. You'll need to support older Cygwin versions. (I'm
still on Cygwin 1.5 at home, for example). Therefore, the hack needs to
be "permanent", or conditionally compiled based on Cygwin
version/release.

Daniel Dragan via RT

unread,
Oct 17, 2012, 7:06:52 PM10/17/12
to libw...@perl.org
Wed Oct 17 19:06:51 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Wed Oct 17 16:47:25 2012, JDHEDDEN wrote:
> On 2012-10-17 16:27:50, BULKDD wrote:
> > The correct fix is talking to whoever maintains cygwin.asm and fixing
> > the bug in cygwin.asm and waiting for a new cygwin release.
>
> Well, not really. You'll need to support older Cygwin versions. (I'm
> still on Cygwin 1.5 at home, for example). Therefore, the hack needs to
> be "permanent", or conditionally compiled based on Cygwin
> version/release.

2 major problems were causing the test failures.

1 was alloca bug, fixed with a

#ifdef __CYGWIN__
# define _alloca(size) __builtin_alloca(size)
#endif

2nd was verbose logging mode caused printf args/string litteral pointers
to wind up as args to the C funcs in the test DLL, (#define
WIN32_API_DEBUG). IsBadReadPtr by the test dll caused some things to be
failures rather than segvs.

Now I have to mop up "J" is not a pointer bugs in the test scripts.

I will update this ticket when I have a working 32 bit with 64 bit IVs
Cygwin Perl Win32::API for you to try.

Tony Cook

unread,
Oct 17, 2012, 7:11:44 PM10/17/12
to Daniel Dragan via RT, libw...@perl.org
On Wed, Oct 17, 2012 at 01:55:57PM -0400, Daniel Dragan via RT wrote:
> I used a assembly debugger (it
> was faster for me, too much time to modify makefile.pl to include gdb
> symbols),

You don't need to modify Makefile.PL add debugging symbols, simply
start Makefile.PL with:

perl Makefile.PL OPTIMIZE=-g

or if you want to keep the optimization options:

perl Makefile.PL OPTIMIZE=-O3\ -g

Tony

Reini Urban

unread,
Oct 17, 2012, 7:12:34 PM10/17/12
to bug-Wi...@rt.cpan.org, libw...@perl.org
Yes, much better
With the better alloca and DEBUG disabled I got

t/00_API.t (Wstat: 256 Tests: 48 Failed: 1)
Failed test: 46
Non-zero exit status: 1
t/01_Struct.t (Wstat: 0 Tests: 7 Failed: 0)
Parse errors: Bad plan. You planned 18 tests but ran 7.
t/03_undef.t (Wstat: 256 Tests: 3 Failed: 1)
Failed test: 2
Non-zero exit status: 1
t/v69.t (Wstat: 65280 Tests: 29 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 36 tests but ran 29.
t/v71.t (Wstat: 65280 Tests: 5 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 23 tests but ran 5.
Files=13, Tests=159, 9 wallclock secs ( 0.03 usr 0.11 sys + 3.70
cusr 5.51 csys = 9.35 CPU)
Result: FAIL
Failed 5/13 test programs. 2/159 subtests failed.

Reini Urban via RT

unread,
Oct 17, 2012, 7:12:46 PM10/17/12
to libw...@perl.org
Wed Oct 17 19:12:45 2012: Request 80217 was acted upon.
Transaction: Correspondence added by rur...@x-ray.at
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows

tony@develop-help.com via RT

unread,
Oct 17, 2012, 7:12:04 PM10/17/12
to libw...@perl.org
Wed Oct 17 19:12:03 2012: Request 80217 was acted upon.
Transaction: Correspondence added by to...@develop-help.com
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


Daniel Dragan via RT

unread,
Oct 19, 2012, 1:42:22 AM10/19/12
to libw...@perl.org, rur...@x-ray.at
<URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >

On Wed Oct 17 19:06:51 2012, BULKDD wrote:
> I will update this ticket when I have a working 32 bit with 64 bit IVs
> Cygwin Perl Win32::API for you to try.

New version posted at https://github.com/bulk88/perl5-win32-api . It
passed all tests for my 32 bit with Quads Cygwin Perl. Please try it and
report back.


Daniel Dragan via RT

unread,
Oct 19, 2012, 1:42:22 AM10/19/12
to libw...@perl.org
Fri Oct 19 01:42:21 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >

Jerry D. Hedden via RT

unread,
Oct 19, 2012, 7:39:21 AM10/19/12
to libw...@perl.org
Fri Oct 19 07:39:19 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Fri, Oct 19, 2012 at 1:42 AM, Daniel Dragan via RT
<bug-Wi...@rt.cpan.org> wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >
>
> New version posted at https://github.com/bulk88/perl5-win32-api . It
> passed all tests for my 32 bit with Quads Cygwin Perl. Please try it and
> report back.

Lots of failure on Cygwin 1.5 due to:

cygpath: unknown option -- V
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
cygpath [-c HANDLE]
cygpath [-ADHPSW]
Convert Unix and Windows format paths, or output system path information

Output type options:
-d, --dos print DOS (short) form of NAMEs (C:\PROGRA~1\)
-m, --mixed like --windows, but with regular slashes (C:/WINNT)
-M, --mode report on mode of file (binmode or textmode)
-u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
-w, --windows print Windows form of NAMEs (C:\WINNT)
-t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
Path conversion options:
-a, --absolute output absolute path
-l, --long-name print Windows long form of NAMEs (with -w, -m only)
-p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
-s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
System information:
-A, --allusers use `All Users' instead of current user for -D, -P
-D, --desktop output `Desktop' directory and exit
-H, --homeroot output `Profiles' directory (home root) and exit
-P, --smprograms output Start Menu `Programs' directory and exit
-S, --sysdir output system directory and exit
-W, --windir output `Windows' directory and exit
Try `cygpath --help' for more information.

I'll test under Cygwin 1.7 later this morning.

Jerry D. Hedden via RT

unread,
Oct 19, 2012, 8:47:41 AM10/19/12
to libw...@perl.org
Fri Oct 19 08:47:40 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: Nobody
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Fri, Oct 19, 2012 at 1:42 AM, Daniel Dragan via RT
<bug-Wi...@rt.cpan.org> wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >
> New version posted at https://github.com/bulk88/perl5-win32-api . It
> passed all tests for my 32 bit with Quads Cygwin Perl. Please try it and
> report back.

With Cygwin 1.7 and Perl 5.16.1, there is the following test failure:

> perl -Mblib Callback/t/03_Jim_Shaw.t
1..6
ok 1 - use Win32::API;
ok 2 - use Win32::API::Callback;
ok 3 - use Win32::API::Test;
ok 4 - loaded
get_window_pids: Desktop hwnd: 65556
Invalid type '-' in unpack at
/c/_/Xfer/bulk88-perl5-win32-api-patched/blib/lib/Win32/API/Callback.pm
line 188.
# Looks like you planned 6 tests but ran 4.
# Looks like your test exited with 255 just after 4.

Uncommenting the Data::Dumper command on line 189 of Callback.pm products:

> perl -Mblib Callback/t/03_Jim_Shaw.t
1..6
ok 1 - use Win32::API;
ok 2 - use Win32::API::Callback;
ok 3 - use Win32::API::Test;
ok 4 - loaded
get_window_pids: Desktop hwnd: 65556
$VAR1 = [
'ܨ"',
'è¤B~',
'V',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'X',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'–',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'¨',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'X%',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'5',
''
];
$VAR1 = [
'ܨ"',
'è¤B~',
'8d',
''
];
Invalid type '-' in unpack at
/c/_/Xfer/bulk88-perl5-win32-api-patched/blib/lib/Win32/API/Callback.pm
line 188.
# Looks like you planned 6 tests but ran 4.
# Looks like your test exited with 255 just after 4.

I see a '-' in the third $vAR1, but it's beyond me what the issue is.

Daniel Dragan via RT

unread,
Oct 19, 2012, 6:02:16 PM10/19/12
to libw...@perl.org, rur...@x-ray.at
<URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >
The $VAR1s look fine. The first 2 slices are always the same. The 3rd is
a HWND and the only one that should change call to call, and the 4th is
always NULL. Try my latest version at
https://github.com/bulk88/perl5-win32-api and report back. I added extra
debugging to code to ::Callback's 32 bit RunCB. Also
Callback/t/03_Jim_Shaw.t is capable of dumping all the data it
collected, change this line to
https://metacpan.org/source/COSIMO/Win32-API-0.72/Callback/t/03_Jim_Shaw.t#L74
"my $print = 1;" but its output may produce a log with confidential
information that you might not want to be public.

Daniel Dragan via RT

unread,
Oct 19, 2012, 6:02:16 PM10/19/12
to libw...@perl.org
Fri Oct 19 18:02:15 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: BULKDD
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >

Jerry D. Hedden via RT

unread,
Oct 19, 2012, 6:40:51 PM10/19/12
to libw...@perl.org
Fri Oct 19 18:40:50 2012: Request 80217 was acted upon.
Transaction: Correspondence added by JDHEDDEN
Queue: Win32-API
Subject: Re: [rt.cpan.org #80217] Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: BULKDD
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


All tests passed on Cygwin 1.5 with Perl 5.16.1.

On Fri, Oct 19, 2012 at 6:02 PM, Daniel Dragan via RT

Daniel Dragan via RT

unread,
Oct 20, 2012, 8:18:21 PM10/20/12
to libw...@perl.org
Sat Oct 20 20:18:20 2012: Request 80217 was acted upon.
Transaction: Correspondence added by BULKDD
Queue: Win32-API
Subject: Build failure under Cygwin on Windows
Broken in: 0.72
Severity: Critical
Owner: BULKDD
Requestors: jdhe...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80217 >


On Fri Oct 19 18:40:50 2012, JDHEDDEN wrote:
> All tests passed on Cygwin 1.5 with Perl 5.16.1.
>

The Cygwin fixes are now available in Win32::API 0.73 on CPAN.

Daniel Dragan via RT

unread,
Oct 20, 2012, 8:18:21 PM10/20/12
to libw...@perl.org, rur...@x-ray.at
0 new messages