develooper Front page | perl.perl5.porters | Postings from January 2008

[perl #50386] GIMME_V broken with 5.10.0/GCC and XS?

Thread Next
From:
Robert May
Date:
January 29, 2008 17:41
Subject:
[perl #50386] GIMME_V broken with 5.10.0/GCC and XS?
Message ID:
rt-3.6.HEAD-4355-1201637953-380.50386-75-0@perl.org
# New Ticket Created by  "Robert May" 
# Please include the string:  [perl #50386]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50386 >


This is a bug report for perl from robertmay@cpan.org,
generated with the help of perlbug 1.36 running under perl 5.10.0.


-----------------------------------------------------------------
I'm building the following XS extension with
gcc 3.4.5 (mingw special) against ActiveState Perl 5.10.0
(builds 1001 and 1002)

GIMME_V appears to always return G_VOID (128), regardless of the
context the XSUB is called in.

The same code and compiler works fine when built against ActiveState
Perl 5.8.8 (build 822).  It is also fine when compiled with VC++ 6
for all 3 perl builds.


#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

MODULE = GimmeVTest		PACKAGE = GimmeVTest

int
context()
    CODE:
    	RETVAL = GIMME_V;
    OUTPUT:
    	RETVAL

Testing with the following code:

my $scalar = GimmeVTest::context();
is($scalar , G_SCALAR, 'in scalar context');
my ($x) = GimmeVTest::context();
is($x , G_ARRAY, 'in list context');
my ($y) = GimmeVTest::context();
is($y , G_ARRAY, 'in list context');
my $z = (GimmeVTest::context())[0];
is($z , G_ARRAY, 'in list context');

results in the following output:

not ok 1 - in scalar context
#   Failed test 'in scalar context'
#   at t\01-gimme_v-test.t line 14.
#          got: '128'
#     expected: '0'

not ok 2 - in list context
#   Failed test 'in list context'
#   at t\01-gimme_v-test.t line 17.
#          got: '128'
#     expected: '1'

not ok 3 - in list context
#   Failed test 'in list context'
#   at t\01-gimme_v-test.t line 20.
#          got: '128'
#     expected: '1'

not ok 4 - in list context
#   Failed test 'in list context'
#   at t\01-gimme_v-test.t line 23.
#          got: '128'
#     expected: '1'
# Looks like you failed 4 tests of 4.

I have reached the end of my knowledge in the internals trying
to track down the problem.

Module distribution for the above code and tests attached to save
you having to type anything.

Regards,
Rob.



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.10.0:

Configured by SYSTEM at Thu Jan 10 11:00:30 2008.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    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_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing',
    optimize='-O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='3.4.5 (mingw special)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-L"C:\Perl\AS1002\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 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32
-lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lmsvcrt
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -L"C:\Perl\AS1002\lib\CORE"'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY
    32809 Load 'loadable object' with non-default file extension
    32728 64-bit fix for Time::Local

---
@INC for perl 5.10.0:
    C:/Perl/AS1002/site/lib
    C:/Perl/AS1002/lib
    .

---
Environment for perl 5.10.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Perl\AS1002\site\bin;C:\Perl\AS1002\bin;C:\pgmfiles\unxutil;C:\MinGW\bin;C:\Windows\system32
    PERL_BADLANG (unset)
    SHELL (unset)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About