bug in 3.2.0 nmblookup

Alan DeKok aland at ox.org
Fri Jul 4 09:08:54 GMT 2008


Zachary Loafman wrote:
> In the case above, the aliasing occurs in the same function, the
> original pointer ("ss") is passed into the function, and the compiler is
> required to act on all of those assignments (because neither of the
> pointers can be proven to reference local variables).

  That may be true.  All I know is I ran into pointer aliasing issues
with pretty much the same code.  Casting 'struct sockaddr_storage *' to
'struct sockaddr_in *', assigning to 'sa', and discovering that *some*
assignments to 'struct sockaddr_in *' were optimized away.

> Furthermore, the
> assignments don't reference the same memory, so the actual order of the
> assignments is irrelevant (one of the common aliasing optimization
> issues is that the compiler should be allowed to reorder the assignments
> for distinct pointers, but it's irrelevant here). There's no possible
> aliasing bug here.

  I don't claim to be a compiler expert.  I'm just trying to give a
heads up for potential issues.

  Alan DeKok.


More information about the samba-technical mailing list