On 28/02/2007, at 7:14 PM, [EMAIL PROTECTED] wrote:
Author: jerry
Date: 2007-03-01 03:14:20 +0000 (Thu, 01 Mar 2007)
New Revision: 21614
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?
view=rev&root=samba&rev=21614
Log:
The memset() called on aligned memory was causing crashes
on x86_64 Linux boxes. Since it is not needed, just use malloc()
on Linux.
Modified:
branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
2007-03-01 03:12:16 UTC (rev 21613)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
2007-03-01 03:14:20 UTC (rev 21614)
@@ -494,8 +494,19 @@
memcredp->len += strlen(pass)+1;
}
+#if defined(LINUX)
+ /* aligning the memory on on x86_64 and compiling
+ with gcc 4.1 using -O2 causes a segv in the
+ next memset() --jerry */
+ memcredp->nt_hash = SMB_MALLOC_ARRAY(unsigned char, memcredp->len);
+#else
/* On non-linux platforms, mlock()'d memory must be aligned */
+ memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char,
+ getpagesize(), memcredp->len);
+#endif
+ /* On non-linux platforms, mlock()'d memory must be aligned */
+
memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char, psize,
memcredp->len);
Do you need the SMB_MEMALIGN_ARRAY twice?
--
James Peach | [EMAIL PROTECTED]