Hi Christian,

2016/6/23 Thu 5:26:13 UTC+9 Christian Brabandt wrote:
> I don't exactly understand the if_perl.xs script, but could it be, that
> sizeof(void *) is different for perl and vim? I assume that somehow the perl
> interpreter uses a different size of wp->w_perl_private variable
> (possibly 64bit vs. 32bit of the Vim executable) and this seems to cause
> this issue.
> 
> If I run perl -v I see this:
> ..Projects\vim\src>perl -v
> 
> ,----
> | This is perl 5, version 22, subversion 1 (v5.22.1) built for 
> MSWin32-x86-multi-thread-64int
> | (with 1 registered patch, see perl -V for more detail)
> | 
> | Copyright 1987-2015, Larry Wall
> | 
> | Binary build 2201 [299574] provided by ActiveState 
> http://www.ActiveState.com
> | Built Dec 24 2015 12:36:28
> | 
> | Perl may be copied only under the terms of either the Artistic License or 
> the
> | GNU General Public License, which may be found in the Perl 5 source kit.
> | 
> | Complete documentation for Perl, including FAQ lists, should be found on
> | this system using "man perl" or "perldoc perl".  If you have access to the
> | Internet, point your browser at http://www.perl.org/, the Perl Home Page.
> `----
> 
> I can avoid this crash, by using this patch:
> 
> diff -r 405c0bba9d1d src/window.c
> --- a/src/window.c      Wed Jun 15 22:15:07 2016 +0200
> +++ b/src/window.c      Wed Jun 22 20:09:33 2016 +0200
> @@ -4549,7 +4549,8 @@
>  #endif
> 
>  #ifdef FEAT_PERL
> -    perl_win_free(wp);
> +    if (wp->w_perl_private)
> +        perl_win_free(wp);
>  #endif
> 
> #ifdef FEAT_PYTHON
> 
> But this breaks then later in the test_perl.vim Test with
> From test_perl.vim:
> Found errors in Test_SvREFCNT():
> function RunTheTest[9]..Test_SvREFCNT line 15: Expected False but got 83852072
> TEST FAILURE 
> 
> from 
> https://ci.appveyor.com/project/chrisbra/vim-win32-installer-33v6e/build/45/job/eic9bm4hwr1le2ak#L4723
> 
> But I don't know, how to fix this.
> 
> For reference, this happens on a windows 64 bit system, when building
> the 32bit version of gvim

I confirmed that this happens when both if_perl and if_mzsch are enabled.
https://ci.appveyor.com/project/k-takata/vim-win32-installer/history

I'm not sure why if_mzsch is related, but now I found that v7.4.1925 causes
this problem.  The size of time_t is the root cause.

32-bit versions of ActivePerl and Strawberry Perl require 32-bit time_t.  So
we define _USE_32BIT_TIME_T in if_perl.xs.  However recent versions of VC are
64-bit time_t by default. So the size of time_t is 64 bits in other files.
The patch 1925 adds a time_t member to xfmark_T which is included in window_T,
so the size of window_T becomes different in if_perl.xs and in other files.

I confirmed that the following workaround fixes the problem.
(But there should be much better solution...)

--- a/src/structs.h
+++ b/src/structs.h
@@ -114,6 +114,9 @@ typedef struct xfilemark
     char_u     *fname;         /* file name, used when fnum == 0 */
 #ifdef FEAT_VIMINFO
     time_t     time_set;
+# ifdef _USE_32BIT_TIME_T
+    int                padding;
+# endif
 #endif
 } xfmark_T;
 

Both test58 and test_perl.vim pass with this patch.

Using 32-bit time_t in all part might be the easiest solution, but I don't
want to use the solution.  The size of time_t should be 64 bits (except in
if_perl.xs).


Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui