C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 28th, 2008, 05:00 PM
0x00000005 0x00000005 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 2 0x00000005 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 27 sec
Reputation Power: 0
Red face 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!

Reply With Quote
  #2  
Old December 28th, 2008, 05:17 PM
0x00000005 0x00000005 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 2 0x00000005 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 27 sec
Reputation Power: 0
let me know.. again, happy new year!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > 0xC0000005: Access violation


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap