You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Fuhrmann <eq...@web.de> on 2011/03/03 09:55:03 UTC

Re: crash during svn blame on windows 64-bit version

On 24.02.2011 08:53, Marc Haesen wrote:
> I saw a crash when running svn blame with a svn.exe compiled for win64
> on trunk.
>
> After some investigation I found the reason for the crash.
>
>
> The reason is because apr.h is using the define WIN64 for defining the
> APR_SIZEOF_VOIDP define.
>
> (I am using the apr.h/apr.hw delivered with httpd-2.2.17)
Thanks for digging into that issue!
> WIN64 is currently not defined when compiling for 64-bit on windows.
Luckily, TSVN is not affected by this bug as it
uses its own build script including the WIN64
define.

However, SVN cl clients and possibly *servers*
are affected.
> This caused the wrong code to be generated for the contains_eol function
> in subversion\libsvn_diff\diff_file.c (revision 1074059)
>
> Two solutions:
>
> 1.	Replace #ifdef WIN64 by #ifdef _WIN64 in apr.h (or apr.hw since
> this is actually the source)
Submit the patch to the APR guys (if you haven't
done so already).
> 2.	Add the WIN64 to the compile options when compiling for 64-bit
> windows
3.    Make the SVN code work with either definition
of APR_SIZEOF_VOIDP.

I took that road in r1076556 on /trunk to make sure
that SVN will not be broken regardless of the APR
version being used.

-- Stefan^2.

RE: crash during svn blame on windows 64-bit version

Posted by Marc Haesen <Ma...@oneaccess-net.com>.

Ok, I overlooked the fact that APR_SIZEOF_VOIDP is the same as
sizeof(apr_uintptr_t) independent on the correct setting of WIN64 in
apr.h

Regards,
Marc


-----Original Message-----
From: eqfox@web.de [mailto:eqfox@web.de] 
Sent: zaterdag 5 maart 2011 0:13
To: Marc Haesen
Cc: dev@subversion.apache.org
Subject: Re: crash during svn blame on windows 64-bit version

On 04.03.2011 14:15, Marc Haesen wrote:
> When doing the change of r1076556, should the define LOWER_7BITS_SET
not
> always be mapped to 0x7f7f7f7f independent of the APR_SIZEOF_VOIDP
> setting?
>
> //#if SVN_UNALIGNED_ACCESS_IS_OK
> //#if APR_SIZEOF_VOIDP == 8
> //#  define LOWER_7BITS_SET 0x7f7f7f7f7f7f7f7f
> //#  define BIT_7_SET       0x8080808080808080
> //#  define R_MASK          0x0a0a0a0a0a0a0a0a
> //#  define N_MASK          0x0d0d0d0d0d0d0d0d
> //#else
> #  define LOWER_7BITS_SET 0x7f7f7f7f
> #  define BIT_7_SET       0x80808080
> #  define R_MASK          0x0a0a0a0a
> #  define N_MASK          0x0d0d0d0d
> //#endif
> //#endif
>
> Marc
No. The basic idea is to chew bigger chunks of data
on 64 bit machines than on 32 bit ones.

r1076556 only leaves that decision to APR, i.e. the
we use a word width consistent with the value of
APR_SIZEOF_VOIDP defined by APR.

-- Stefan^2.
>
> -----Original Message-----
> From: eqfox@web.de [mailto:eqfox@web.de]
> Sent: donderdag 3 maart 2011 9:55
> To: Marc Haesen
> Cc: dev@subversion.apache.org
> Subject: Re: crash during svn blame on windows 64-bit version
>
> On 24.02.2011 08:53, Marc Haesen wrote:
>> I saw a crash when running svn blame with a svn.exe compiled for
win64
>> on trunk.
>>
>> After some investigation I found the reason for the crash.
>>
>>
>> The reason is because apr.h is using the define WIN64 for defining
the
>> APR_SIZEOF_VOIDP define.
>>
>> (I am using the apr.h/apr.hw delivered with httpd-2.2.17)
> Thanks for digging into that issue!
>> WIN64 is currently not defined when compiling for 64-bit on windows.
> Luckily, TSVN is not affected by this bug as it
> uses its own build script including the WIN64
> define.
>
> However, SVN cl clients and possibly *servers*
> are affected.
>> This caused the wrong code to be generated for the contains_eol
> function
>> in subversion\libsvn_diff\diff_file.c (revision 1074059)
>>
>> Two solutions:
>>
>> 1.	Replace #ifdef WIN64 by #ifdef _WIN64 in apr.h (or apr.hw since
>> this is actually the source)
> Submit the patch to the APR guys (if you haven't
> done so already).
>> 2.	Add the WIN64 to the compile options when compiling for 64-bit
>> windows
> 3.    Make the SVN code work with either definition
> of APR_SIZEOF_VOIDP.
>
> I took that road in r1076556 on /trunk to make sure
> that SVN will not be broken regardless of the APR
> version being used.
>
> -- Stefan^2.
>


Re: crash during svn blame on windows 64-bit version

Posted by Stefan Fuhrmann <eq...@web.de>.
On 04.03.2011 14:15, Marc Haesen wrote:
> When doing the change of r1076556, should the define LOWER_7BITS_SET not
> always be mapped to 0x7f7f7f7f independent of the APR_SIZEOF_VOIDP
> setting?
>
> //#if SVN_UNALIGNED_ACCESS_IS_OK
> //#if APR_SIZEOF_VOIDP == 8
> //#  define LOWER_7BITS_SET 0x7f7f7f7f7f7f7f7f
> //#  define BIT_7_SET       0x8080808080808080
> //#  define R_MASK          0x0a0a0a0a0a0a0a0a
> //#  define N_MASK          0x0d0d0d0d0d0d0d0d
> //#else
> #  define LOWER_7BITS_SET 0x7f7f7f7f
> #  define BIT_7_SET       0x80808080
> #  define R_MASK          0x0a0a0a0a
> #  define N_MASK          0x0d0d0d0d
> //#endif
> //#endif
>
> Marc
No. The basic idea is to chew bigger chunks of data
on 64 bit machines than on 32 bit ones.

r1076556 only leaves that decision to APR, i.e. the
we use a word width consistent with the value of
APR_SIZEOF_VOIDP defined by APR.

-- Stefan^2.
>
> -----Original Message-----
> From: eqfox@web.de [mailto:eqfox@web.de]
> Sent: donderdag 3 maart 2011 9:55
> To: Marc Haesen
> Cc: dev@subversion.apache.org
> Subject: Re: crash during svn blame on windows 64-bit version
>
> On 24.02.2011 08:53, Marc Haesen wrote:
>> I saw a crash when running svn blame with a svn.exe compiled for win64
>> on trunk.
>>
>> After some investigation I found the reason for the crash.
>>
>>
>> The reason is because apr.h is using the define WIN64 for defining the
>> APR_SIZEOF_VOIDP define.
>>
>> (I am using the apr.h/apr.hw delivered with httpd-2.2.17)
> Thanks for digging into that issue!
>> WIN64 is currently not defined when compiling for 64-bit on windows.
> Luckily, TSVN is not affected by this bug as it
> uses its own build script including the WIN64
> define.
>
> However, SVN cl clients and possibly *servers*
> are affected.
>> This caused the wrong code to be generated for the contains_eol
> function
>> in subversion\libsvn_diff\diff_file.c (revision 1074059)
>>
>> Two solutions:
>>
>> 1.	Replace #ifdef WIN64 by #ifdef _WIN64 in apr.h (or apr.hw since
>> this is actually the source)
> Submit the patch to the APR guys (if you haven't
> done so already).
>> 2.	Add the WIN64 to the compile options when compiling for 64-bit
>> windows
> 3.    Make the SVN code work with either definition
> of APR_SIZEOF_VOIDP.
>
> I took that road in r1076556 on /trunk to make sure
> that SVN will not be broken regardless of the APR
> version being used.
>
> -- Stefan^2.
>


RE: crash during svn blame on windows 64-bit version

Posted by Marc Haesen <Ma...@oneaccess-net.com>.
When doing the change of r1076556, should the define LOWER_7BITS_SET not
always be mapped to 0x7f7f7f7f independent of the APR_SIZEOF_VOIDP
setting?

//#if SVN_UNALIGNED_ACCESS_IS_OK
//#if APR_SIZEOF_VOIDP == 8
//#  define LOWER_7BITS_SET 0x7f7f7f7f7f7f7f7f
//#  define BIT_7_SET       0x8080808080808080
//#  define R_MASK          0x0a0a0a0a0a0a0a0a
//#  define N_MASK          0x0d0d0d0d0d0d0d0d
//#else
#  define LOWER_7BITS_SET 0x7f7f7f7f
#  define BIT_7_SET       0x80808080
#  define R_MASK          0x0a0a0a0a
#  define N_MASK          0x0d0d0d0d
//#endif
//#endif

Marc


-----Original Message-----
From: eqfox@web.de [mailto:eqfox@web.de] 
Sent: donderdag 3 maart 2011 9:55
To: Marc Haesen
Cc: dev@subversion.apache.org
Subject: Re: crash during svn blame on windows 64-bit version

On 24.02.2011 08:53, Marc Haesen wrote:
> I saw a crash when running svn blame with a svn.exe compiled for win64
> on trunk.
>
> After some investigation I found the reason for the crash.
>
>
> The reason is because apr.h is using the define WIN64 for defining the
> APR_SIZEOF_VOIDP define.
>
> (I am using the apr.h/apr.hw delivered with httpd-2.2.17)
Thanks for digging into that issue!
> WIN64 is currently not defined when compiling for 64-bit on windows.
Luckily, TSVN is not affected by this bug as it
uses its own build script including the WIN64
define.

However, SVN cl clients and possibly *servers*
are affected.
> This caused the wrong code to be generated for the contains_eol
function
> in subversion\libsvn_diff\diff_file.c (revision 1074059)
>
> Two solutions:
>
> 1.	Replace #ifdef WIN64 by #ifdef _WIN64 in apr.h (or apr.hw since
> this is actually the source)
Submit the patch to the APR guys (if you haven't
done so already).
> 2.	Add the WIN64 to the compile options when compiling for 64-bit
> windows
3.    Make the SVN code work with either definition
of APR_SIZEOF_VOIDP.

I took that road in r1076556 on /trunk to make sure
that SVN will not be broken regardless of the APR
version being used.

-- Stefan^2.