Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#306 closed defect (fixed)

Error in SIP transport lookup because of memory alignment problem on Nintendo DS (thanks Samuel Vinson)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.7.0
Component: pjsip Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

The key for looking up transport in hash table is declared like this:

struct transport_key
{
    pjsip_transport_type_e  type;
    pj_sockaddr             addr;
};

This causes a problem when the compiler maps type field to char data type and when the addr field starts at transport_key+4, because there are three unitialized bytes between type and addr.

More over, the key length is calculated as sizeof(key.addr) + addr_len, so this would cause several bytes of the key to be ignored.

Currently this has been reported as a problem on Nintendo DS port only.

Thanks Samuel Vinson <samuelv at users.sourceforge.net> for pointing this out!

Change History (2)

comment:1 Changed 18 years ago by bennylp

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from Error in SIP transport lookup because of memory alignment problem (thanks Samuel Vinson) to Error in SIP transport lookup because of memory alignment problem on Nintendo DS (thanks Samuel Vinson)

Fixed in r1310.

The fix changes the key structure to:

struct pjsip_transport_key
{
  long          type;
  pj_sockaddr   rem_addr;
};

comment:2 Changed 18 years ago by bennylp

Another changeset in r1317, to fix build error on Symbian because of above changes (thanks Esbjörn Dominique for pointing this out).

Note: See TracTickets for help on using tickets.