Can't get the exact message using sockets in 64-bit Linux?

Discussion in 'Linux Networking' started by LaBird, Mar 12, 2006.

  1. LaBird

    LaBird Guest

    Hi all,

    I am trying to port a parallel program running from 32-bit
    Linux to 64-bit one. The program is using Berkeley sockets
    (asynchronous) as data communication.

    Things go alright, except that after successful compilation,
    the executable cannot run to completion. I find that the
    problem is that the source message before sent and the
    received message at the other party are different. One of
    the data items (at the end of message) should be 1, but
    the receiver gets it as 0. As the program's execution flow
    has to be decided by this value, the wrong value suggests
    the program's failure to execute to completion.

    Just before the problem exists, the OS gives some warnings
    like this:
    "sor254-2(2525): unaligned access to 0x60000000258da666,
    ip=0x4000000000042611"

    I belive the "misalignment" happens at the memory for the
    message received. And, the message has 32-byte header +
    7208 bytes of data, and it is the last 4 bytes that shows error.
    I'd like to ask if this is the "misalignment" that causes the
    message received to be different from the source? If so,
    what is the correct alignment to avoid this error (16 bytes?
    32 bytes?) then? And, why such problem does not occur
    in 32-bit Linux?

    Many thanks in advance.

    Best Regards,
    LaBird (Benny).
    [Email: Remove all numerals to get the correct email address.]
     
    LaBird, Mar 12, 2006
    #1
    1. Advertisements

  2. If you want help finding bugs, you will have to post a little code!

    Robert
     
    Robert Harris, Mar 12, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.