View topic - Data is corrupting when address sent to another module

Data is corrupting when address sent to another module

anything that doesn't fit to other groups.

Data is corrupting when address sent to another module

Postby pramodama » Wed Feb 08, 2012 6:26 am

Hi All,

I am sending adress to another module where address remains same but data is corrupted by adding the data (Hex BC 55 36 70) to beginning of the data. Please do help me to find out the reason for this and the meaning of this.

Code snippet:
void *ptr;

sendToFunc((char*)ptr) (data is "I am Pramod")

in other module:
ptr printed (here data is BC 55 36 70 P r a m o d )

Always same 4 byte data is added to beginning. Please let us know about this.

Regards,
Pramod
pramodama
New Member
 
Posts: 9
Joined: Tue Nov 23, 2010 2:48 pm

Re: Data is corrupting when address sent to another module

Postby mario » Wed Feb 08, 2012 2:51 pm

Post exact code because there must be a bug in it. Without detail it's impossible to tell.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: Data is corrupting when address sent to another module

Postby maschoen » Wed Feb 08, 2012 8:57 pm

Keep in mind if you are sending a structure that the default GNU behavior is to pad so that the items in the structure are word (4byte) aligned.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron