Thread: Handling 64-bit pointer into 32-bit pointer of two different processes

  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    1

    Lightbulb Handling 64-bit pointer into 32-bit pointer of two different processes

    Hi Friends,

    I am working on an application ('C' language, 'Linux' platform) which has two processes running together. One process which is 64-bit returns a void pointer of 8 bytes which another process of 32-bit has to get and use it. 32-bit process is expecting 32-bit void pointer. When the address of 64-bit is copied to 32-bit, the system crashes.

    Please let me know how can 32-bit void pointer can handle 64-bit void pointer returned by another process. Please share code in 'C' language on Linux platform if possible.

    cheers,
    harish

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,656
    Why are you sharing pointers?

    What are the pointers pointing at?

    Can't you use something more reliable, like say a Unix socket, for sharing data between two different architectures?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 08-18-2015, 03:13 PM
  2. Replies: 8
    Last Post: 03-01-2015, 12:39 AM
  3. Null pointer handling Linux vs Windows
    By fnoyan in forum C Programming
    Replies: 13
    Last Post: 11-26-2012, 02:52 AM
  4. Replies: 3
    Last Post: 10-30-2009, 04:41 PM
  5. Replies: 4
    Last Post: 08-27-2007, 11:51 PM

Tags for this Thread