22 lines
3.3 KiB
HTML
22 lines
3.3 KiB
HTML
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>aliasing bug</title><link rel="stylesheet" href="../../jargon.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"/><link rel="home" href="../index.html" title="The Jargon File"/><link rel="up" href="../A.html" title="A"/><link rel="previous" href="Alderson-loop.html" title="Alderson loop"/><link rel="next" href="Alice-and-Bob.html" title="Alice and Bob"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">aliasing bug</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Alderson-loop.html">Prev</a> </td><th width="60%" align="center">A</th><td width="20%" align="right"> <a accesskey="n" href="Alice-and-Bob.html">Next</a></td></tr></table><hr/></div><dt><a id="aliasing-bug"/><dt xmlns="" id="aliasing-bug"><b>aliasing bug</b>: <span xmlns="http://www.w3.org/1999/xhtml" class="grammar">n.</span></dt></dt><dd><p> A class of subtle programming errors that can arise in code that
|
||
does dynamic allocation, esp. via
|
||
<span class="citerefentry"><span class="refentrytitle">malloc</span>(3)</span>
|
||
or equivalent. If several pointers address (are <span class="firstterm">aliases for</span>) a given hunk of storage, it may
|
||
happen that the storage is freed or reallocated (and thus moved) through
|
||
one alias and then referenced through another, which may lead to subtle
|
||
(and possibly intermittent) lossage depending on the state and the
|
||
allocation history of the malloc <a href="arena.html"><i class="glossterm">arena</i></a>. Avoidable
|
||
by use of allocation strategies that never alias allocated core, or by use
|
||
of higher-level languages, such as <a href="../L/LISP.html"><i class="glossterm">LISP</i></a>, which
|
||
employ a garbage collector (see <a href="../G/GC.html"><i class="glossterm">GC</i></a>). Also called a
|
||
<a href="../S/stale-pointer-bug.html"><i class="glossterm">stale pointer bug</i></a>. See also
|
||
<a href="../P/precedence-lossage.html"><i class="glossterm">precedence lossage</i></a>,
|
||
<a href="../S/smash-the-stack.html"><i class="glossterm">smash the stack</i></a>,
|
||
<a href="../F/fandango-on-core.html"><i class="glossterm">fandango on core</i></a>,
|
||
<a href="../M/memory-leak.html"><i class="glossterm">memory leak</i></a>,
|
||
<a href="../M/memory-smash.html"><i class="glossterm">memory smash</i></a>,
|
||
<a href="../O/overrun-screw.html"><i class="glossterm">overrun screw</i></a>, <a href="../S/spam.html"><i class="glossterm">spam</i></a>.</p></dd><dd><p>Historical note: Though this term is nowadays associated with C
|
||
programming, it was already in use in a very similar sense in the Algol-60
|
||
and FORTRAN communities in the 1960s.</p></dd><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Alderson-loop.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="../A.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="Alice-and-Bob.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Alderson loop </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Alice and Bob</td></tr></table></div></body></html>
|