/usr/share/doc/gcc-python-plugin-doc/html/0.9.html is in gcc-python-plugin-doc 0.15-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>0.9 — gcc-python-plugin 0.15 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.15',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="gcc-python-plugin 0.15 documentation" href="index.html" />
<link rel="up" title="Release Notes" href="release-notes.html" />
<link rel="next" title="0.8" href="0.8.html" />
<link rel="prev" title="0.10" href="0.10.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="0.8.html" title="0.8"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="0.10.html" title="0.10"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">gcc-python-plugin 0.15 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="release-notes.html" accesskey="U">Release Notes</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="id1">
<h1>0.9<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h1>
<div class="section" id="changes-to-the-gcc-python-plugin">
<h2>Changes to the GCC Python Plugin<a class="headerlink" href="#changes-to-the-gcc-python-plugin" title="Permalink to this headline">¶</a></h2>
<p>The plugin now works with GCC 4.7 prereleases (ticket <a class="reference external" href="https://fedorahosted.org/gcc-python-plugin/ticket/21">#21</a>).</p>
<p>The plugin is now integrated with GCC’s garbage collector: Python wrapper
objects keep their underlying GCC objects alive when GCC’s garbage collector
runs, preventing segfaults that could occur if the underlying objects were
swept away from under us
(ticket <a class="reference external" href="https://fedorahosted.org/gcc-python-plugin/ticket/1">#1</a>).</p>
<p>It’s now possible to attach Python callbacks to more GCC events:
<a class="reference internal" href="callbacks.html#gcc.PLUGIN_FINISH" title="gcc.PLUGIN_FINISH"><code class="xref py py-data docutils literal"><span class="pre">gcc.PLUGIN_FINISH</span></code></a>, <code class="xref py py-data docutils literal"><span class="pre">gcc.PLUGIN_GGC_START</span></code>,
<code class="xref py py-data docutils literal"><span class="pre">gcc.PLUGIN_GGC_MARKING</span></code>, <code class="xref py py-data docutils literal"><span class="pre">gcc.PLUGIN_GGC_FINISH</span></code>,
<a class="reference internal" href="callbacks.html#gcc.PLUGIN_FINISH_DECL" title="gcc.PLUGIN_FINISH_DECL"><code class="xref py py-data docutils literal"><span class="pre">gcc.PLUGIN_FINISH_DECL</span></code></a> (gcc 4.7)</p>
<p><a class="reference internal" href="tree.html#gcc.ArrayType" title="gcc.ArrayType"><code class="xref py py-class docutils literal"><span class="pre">gcc.ArrayType</span></code></a> has gained a “range” attribute, allowing scripts
to detect out-of-bounds conditions in array-handling.</p>
<p>A number of memory leaks were fixed: these were found by
<a class="reference external" href="http://git.fedorahosted.org/git/?p=gcc-python-plugin.git;a=commitdiff;h=4642a564e03c9e2c8114bca206205ad9c8fbc308">running the plugin on itself</a>.</p>
<p>Various documentation improvements
(ticket <a class="reference external" href="https://fedorahosted.org/gcc-python-plugin/ticket/6">#6</a>,
ticket <a class="reference external" href="https://fedorahosted.org/gcc-python-plugin/ticket/31">#31</a>).</p>
</div>
<div class="section" id="improvements-to-gcc-with-cpychecker">
<h2>Improvements to <a class="reference internal" href="cpychecker.html"><em>gcc-with-cpychecker</em></a><a class="headerlink" href="#improvements-to-gcc-with-cpychecker" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="cpychecker.html"><em>gcc-with-cpychecker</em></a> tool has received some deep
internal improvements in this release.</p>
<p>The logic for analyzing the outcome of comparisons has been rewritten for this
release, fixing some significant bugs that could lead to the analyzer
incorrectly deciding whether or not a block of code was reachable.</p>
<p>Similarly, the logic for detecting loops has been rewritten, elimininating a
bug in which the checker would prematurely stop analyzing loops with
complicated termination conditions, and not analyze the body of the loop.</p>
<p>Doing so extended the reach of the checker, and enabled it to find the memory
leaks referred to above.</p>
<p>In addition, the checker now emits more detailed information on the ranges of
possible values it’s considering when a comparison occurs against an unknown
value:</p>
<div class="highlight-python"><div class="highlight"><pre>input.c: In function 'test':
input.c:41:5: warning: comparison against uninitialized data (item) at input.c:41 [enabled by default]
input.c:34:12: note: when PyList_New() succeeds at: result = PyList_New(len);
input.c:35:8: note: taking False path at: if (!result) {
input.c:39:12: note: reaching: for (i = 0; i < len; i++) {
input.c:39:5: note: when considering range: 1 <= value <= 0x7fffffff at: for (i = 0; i < len; i++) {
input.c:39:5: note: taking True path at: for (i = 0; i < len; i++) {
input.c:41:5: note: reaching: if (!item) {
</pre></div>
</div>
<p>The checker should do a better job of identifying PyObject subclasses.
Previously it was treating any struct beginning with “ob_refcnt” and “ob_type”
as a Python object (with some tweaks for python 3 and debug builds). It now
also covers structs that begin with a field that’s a PyObject (or subclass),
since these are likely to also be PyObject subclasses.</p>
<div class="section" id="usage-of-deallocated-memory">
<h3>Usage of deallocated memory<a class="headerlink" href="#usage-of-deallocated-memory" title="Permalink to this headline">¶</a></h3>
<p>Previously, the checker would warn about paths through a function that could
return a pointer to deallocated memory, or which tried to read through such
a pointer. With this release, the checker will now also warn about paths
through a function in which a pointer to deallocated memory is passed to a
function.</p>
<p>For example, given this buggy code:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="k">extern</span> <span class="kt">void</span> <span class="nf">some_function</span><span class="p">(</span><span class="n">PyObject</span> <span class="o">*</span><span class="p">);</span>
<span class="kt">void</span>
<span class="nf">test</span><span class="p">(</span><span class="n">PyObject</span> <span class="o">*</span><span class="n">self</span><span class="p">,</span> <span class="n">PyObject</span> <span class="o">*</span><span class="n">args</span><span class="p">)</span>
<span class="p">{</span>
<span class="cm">/* Create an object: */</span>
<span class="n">PyObject</span> <span class="o">*</span><span class="n">tmp</span> <span class="o">=</span> <span class="n">PyLong_FromLong</span><span class="p">(</span><span class="mh">0x1000</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">tmp</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/*</span>
<span class="cm"> Now decref the object. Depending on what other references are owned</span>
<span class="cm"> on the object, it can reach a refcount of zero, and thus be deallocated:</span>
<span class="cm"> */</span>
<span class="n">Py_DECREF</span><span class="p">(</span><span class="n">tmp</span><span class="p">);</span>
<span class="cm">/* BUG: the object being returned may have been deallocated */</span>
<span class="n">some_function</span><span class="p">(</span><span class="n">tmp</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>the checker will emit this warning:</p>
<div class="highlight-python"><div class="highlight"><pre>input.c: In function 'test':
input.c:45: warning: passing pointer to deallocated memory as argument 1 of function at input.c:45: memory deallocated at input.c:42 [enabled by default]
input.c:32: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000);
input.c:34: note: taking False path at: if (!tmp) {
input.c:42: note: reaching: Py_DECREF(tmp);
input.c:42: note: when taking False path at: Py_DECREF(tmp);
input.c:42: note: reaching: Py_DECREF(tmp);
input.c:42: note: calling tp_dealloc on PyLongObject allocated at input.c:32 at: Py_DECREF(tmp);
input.c:45: note: reaching: foo(tmp);
input.c:30: note: graphical error report for function 'passing_dead_object_to_function' written out to 'input.c.test-refcount-errors.html'
</pre></div>
</div>
</div>
<div class="section" id="coverage-of-the-cpython-api">
<h3>Coverage of the CPython API<a class="headerlink" href="#coverage-of-the-cpython-api" title="Permalink to this headline">¶</a></h3>
<p>This release adds heuristics for the behavior of the following CPython API
entrypoints:</p>
<blockquote>
<div><ul class="simple">
<li>PyString_Concat</li>
<li>PyString_ConcatAndDel</li>
</ul>
</div></blockquote>
<p>along with various other bugfixes and documentation improvements.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">0.9</a><ul>
<li><a class="reference internal" href="#changes-to-the-gcc-python-plugin">Changes to the GCC Python Plugin</a></li>
<li><a class="reference internal" href="#improvements-to-gcc-with-cpychecker">Improvements to <code class="docutils literal"><span class="pre">gcc-with-cpychecker</span></code></a><ul>
<li><a class="reference internal" href="#usage-of-deallocated-memory">Usage of deallocated memory</a></li>
<li><a class="reference internal" href="#coverage-of-the-cpython-api">Coverage of the CPython API</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="0.10.html"
title="previous chapter">0.10</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="0.8.html"
title="next chapter">0.8</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/0.9.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="0.8.html" title="0.8"
>next</a> |</li>
<li class="right" >
<a href="0.10.html" title="0.10"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">gcc-python-plugin 0.15 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="release-notes.html" >Release Notes</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011-2016, David Malcolm.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.5.
</div>
</body>
</html>
|