[erlang-questions] make_ref bug or feature?

Richard O'Keefe <>
Mon Mar 30 03:14:17 CEST 2009


The external term format document says that
the format for a reference is
   1 byte	114	NEW_REFERENCE_EXT
   2 bytes	Len	Size of ID in words
   N bytes	Node	the Node on which the reference was created,
			as an encoded atom
   1 byte	Creation a 2-bit node generation number so that a
			node that crashes and restarts looks different;
			I don't understand why 2 bits was though to be
			enough
   N'bytes	ID	uninterpreted bytes of data; N' = 4*Len, and
			we are told that it should be no more than 12,
			so N' = 4, 8, or 12.  In the first word, there
			are only 18 significant bits, so presumably
			82 = 18 + 32 + 32 bits are _available_.


So that should be (18 to 82 bits worth) WITHIN a node; it shouldn't
be possible for a reference created on one node to match a
reference created on another even if they have the same 82-bit ID.

However, if two Erlang nodes have the same (presumably short) name,
then there could be trouble.




More information about the erlang-questions mailing list