Consult with the Great God

Source: Internet
Author: User

We are the Win32 server then use the Cocos client Cocos compiled Win32 program with Android two different platform programs

Then the creation of the character will be issued a int64 that is Longlong field Win32 no problem, but Android will crash.

The Great God: "Win32 with Arm ... Is it the same as the word order? "

So how do you check preface?

The Great God: "The quickest and most int64 I can think of is to see a char[8] and print it out."

Collapse

Fatal siganl 7 (Sigbus) at

Oh, Sigbus.
Great God
This may not be a pack problem.
Great God
Pack is not guaranteed
Great God
If it's sigbus, I understand that the system might want to sbuf+index-sizeof (__int64) This address is a 64-bit address.

If the sbuf are all 64 bits of data, the problem is not very much, but if you have Getint32,getchar and other interfaces, do not follow the 8-byte alignment of the agreement to modify index, there may be some CPU can not stand it-I know MIPS have this statement, ARM really Don't know

That only avoids using int64?

Great God It doesn't matter, General RISC will also have unaligned instruction set of bar ...

Great God

It doesn't matter, General RISC will also have unaligned instruction set of bar ...

__int64 GetInt64 (char* sbuf, int& index, unsigned int nbufferlen)
{
__int64 N;
Index + = sizeof (__int64);
memcpy (&n, sbuf+index-sizeof (__int64), sizeof (__int64));
return n;
}; Although the problem of byte order is not taken into account, it is expected that the instructions in the memcpy can be unaligned for the operands.

See Log.txt come to the conclusion but the abnormal reason basically sorta: Code 1 (BUS_ADRALN), I guess Adraln is Address Alignment such abbreviation, must be this problem

Fault addr 776a2db3 This sentence is very deadly, this address is at best aligned on the 1 bytes, or not at all aligned ...

Great God

Http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html

You can take a look at this, this is the ARM compiler's optimization of misaligned pointers, which can cause interference

PS in short, according to the idea of the great God is to solve the problem although I still foggy

Consult with the Great God

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.