
December 28th, 2008, 05:00 PM
|
Registered User
|
|
Join Date: Dec 2008
Posts: 2
Time spent in forums: 29 m 27 sec
Reputation Power: 0
|
|
0xC0000005: Access violation
hello, im using pthreads and memcpy and get error violation error:
Code:
#define BUF_SIZE 8192
thread_execute(mystruct *pmystruct){
char buf[BUF_SIZE+1];
while (regex matches)
{
memset(buf, 0, BUF_SIZE);
memcpy(buf, pmystruct->ABC+1k, BUF_SIZE); /* im trying to copy the first 8k starting from offset abc+1024. */
/* do something here */
}
}
mystruct {
ABC, CBE, DBA, EBX;
}
main(){
ABC = "SOMETHING..........THAT IS....LIKE... 30k...BIG.........";
FOR I < MAX_THREADS I++
PHTREAD_CREATE(thread_execute, (void*)mystruct);
}
i keep getting violation error.. although it works just fine with a single thread.
here is the error in more detail:
Code:
> asfjohdfc.exe!memcpy(unsigned char * dst=0x00ddda60, unsigned char * src=0x4536a5f5, unsigned long count=8192) Line 188 Asm
here is the exact line where it freaks out:
Code:
rep movsd ;N - move all of our dwords
thanks........... and happy new year!
|