BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005464 [uClibc] Architecture Specific minor always 10-17-08 05:26 10-20-08 00:54
Reporter upakul View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version 0.9.27
Summary 0005464: Memcpy forward copy breaks with unaligned transfers in memcpy(ARM)
Description Hi all,

The issue observed is that if we try to do unaligned transfers in the case of forward copy it raises an error. However everything works fine in the case of backward copy.

To reproduce write a simple program like:

#include <stdio.h>
#include <string.h>
#include <sys/time.h>

static volatile char dst[4*1024*1024+64],src[4*1024*1024+64];

int main(int argc, char **argv)
{
   int i, count=atoi(argv[2]);
   char *newsrc = (char *)( ( ( ((int)&src[31])/32 )*32) + atoi(argv[1]));
   char *newdst = (char *)( ( ( ((int)&dst[31])/32 )*32) + atoi(argv[1]));
   memset(newsrc,'A',4194304);
   memset(newdst,'B',4194304);
   for (i=0;i<count;i++)
   {
     memcpy(newdst, newsrc, 4194304);
   }
   return 0;
}

Where argv[1] is the alignment. It will throw error if alignment is 1,3 and so on... However the same thing works fine in the case of backward copy[To perform a backward copy, declare the buffers as static volatile char src[4*1024*1024+64], dst[4*1024*1024+64];]
Additional Information
Attached Files

- Relationships

- Notes
(0013724)
bernhardf
10-17-08 05:41

You need to specify which version of uClibc you are using.
 
(0013734)
upakul
10-17-08 05:52
edited on: 10-17-08 06:00

uClibc version used is 0.9.29

 
(0013744)
bernhardf
10-17-08 06:05

ISTR that there were fixes in this area (0.9.27 is very old). Try a recent version, I'd recommend to use trunk which will be released as 0.9.30 soon:
$ svn co svn://uclibc.org/trunk/uClibc [^]
 
(0013854)
upakul
10-19-08 21:37

The issue is not visible with the latest version.

Thanks.
 

- Issue History
Date Modified Username Field Change
10-17-08 05:26 upakul New Issue
10-17-08 05:26 upakul Status new => assigned
10-17-08 05:26 upakul Assigned To  => uClibc
10-17-08 05:41 bernhardf Note Added: 0013724
10-17-08 05:52 upakul Note Added: 0013734
10-17-08 06:00 upakul Note Edited: 0013734
10-17-08 06:05 bernhardf Note Added: 0013744
10-17-08 06:06 bernhardf version  => 0.9.27
10-19-08 21:37 upakul Note Added: 0013854
10-20-08 00:54 bernhardf Status assigned => closed
10-20-08 00:54 bernhardf Resolution open => fixed
10-20-08 00:54 bernhardf Fixed in Version  => 0.9.30


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker