• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ancillary data and 32/64 bit processes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ancillary data and 32/64 bit processes


  • Subject: Re: Ancillary data and 32/64 bit processes
  • From: Kevin Van Vechten <email@hidden>
  • Date: Sun, 03 Feb 2008 22:18:30 -0800

On Feb 3, 2008, at 11:15 AM, Michael Tuexen wrote:

I habe a problem using ancillary data on 64-bit processes...

The macro CMSG_DATA ist defined in /usr/include/sys/socket.h as

#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
__DARWIN_ALIGN(sizeof(struct cmsghdr)))


__DARWIN_ALIGN behaves different on 32-bit processes and 64-bit processes.
Therefore the offset of the CMSG_DATA is 12 bytes on 32-bit processes
and 16 byte on 64-bit processes. However, the kernel ignores this difference
and puts the CMSG_DATA at a 12 byte offset.

User processes may be 32-bit or 64-bit, but the kernel always executes in a 32-bit address space.


Therefore programs using ancillary data work, when compiled for 32- bit,
but do not work when compiled for 64-bit.


I can provide a simple UDP discard server which shows this bug.

Is this a known bug?

Please file a bug <http://developer.apple.com/bugreporter/>. Even if it's a known issue, additional reports help us gauge the overall impact of the issue. (A quick check didn't find any issues reported against CMSG_DATA or DARWIN_ALIGN.)


Should it be fixed by changing the CMSG_DATA
macros to behave the same on 32-bit and 64-bit processes or should
the kernel be changed to adjust the ancillary data?

I suspect the former, since that would preserve the binary compatibility expectations of 64-bit processes with today's kernel.


This problem is crucial for our SCTP NKE, which uses ancillary
data a lot...

As a workaround, you could define your own CMSG_DATA macro.

- Kevin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Ancillary data and 32/64 bit processes
      • From: Michael Tuexen <email@hidden>
References: 
 >Ancillary data and 32/64 bit processes (From: Michael Tuexen <email@hidden>)

  • Prev by Date: Re: Leopard X11
  • Next by Date: Kernel Debug Kit 10.4.11?
  • Previous by thread: Ancillary data and 32/64 bit processes
  • Next by thread: Re: Ancillary data and 32/64 bit processes
  • Index(es):
    • Date
    • Thread