<s>
A	O
stale	B-Error_Name
pointer	I-Error_Name
bug	I-Error_Name
,	O
otherwise	O
known	O
as	O
an	O
aliasing	B-Error_Name
bug	I-Error_Name
,	O
is	O
a	O
class	O
of	O
subtle	O
programming	O
errors	O
that	O
can	O
arise	O
in	O
code	O
that	O
does	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
,	O
especially	O
via	O
the	O
malloc	B-Language
function	O
or	O
equivalent	O
.	O
</s>
<s>
If	O
several	O
pointers	O
address	O
(	O
are	O
"	O
aliases	O
for	O
"	O
)	O
a	O
given	O
chunk	O
of	O
storage	O
,	O
it	O
may	O
happen	O
that	O
the	O
storage	O
is	O
freed	O
or	O
reallocated	O
(	O
and	O
thus	O
moved	O
)	O
through	O
one	O
alias	O
and	O
then	O
referenced	O
through	O
another	O
,	O
which	O
may	O
lead	O
to	O
subtle	O
(	O
and	O
possibly	O
intermittent	O
)	O
errors	O
depending	O
on	O
the	O
state	O
and	O
the	O
allocation	O
history	O
of	O
the	O
malloc	B-Language
arena	O
.	O
</s>
<s>
This	O
bug	O
can	O
be	O
avoided	O
by	O
never	O
creating	O
aliases	O
for	O
allocated	O
memory	O
,	O
by	O
controlling	O
the	O
dynamic	O
scope	B-Language
of	O
references	O
to	O
the	O
storage	O
so	O
that	O
none	O
can	O
remain	O
when	O
it	O
is	O
freed	O
,	O
or	O
by	O
use	O
of	O
a	O
garbage	B-General_Concept
collector	I-General_Concept
,	O
in	O
the	O
form	O
of	O
an	O
intelligent	O
memory-allocation	O
library	O
or	O
as	O
provided	O
by	O
higher-level	B-Language
languages	I-Language
,	O
such	O
as	O
Lisp	B-Language
.	O
</s>
<s>
The	O
term	O
"	O
aliasing	B-Error_Name
bug	I-Error_Name
"	O
is	O
nowadays	O
associated	O
with	O
C	B-Language
programming	I-Language
,	O
but	O
it	O
was	O
already	O
in	O
use	O
in	O
a	O
very	O
similar	O
sense	O
in	O
the	O
ALGOL	B-Language
60	O
and	O
Fortran	B-Application
programming	I-Application
language	I-Application
communities	O
in	O
the	O
1960s	O
.	O
</s>
