@perlbugfollowup: "<quote>
I forgot to consider GCC. Strawberry 5.16's GCC headers have
#pragma pack(push,_CRT_PACKING)
# 58 "c:\\sp3216\\c\\bin\\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/sys/stat.h" 3
# 1 "c:\\sp3216\\c\\bin\\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/_mingw_stat64.h" 1 3
# 19 "c:\\sp3216\\c\\bin\\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/_mingw_stat64.h" 3
  struct _stat {
    _dev_t st_dev;
   _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    _off_t st_size;
    __time32_t st_atime;
    __time32_t st_mtime;
    __time32_t st_ctime;
  };
  struct stat {
    _dev_t st_dev;
    _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    _off_t st_size;
    time_t st_atime;
    time_t st_mtime;
    time_t st_ctime;
  };
  struct _stati64 {
    _dev_t st_dev;
    _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    __extension__ long long st_size;
    __time32_t st_atime;
    __time32_t st_mtime;
    __time32_t st_ctime;
  };
  struct _stat64i32 {
    _dev_t st_dev;
    _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    _off_t st_size;
    __time64_t st_atime;
    __time64_t st_mtime;
    __time64_t st_ctime;
  };
  struct _stat64 {
    _dev_t st_dev;
    _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    __extension__ long long st_size;
    __time64_t st_atime;
    __time64_t st_mtime;
    __time64_t st_ctime;
  };
# 59 "c:\\sp3216\\c\\bin\\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/sys/stat.h" 2 3
-
interp struct section from SP.
-
# 82 "C:\\sp3216\\perl\\lib\\CORE/intrpvar.h"
STRLEN Ina;
struct _stati64 Istatbuf;
struct _stati64 Istatcache;
GV * Istatgv;
SV * Istatname;
struct tms Itimesbuf;
PMOP * Icurpm;
# 114 "C:\\sp3216\\perl\\lib\\CORE/intrpvar.h"
So GCC/Mingw thinks its a <= 2003, and its (strawberry's) Config.pm does NOT have _USE_32BIT_TIME_T. That isn't a mixed compiler build tho, nobody uses VC to compile XS with a Strawberry Perl (I've tried, lots of Config hacking, I gave up due to time). But there is a combo of VC Perl with GCC XS (btw, you are the maintainer of AP's dmake, see my ticket, <url> ).  ActivePerl <= 5.16 with the Mingw PPM packages is a common setup for some people. AP uses a AP-only module called ActivePerl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4onfig (.pm) to change Config's values to work with GCC. It is _USE_32BIT_TIME_T unaware (maybe because ActiveState never used > VC6, and instead switched to Mingw for 5.18). IDK how self compiled VC Perl works with GCC XS and IDK if there will be a _USE_32BIT_TIME_T defined for doshish.h in that case.
So then a special case in doshish.h for Mingw is needed, but IDK exactly how to do it. Either test for Mingw or test for _USE_32BIT_TIME_T.
Remember, this fix will obviously fix blead, but what stable's will it be in? any maint releases? what stables will it be retrofitted to? what are your requirements for supporting a fix? fix it in ppport.h? idk...
bulk88 ~ ashley61@example.com
-
via perlbug:  queue: perl5 status: new
<url>"
    @perlbugfollowup: "Another fix idea is to just move PL_statcache and PL_statbuf to the end of the interp struct.
bulk88 ~ ashley61@example.com
-
via perlbug:  queue: perl5 status: new
<url>"
    @perlbugfollowup: "Fixing Stat_t partially helped, compiling XS with VC 2003 with a VC 2005 Perl, before my fix, PL_LIO was at 0x8CC , after, 0x8DC, but its still not at 0x8E4 (correct offset) in VS 2005/2008. There is something else, not visible with diffing the interp struts after CPP, that is different.
dosish.h patch
#if defined(WIN64) || defined(USE_LARGE_FILES)
/* Perl was built with >= VC 2005, but XS is compiling < VC 2005
   so use 64 bit time struct from < VC 2005 for ABI compatiblity */
#  if defined(_MSC_VER) && _MSC_VER < 1400 && !defined(_USE_32BIT_TIME_T)
#    if _MSC_VER >= 1300
#      define Stat_t struct __stat64
#    else
#      error Your Visual C 6 or older compiler does not define struct __stat64
#    endif
#  else
#    define Stat_t struct _stati64
#  endif
#else
#if defined(UNDER_CE)
#define Stat_t struct xcestat
#else
#  if defined(_MSC_VER) && _MSC_VER < 1400 && !defined(_USE_32BIT_TIME_T)
#    error Your Visual C 2003 or older compiler does not define struct _stat64i32
#  else
#    define Stat_t struct stat
#  endif
#endif
#endif
void
one()
    PROTOTYPE:
    PPCODE:
    {
        dMY_CXT;
        printf("# pOpen() is %p Stat_t is %u MSC is %u intp is %u\n",
my_perl->ILIO->pOpen, sizeof(Stat_t), _MSC_VER, sizeof(struct interpreter));
        if (my_perl->ILIO->pOpen)
            XSRETURN_YES;
        else
            XSRETURN_EMPTY;
    }
-
VC 2003 before patch, 00003039 is "12345", a fake number so no segv
-
C:\sources\Foo-1.00>perl -MFoo -E"Foo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4one"
# pOpen() is 00003039 Stat_t is 48 MSC is 1310 intp is 2632
C:\sources\Foo-1.00>
-
VC 2003 after patch
-
C:\sources\Foo-1.00>perl -MFoo -E"Foo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4one"
# pOpen() is 280BEDE6 Stat_t is 56 MSC is 1310 intp is 2648
C:\sources\Foo-1.00>
-
VC 2005 (always correct, since this is VC 2005 Perl)
-
C:\sources\Foo-1.00>perl -MFoo -E"Foo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4one"
# pOpen() is 280BF171 Stat_t is 56 MSC is 1400 intp is 2656
C:\sources\Foo-1.00>
-
bulk88 ~ ashley61@example.com
-
via perlbug:  queue: perl5 status: new
<url>"
    @perlbugfollowup: "<quote>
- C:\sources\Foo-1.00\vc8.txt 
+++ C:\sources\Foo-1.00\vc7.txt 
@@ -110,191 +110,191 @@
 minus_Eis 643
 inplaceis 644
 e_scriptis 648
-basetimeis 656
-maxsysfdis 664
-statusvalueis 668
-statusvalue_posixis 672
-sig_pendingis 676
-psig_pendis 680
-stdingvis 684
-stderrgvis 688
-argvgvis 692
-argvoutgvis 696
-argvout_stackis 700
-replgvis 704
-errgvis 708
-DBgvis 712
-DBlineis 716
-DBsubis 720
-DBsingleis 724
-DBtraceis 728
-DBsignalis 732
-dbargsis 736
-debstashis 740
-globalstashis 744
-curstnameis 748
-beginavis 752
-endavis 756
-unitcheckavis 760
-checkavis 764
-initavis 768
-fdpidis 772
-op_maskis 776
-main_cvis 780
-main_rootis 784
-main_startis 788
-eval_rootis 792
-eval_startis 796
-curcopdbis 800
-filemodeis 804
-lastfdis 808
-oldnameis 812
-Argvis 816
-Cmdis 820
-preambleavis 824
-mess_svis 828
-ors_svis 832
-forkprocessis 836
-gensymis 840
-cv_has_evalis 844
-taint_warnis 845
-laststypeis 846
-laststatvalis 848
-modcountis 852
-exitlistlenis 856
-exitlistis 860
-modglobalis 864
-profiledatais 868
-compilingis 872
-compcvis 920
-comppad_nameis 924
-comppad_name_fillis 928
-comppad_name_flooris 932
-sys_internis 936
-DBcvis 1788
-generationis 1792
-unicodeis 1796
-in_clean_objsis 1800
-in_clean_allis 1801
-nomemokis 1802
-savebeginis 1803
-delaymagic_uidis 1804
-delaymagic_euidis 1808
-delaymagic_gidis 1812
-delaymagic_egidis 1816
-anis 1820
-breakable_sub_genis 1824
-cop_seqmaxis 1828
-evalseqis 1832
-origalenis 1836
-origenvironis 1840
-osnameis 1844
-sighandlerpis 1848
-body_rootsis 1852
-debugis 1916
-maxois 1920
-runopsis 1924
-subnameis 1928
-sublineis 1932
-min_intro_pendingis 1936
-max_intro_pendingis 1940
-padixis 1944
-padix_flooris 1948
-collation_nameis 1952
-collxfrm_baseis 1956
-collxfrm_multis 1960
-collation_ixis 1964
-collation_standardis 1968
-unsafeis 1969
-colorsetis 1970
-phaseis 1972
-in_load_moduleis 1976
-perl_destruct_levelis 1977
-numeric_standardis 1978
-numeric_localis 1979
-numeric_nameis 1980
-numeric_radix_svis 1984
-Latin1is 1988
-UpperLatin1is 1992
-AboveLatin1is 1996
-NonL1NonFinalFoldis 2000
-HasMultiCharFoldis 2004
-utf8_markis 2008
-utf8_X_regular_beginis 2012
-utf8_X_extendis 2016
-utf8_toupperis 2020
-utf8_totitleis 2024
-utf8_toloweris 2028
-utf8_tofoldis 2032
-utf8_charname_beginis 2036
-utf8_charname_continueis 2040
-utf8_swash_ptrsis 2044
-Posix_ptrsis 2084
-XPosix_ptrsis 2152
-last_swash_hvis 2220
-last_swash_tmpsis 2224
-last_swash_slenis 2228
-last_swash_keyis 2232
-last_swash_klenis 2244
-pad_reset_pendingis 2245
-srand_calledis 2246
-psig_ptris 2248
-psig_nameis 2252
-Memis 2256
-MemSharedis 2260
-MemParseis 2264
-Envis 2268
-StdIOis 2272
-LIOis 2276
-Diris 2280
-Sockis 2284
-Procis 2288
-ptr_tableis 2292
-beginav_saveis 2296
-body_arenasis 2300
-regex_padis 2304
-regex_padavis 2308
-stashpadis 2312
-stashpadmaxis 2316
-stashpadixis 2320
-custom_op_namesis 2324
-custom_op_descsis 2328
-perliois 2332
-known_layersis 2336
-def_layerlistis 2340
-encodingis 2344
-utf8_idstartis 2348
-utf8_idcontis 2352
-utf8_xidstartis 2356
-utf8_perl_idstartis 2360
-utf8_perl_idcontis 2364
-utf8_xidcontis 2368
-sort_RealCmpis 2372
-checkav_saveis 2376
-unitcheckav_saveis 2380
-clocktickis 2384
-sharehookis 2388
-lockhookis 2392
-unlockhookis 2396
-threadhookis 2400
-destroyhookis 2404
-signalhookis 2408
-isarevis 2412
-registered_mrosis 2416
-blockhooksis 2420
-utf8_foldclosuresis 2424
-utf8_foldableis 2428
-custom_opsis 2432
-Xpvis 2436
-scopestack_nameis 2440
-debug_padis 2444
-globhookis 2492
-my_cxt_listis 2496
-my_cxt_sizeis 2500
-sv_constsis 2504
-random_stateis 2648
+basetimeis 652
+maxsysfdis 656
+statusvalueis 660
+statusvalue_posixis 664
+sig_pendingis 668
+psig_pendis 672
+stdingvis 676
+stderrgvis 680
+argvgvis 684
+argvoutgvis 688
+argvout_stackis 692
+replgvis 696
+errgvis 700
+DBgvis 704
+DBlineis 708
+DBsubis 712
+DBsingleis 716
+DBtraceis 720
+DBsignalis 724
+dbargsis 728
+debstashis 732
+globalstashis 736
+curstnameis 740
+beginavis 744
+endavis 748
+unitcheckavis 752
+checkavis 756
+initavis 760
+fdpidis 764
+op_maskis 768
+main_cvis 772
+main_rootis 776
+main_startis 780
+eval_rootis 784
+eval_startis 788
+curcopdbis 792
+filemodeis 796
+lastfdis 800
+oldnameis 804
+Argvis 808
+Cmdis 812
+preambleavis 816
+mess_svis 820
+ors_svis 824
+forkprocessis 828
+gensymis 832
+cv_has_evalis 836
+taint_warnis 837
+laststypeis 838
+laststatvalis 840
+modcountis 844
+exitlistlenis 848
+exitlistis 852
+modglobalis 856
+profiledatais 860
+compilingis 864
+compcvis 912
+comppad_nameis 916
+comppad_name_fillis 920
+comppad_name_flooris 924
+sys_internis 928
+DBcvis 1780
+generationis 1784
+unicodeis 1788
+in_clean_objsis 1792
+in_clean_allis 1793
+nomemokis 1794
+savebeginis 1795
+delaymagic_uidis 1796
+delaymagic_euidis 1800
+delaymagic_gidis 1804
+delaymagic_egidis 1808
+anis 1812
+breakable_sub_genis 1816
+cop_seqmaxis 1820
+evalseqis 1824
+origalenis 1828
+origenvironis 1832
+osnameis 1836
+sighandlerpis 1840
+body_rootsis 1844
+debugis 1908
+maxois 1912
+runopsis 1916
+subnameis 1920
+sublineis 1924
+min_intro_pendingis 1928
+max_intro_pendingis 1932
+padixis 1936
+padix_flooris 1940
+collation_nameis 1944
+collxfrm_baseis 1948
+collxfrm_multis 1952
+collation_ixis 1956
+collation_standardis 1960
+unsafeis 1961
+colorsetis 1962
+phaseis 1964
+in_load_moduleis 1968
+perl_destruct_levelis 1969
+numeric_standardis 1970
+numeric_localis 1971
+numeric_nameis 1972
+numeric_radix_svis 1976
+Latin1is 1980
+UpperLatin1is 1984
+AboveLatin1is 1988
+NonL1NonFinalFoldis 1992
+HasMultiCharFoldis 1996
+utf8_markis 2000
+utf8_X_regular_beginis 2004
+utf8_X_extendis 2008
+utf8_toupperis 2012
+utf8_totitleis 2016
+utf8_toloweris 2020
+utf8_tofoldis 2024
+utf8_charname_beginis 2028
+utf8_charname_continueis 2032
+utf8_swash_ptrsis 2036
+Posix_ptrsis 2076
+XPosix_ptrsis 2144
+last_swash_hvis 2212
+last_swash_tmpsis 2216
+last_swash_slenis 2220
+last_swash_keyis 2224
+last_swash_klenis 2236
+pad_reset_pendingis 2237
+srand_calledis 2238
+psig_ptris 2240
+psig_nameis 2244
+Memis 2248
+MemSharedis 2252
+MemParseis 2256
+Envis 2260
+StdIOis 2264
+LIOis 2268
+Diris 2272
+Sockis 2276
+Procis 2280
+ptr_tableis 2284
+beginav_saveis 2288
+body_arenasis 2292
+regex_padis 2296
+regex_padavis 2300
+stashpadis 2304
+stashpadmaxis 2308
+stashpadixis 2312
+custom_op_namesis 2316
+custom_op_descsis 2320
+perliois 2324
+known_layersis 2328
+def_layerlistis 2332
+encodingis 2336
+utf8_idstartis 2340
+utf8_idcontis 2344
+utf8_xidstartis 2348
+utf8_perl_idstartis 2352
+utf8_perl_idcontis 2356
+utf8_xidcontis 2360
+sort_RealCmpis 2364
+checkav_saveis 2368
+unitcheckav_saveis 2372
+clocktickis 2376
+sharehookis 2380
+lockhookis 2384
+unlockhookis 2388
+threadhookis 2392
+destroyhookis 2396
+signalhookis 2400
+isarevis 2404
+registered_mrosis 2408
+blockhooksis 2412
+utf8_foldclosuresis 2416
+utf8_foldableis 2420
+custom_opsis 2424
+Xpvis 2428
+scopestack_nameis 2432
+debug_padis 2436
+globhookis 2484
+my_cxt_listis 2488
+my_cxt_sizeis 2492
+sv_constsis 2496
+random_stateis 2640
 C:\sources\Foo-1.00>perl -MFoo -E"Foo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4one"
-# pOpen() is 00003039 Stat_t is 56 MSC is 1400 intp is 2656
+# pOpen() is 00003039 Stat_t is 56 MSC is 1310 intp is 2648
 C:\sources\Foo-1.00>
\ No newline at end of file
PL_e_script is a SV *. No drama can be there. PL_basetime is a time_t.
typedef __int64 __time64_t;
#line 56 "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\INCLUDE\\sys/types.h"
#line 58 "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\INCLUDE\\sys/types.h"
typedef __time64_t time_t;  
#line 25 "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\INCLUDE\\sys/types.h"
typedef long    time_t;         
#line 33 "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\INCLUDE\\sys/types.h"
typedef __int64 __time64_t;
#line 36 "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\INCLUDE\\sys/types.h"
#line 38 "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\INCLUDE\\sys/types.h"
VC2005
#ifdef  _USE_32BIT_TIME_T
#ifdef  _WIN64
#include <crtwrn.h>
#pragma _CRT_WARNING( _NO_32BIT_TIME_T )
#undef  _USE_32BIT_TIME_T
#endif
#else
#if     _INTEGRAL_MAX_BITS < 64
#define _USE_32BIT_TIME_T
#endif
#endif
#ifndef _TIME32_T_DEFINED
typedef _W64 long __time32_t;   /* 32-bit time value */
#define _TIME32_T_DEFINED
#endif
#ifndef _TIME64_T_DEFINED
#if     _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;     /* 64-bit time value */
#endif
#define _TIME64_T_DEFINED
#endif
#ifndef _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;      /* time value */
#else
typedef __time64_t time_t;      /* time value */
#endif
#define _TIME_T_DEFINED         /* avoid multiple def's of time_t */
#endif
VC 2003
#ifndef _TIME_T_DEFINED
#ifdef  _WIN64
typedef __int64 time_t;         /* time value */
#else
typedef long    time_t;         /* time value */
#endif
#if     _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;
#endif
#define _TIME_T_DEFINED         /* avoid multiple def's of time_t */
#endif
VC 6
#ifndef _TIME_T_DEFINED
typedef long time_t;
#define _TIME_T_DEFINED
#endif
So this is more tricky, Time_t is a Perl type, and its defined in config_H.vc but time_t isn't a Perl type, its a C type. config_H.vc is not XS compile time dynamic like dosish.h/headers. Also, its not in VC 6. How will this be fixed?
bulk88 ~ ashley61@example.com
-
via perlbug:  queue: perl5 status: new
<url>"
{'source': 'USENET', 'other_information': '{"reply_count": 3, "forum_name": "perl.perl5.porters.20150608.mbox"}', 'file': 'data/output/usenet-perl.perl5.parquet'}