On Fri, Dec 15, 2006 at 00:59:38 +0100, Samuel Thibault wrote:

> Hi,
> 
> Looks like the culprit line is update.c:726.
> 
>                     unsigned char checksum[16];
> 
> An unsigned char[16] won't necessarily be aligned by gcc.  However, it
> is used as a checksum buffer, on which md5_read_ctx() performs 32bit
> operations.  Hence the SIGBUS on sparc.  I guess the best correction
> would be to just express the correct type:
> 
>                     md5_uint32 checksum[4];
> 
I can confirm that the attached patch fixes this problem for me.

Cheers,
Julien
diff -u cvs-1.12.13/debian/changelog cvs-1.12.13/debian/changelog
--- cvs-1.12.13/debian/changelog
+++ cvs-1.12.13/debian/changelog
@@ -1,3 +1,10 @@
+cvs (1:1.12.13-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix unaligned access causing SIGBUS on sparc (closes: #402745).
+
+ -- Julien Cristau <[EMAIL PROTECTED]>  Fri, 15 Dec 2006 01:39:13 +0100
+
 cvs (1:1.12.13-5) unstable; urgency=low
 
   * Major update for l10n before etch, thanks to Christian Perrier.
only in patch2:
unchanged:
--- cvs-1.12.13.orig/debian/patches/98_fix_sparc_sigbus.diff
+++ cvs-1.12.13/debian/patches/98_fix_sparc_sigbus.diff
@@ -0,0 +1,30 @@
+diff -Nru cvs-1.12.13.orig/src/update.c cvs-1.12.13/src/update.c
+--- cvs-1.12.13.orig/src/update.c      2005-09-22 20:49:17.000000000 +0200
++++ cvs-1.12.13/src/update.c   2006-12-15 01:35:54.000000000 +0100
+@@ -58,7 +58,7 @@
+ static int patch_file (struct file_info *finfo,
+                        Vers_TS *vers_ts, 
+                        int *docheckout, struct stat *file_info,
+-                       unsigned char *checksum);
++                       md5_uint32 *checksum);
+ static void patch_file_write (void *, const char *, size_t);
+ #endif
+ static int merge_file (struct file_info *finfo, Vers_TS *vers);
+@@ -723,7 +723,7 @@
+               {
+                   int docheckout;
+                   struct stat file_info;
+-                  unsigned char checksum[16];
++                  md5_uint32 checksum[4];
+ 
+                   retval = patch_file (finfo,
+                                        vers, &docheckout,
+@@ -1511,7 +1511,7 @@
+  */
+ static int
+ patch_file (struct file_info *finfo, Vers_TS *vers_ts, int *docheckout,
+-          struct stat *file_info, unsigned char *checksum)
++          struct stat *file_info, md5_uint32 *checksum)
+ {
+     char *backup;
+     char *file1;

Attachment: signature.asc
Description: Digital signature

Reply via email to