Lets try that again from the correct email address...

-------- Forwarded Message --------
> From: Alex Bennee <[EMAIL PROTECTED]>
> To: [email protected]
> Subject: sizeof(oid) and 32/64 bit issues
> Date: Wed, 09 Apr 2008 14:52:34 +0000
> 
> Hi,
> 
> I'm currently doing some work porting some of our apps to a 64 bit
> platform. Having run into some crashes I started using valgrind and
> found some interesting issues.
> 
> Our app uses both net-snmp and libsmi to do various things with MIB's.
> Internally we use net-snmp's oid type to define oids. However on 64 bit
> it breaks down when we pass an oid to libsmi to process. The problem can
> be seen by the following gdb session:
> 
> (gdb) p (SmiSubid *)sysName0
> $14 = (unsigned int *) 0x65ca60
> (gdb) p sizeof(unsigned int)
> $15 = 4
> (gdb) p sizeof(oid)
> $16 = 8
> (gdb) p sizeof(u_long)
> $17 = 8
> 
> I'm currently using the standard net-snmp installed on the latest Ubuntu
> which trails the current stable release by a version. I noted there has
> been a bunch of 64 bit work in the Changelog but looking at the current
> SVN I see oid is still typedef'ed as u_long.
> 
> I understand there is no particular reason why the internal workings of
> one library should match with another library as long as over-the-wire
> sizes are correct. However I'm curious if there is a reason as to the
> choice of u_long. Can an oid ever exceed 32 bits?
> 
> Wouldn't it be safer to define oid as u32int_t?
> 
> 

-- 
Alex Bennee, Software Engineer
Pound for pound, the amoeba is the most vicious animal on earth.

------------------------------------------------------------------------------
Cambridge Broadband Networks Limited

Registered in England and Wales under company number: 03879840
Registered office: Selwyn House, Cambridge Business Park, Cowley Road, 
Cambridge CB4 0WZ, UK.
VAT number: GB 741 0186 64

This email and any attachments are private and confidential. If you believe you 
have received this email in error please inform the sender and delete it from 
your mailbox or any other storage mechanism. Cambridge Broadband Networks 
Limited cannot accept liability for any statements made which are clearly the 
individual sender's own and not expressly made on behalf of Cambridge Broadband 
Networks Limited.



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to