Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialisation output differs between x86-64 and 32 bit ARM #4

Open
GoogleCodeExporter opened this issue Apr 2, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Compile and run the attached program on x86-64 and ARM
2. Compare outputs
3. Be sad

What is the expected output? What do you see instead?
The expected output is: 
92 DC 00 1B 57 BB 32 30 31 34 2F 30 32 2F 30 33 20 31 31 3A 30 35 3A 32 37 2E 
35 34 39 39 39 39 32 01 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DC 00 
1B 57 BB 32 30 31 34 2F 
30 32 2F 30 33 20 31 31 3A 30 35 3A 32 37 2E 35 34 39 39 39 39 32 01 00 00 00 
00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 
The received (ARM) output is:
92 DC 00 1B 57 BB 32 30 31 34 2F 30 32 2F 30 33 20 31 31 3A 30 35 3A 32 37 2E 
35 34 39 39 39 39 32 01 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 
00 57 BB 32 30 31 34 2F 
30 32 2F 30 33 20 31 31 3A 30 35 3A 32 37 2E 35 34 39 39 39 39 32 01 00 00 00 
00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 
Note the difference after the first run of zeroes.

What version of the product are you using? On what operating system?
Compiled from source retrieved 2nd Feb 2014, compiled on Ubuntu 13.10, (also 
cross compiled for arm926ej)

Please provide any additional information below.
I'm not sure if this is simply a 32 bit vs 64 bit problem, the ARM part might 
be red herring. Both systems
are little endian, so it's not that.

The function that generated this output:

void sertest(void)
{
    int k,i,ii;
    msgpack_p *p = msgpack_pack_init();
    msgpack_pack_array(p, 2);
    for (i = 0; i < 2; i++)
    {
        msgpack_pack_array(p, 27);
        msgpack_pack_uint16(p, 87);
        msgpack_pack_str(p, "2014/02/03 11:05:27.5499992");
        msgpack_pack_int8 (p, (char) 1);
        for (ii = 0; ii < 24; ii++)
            msgpack_pack_uint16(p, 0);
    }
    const uint8_t * buf;
    uint32_t len;
    msgpack_get_buffer(p, &buf, &len);
    for ( k = 0; k < len; ++k )
    printf( "%02X ", buf[k] );
    printf( "\n len was %d \n", len );
}

Original issue reported on code.google.com by [email protected] on 4 Feb 2014 at 12:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant