mollusk 019f8e3064 Add: julia-0.6.2
Former-commit-id: ccc667cf67d569f3fb3df39aa57c2134755a7551
2018-02-10 10:27:19 -07:00

28 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Reporting and analyzing crashes (segfaults) · The Julia Language</title><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-28835595-6', 'auto');
ga('send', 'pageview');
</script><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/highlightjs/default.css" rel="stylesheet" type="text/css"/><link href="../assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><a href="../index.html"><img class="logo" src="../assets/logo.png" alt="The Julia Language logo"/></a><h1>The Julia Language</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" action="../search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="../index.html">Home</a></li><li><span class="toctext">Manual</span><ul><li><a class="toctext" href="../manual/introduction.html">Introduction</a></li><li><a class="toctext" href="../manual/getting-started.html">Getting Started</a></li><li><a class="toctext" href="../manual/variables.html">Variables</a></li><li><a class="toctext" href="../manual/integers-and-floating-point-numbers.html">Integers and Floating-Point Numbers</a></li><li><a class="toctext" href="../manual/mathematical-operations.html">Mathematical Operations and Elementary Functions</a></li><li><a class="toctext" href="../manual/complex-and-rational-numbers.html">Complex and Rational Numbers</a></li><li><a class="toctext" href="../manual/strings.html">Strings</a></li><li><a class="toctext" href="../manual/functions.html">Functions</a></li><li><a class="toctext" href="../manual/control-flow.html">Control Flow</a></li><li><a class="toctext" href="../manual/variables-and-scoping.html">Scope of Variables</a></li><li><a class="toctext" href="../manual/types.html">Types</a></li><li><a class="toctext" href="../manual/methods.html">Methods</a></li><li><a class="toctext" href="../manual/constructors.html">Constructors</a></li><li><a class="toctext" href="../manual/conversion-and-promotion.html">Conversion and Promotion</a></li><li><a class="toctext" href="../manual/interfaces.html">Interfaces</a></li><li><a class="toctext" href="../manual/modules.html">Modules</a></li><li><a class="toctext" href="../manual/documentation.html">Documentation</a></li><li><a class="toctext" href="../manual/metaprogramming.html">Metaprogramming</a></li><li><a class="toctext" href="../manual/arrays.html">Multi-dimensional Arrays</a></li><li><a class="toctext" href="../manual/linear-algebra.html">Linear algebra</a></li><li><a class="toctext" href="../manual/networking-and-streams.html">Networking and Streams</a></li><li><a class="toctext" href="../manual/parallel-computing.html">Parallel Computing</a></li><li><a class="toctext" href="../manual/dates.html">Date and DateTime</a></li><li><a class="toctext" href="../manual/interacting-with-julia.html">Interacting With Julia</a></li><li><a class="toctext" href="../manual/running-external-programs.html">Running External Programs</a></li><li><a class="toctext" href="../manual/calling-c-and-fortran-code.html">Calling C and Fortran Code</a></li><li><a class="toctext" href="../manual/handling-operating-system-variation.html">Handling Operating System Variation</a></li><li><a class="toctext" href="../manual/environment-variables.html">Environment Variables</a></li><li><a class="toctext" href="../manual/embedding.html">Embedding Julia</a></li><li><a class="toctext" href="../manual/packages.html">Packages</a></li><li><a class="toctext" href="../manual/profile.html">Profiling</a></li><li><a class="toctext" href="../manual/stacktraces.html">Stack Traces</a></li><li><a class="toctext" href="../manual/performance-tips.html">Performance Tips</a></li><li><a class="toctext" href="../manual/workflow-tips.html">Workflow Tips</a></li><li><a class="toctext" href="../manual/style-guide.html">Style Guide</a></li><li><a class="toctext" href="../manual/faq.html">Frequently Asked Questions</a></li><li><a class="toctext" href="../manual/noteworthy-differences.html">Noteworthy Differences from other Languages</a></li><li><a class="toctext" href="../manual/unicode-input.html">Unicode Input</a></li></ul></li><li><span class="toctext">Standard Library</span><ul><li><a class="toctext" href="../stdlib/base.html">Essentials</a></li><li><a class="toctext" href="../stdlib/collections.html">Collections and Data Structures</a></li><li><a class="toctext" href="../stdlib/math.html">Mathematics</a></li><li><a class="toctext" href="../stdlib/numbers.html">Numbers</a></li><li><a class="toctext" href="../stdlib/strings.html">Strings</a></li><li><a class="toctext" href="../stdlib/arrays.html">Arrays</a></li><li><a class="toctext" href="../stdlib/parallel.html">Tasks and Parallel Computing</a></li><li><a class="toctext" href="../stdlib/linalg.html">Linear Algebra</a></li><li><a class="toctext" href="../stdlib/constants.html">Constants</a></li><li><a class="toctext" href="../stdlib/file.html">Filesystem</a></li><li><a class="toctext" href="../stdlib/io-network.html">I/O and Network</a></li><li><a class="toctext" href="../stdlib/punctuation.html">Punctuation</a></li><li><a class="toctext" href="../stdlib/sort.html">Sorting and Related Functions</a></li><li><a class="toctext" href="../stdlib/pkg.html">Package Manager Functions</a></li><li><a class="toctext" href="../stdlib/dates.html">Dates and Time</a></li><li><a class="toctext" href="../stdlib/iterators.html">Iteration utilities</a></li><li><a class="toctext" href="../stdlib/test.html">Unit Testing</a></li><li><a class="toctext" href="../stdlib/c.html">C Interface</a></li><li><a class="toctext" href="../stdlib/libc.html">C Standard Library</a></li><li><a class="toctext" href="../stdlib/libdl.html">Dynamic Linker</a></li><li><a class="toctext" href="../stdlib/profile.html">Profiling</a></li><li><a class="toctext" href="../stdlib/stacktraces.html">StackTraces</a></li><li><a class="toctext" href="../stdlib/simd-types.html">SIMD Support</a></li></ul></li><li><span class="toctext">Developer Documentation</span><ul><li><a class="toctext" href="reflection.html">Reflection and introspection</a></li><li><span class="toctext">Documentation of Julia&#39;s Internals</span><ul><li><a class="toctext" href="init.html">Initialization of the Julia runtime</a></li><li><a class="toctext" href="ast.html">Julia ASTs</a></li><li><a class="toctext" href="types.html">More about types</a></li><li><a class="toctext" href="object.html">Memory layout of Julia Objects</a></li><li><a class="toctext" href="eval.html">Eval of Julia code</a></li><li><a class="toctext" href="callconv.html">Calling Conventions</a></li><li><a class="toctext" href="compiler.html">High-level Overview of the Native-Code Generation Process</a></li><li><a class="toctext" href="functions.html">Julia Functions</a></li><li><a class="toctext" href="cartesian.html">Base.Cartesian</a></li><li><a class="toctext" href="meta.html">Talking to the compiler (the <code>:meta</code> mechanism)</a></li><li><a class="toctext" href="subarrays.html">SubArrays</a></li><li><a class="toctext" href="sysimg.html">System Image Building</a></li><li><a class="toctext" href="llvm.html">Working with LLVM</a></li><li><a class="toctext" href="stdio.html">printf() and stdio in the Julia runtime</a></li><li><a class="toctext" href="boundscheck.html">Bounds checking</a></li><li><a class="toctext" href="locks.html">Proper maintenance and care of multi-threading locks</a></li><li><a class="toctext" href="offset-arrays.html">Arrays with custom indices</a></li><li><a class="toctext" href="libgit2.html">Base.LibGit2</a></li><li><a class="toctext" href="require.html">Module loading</a></li></ul></li><li><span class="toctext">Developing/debugging Julia&#39;s C code</span><ul><li class="current"><a class="toctext" href="backtraces.html">Reporting and analyzing crashes (segfaults)</a><ul class="internal"><li><a class="toctext" href="#dev-version-info-1">Version/Environment info</a></li><li><a class="toctext" href="#Segfaults-during-bootstrap-(sysimg.jl)-1">Segfaults during bootstrap (<code>sysimg.jl</code>)</a></li><li><a class="toctext" href="#Segfaults-when-running-a-script-1">Segfaults when running a script</a></li><li><a class="toctext" href="#Errors-during-Julia-startup-1">Errors during Julia startup</a></li><li><a class="toctext" href="#Glossary-1">Glossary</a></li></ul></li><li><a class="toctext" href="debuggingtips.html">gdb debugging tips</a></li><li><a class="toctext" href="valgrind.html">Using Valgrind with Julia</a></li><li><a class="toctext" href="sanitizers.html">Sanitizer support</a></li></ul></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li>Developer Documentation</li><li>Developing/debugging Julia&#39;s C code</li><li><a href="backtraces.html">Reporting and analyzing crashes (segfaults)</a></li></ul><a class="edit-page" href="https://github.com/JuliaLang/julia/tree/d386e40c17d43b79fc89d3e579fc04547241787c/doc/src/devdocs/backtraces.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Reporting and analyzing crashes (segfaults)</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Reporting-and-analyzing-crashes-(segfaults)-1" href="#Reporting-and-analyzing-crashes-(segfaults)-1">Reporting and analyzing crashes (segfaults)</a></h1><p>So you managed to break Julia. Congratulations! Collected here are some general procedures you can undergo for common symptoms encountered when something goes awry. Including the information from these debugging steps can greatly help the maintainers when tracking down a segfault or trying to figure out why your script is running slower than expected.</p><p>If you&#39;ve been directed to this page, find the symptom that best matches what you&#39;re experiencing and follow the instructions to generate the debugging information requested. Table of symptoms:</p><ul><li><p><a href="backtraces.html#Segfaults-during-bootstrap-(sysimg.jl)-1">Segfaults during bootstrap (<code>sysimg.jl</code>)</a></p></li><li><p><a href="backtraces.html#Segfaults-when-running-a-script-1">Segfaults when running a script</a></p></li><li><p><a href="backtraces.html#Errors-during-Julia-startup-1">Errors during Julia startup</a></p></li></ul><h2><a class="nav-anchor" id="dev-version-info-1" href="#dev-version-info-1">Version/Environment info</a></h2><p>No matter the error, we will always need to know what version of Julia you are running. When Julia first starts up, a header is printed out with a version number and date. If your version is <code>0.2.0</code> or higher, please include the output of <code>versioninfo()</code> in any report you create:</p><pre><code class="language-julia-repl">julia&gt; versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E3-1241 v3 @ 3.50GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)</code></pre><h2><a class="nav-anchor" id="Segfaults-during-bootstrap-(sysimg.jl)-1" href="#Segfaults-during-bootstrap-(sysimg.jl)-1">Segfaults during bootstrap (<code>sysimg.jl</code>)</a></h2><p>Segfaults toward the end of the <code>make</code> process of building Julia are a common symptom of something going wrong while Julia is preparsing the corpus of code in the <code>base/</code> folder. Many factors can contribute toward this process dying unexpectedly, however it is as often as not due to an error in the C-code portion of Julia, and as such must typically be debugged with a debug build inside of <code>gdb</code>. Explicitly:</p><p>Create a debug build of Julia:</p><pre><code class="language-none">$ cd &lt;julia_root&gt;
$ make debug</code></pre><p>Note that this process will likely fail with the same error as a normal <code>make</code> incantation, however this will create a debug executable that will offer <code>gdb</code> the debugging symbols needed to get accurate backtraces. Next, manually run the bootstrap process inside of <code>gdb</code>:</p><pre><code class="language-none">$ cd base/
$ gdb -x ../contrib/debug_bootstrap.gdb</code></pre><p>This will start <code>gdb</code>, attempt to run the bootstrap process using the debug build of Julia, and print out a backtrace if (when) it segfaults. You may need to hit <code>&lt;enter&gt;</code> a few times to get the full backtrace. Create a <a href="https://gist.github.com">gist</a> with the backtrace, the <a href="backtraces.html#dev-version-info-1">version info</a>, and any other pertinent information you can think of and open a new <a href="https://github.com/JuliaLang/julia/issues?q=is%3Aopen">issue</a> on Github with a link to the gist.</p><h2><a class="nav-anchor" id="Segfaults-when-running-a-script-1" href="#Segfaults-when-running-a-script-1">Segfaults when running a script</a></h2><p>The procedure is very similar to <a href="backtraces.html#Segfaults-during-bootstrap-(sysimg.jl)-1">Segfaults during bootstrap (<code>sysimg.jl</code>)</a>. Create a debug build of Julia, and run your script inside of a debugged Julia process:</p><pre><code class="language-none">$ cd &lt;julia_root&gt;
$ make debug
$ gdb --args usr/bin/julia-debug &lt;path_to_your_script&gt;</code></pre><p>Note that <code>gdb</code> will sit there, waiting for instructions. Type <code>r</code> to run the process, and <code>bt</code> to generate a backtrace once it segfaults:</p><pre><code class="language-none">(gdb) r
Starting program: /home/sabae/src/julia/usr/bin/julia-debug ./test.jl
...
(gdb) bt</code></pre><p>Create a <a href="https://gist.github.com">gist</a> with the backtrace, the <a href="backtraces.html#dev-version-info-1">version info</a>, and any other pertinent information you can think of and open a new <a href="https://github.com/JuliaLang/julia/issues?q=is%3Aopen">issue</a> on Github with a link to the gist.</p><h2><a class="nav-anchor" id="Errors-during-Julia-startup-1" href="#Errors-during-Julia-startup-1">Errors during Julia startup</a></h2><p>Occasionally errors occur during Julia&#39;s startup process (especially when using binary distributions, as opposed to compiling from source) such as the following:</p><pre><code class="language-julia">$ julia
exec: error -5</code></pre><p>These errors typically indicate something is not getting loaded properly very early on in the bootup phase, and our best bet in determining what&#39;s going wrong is to use external tools to audit the disk activity of the <code>julia</code> process:</p><ul><li><p>On Linux, use <code>strace</code>:</p><pre><code class="language-none">$ strace julia</code></pre></li><li><p>On OSX, use <code>dtruss</code>:</p><pre><code class="language-none">$ dtruss -f julia</code></pre></li></ul><p>Create a <a href="https://gist.github.com">gist</a> with the <code>strace</code>/ <code>dtruss</code> ouput, the <a href="backtraces.html#dev-version-info-1">version info</a>, and any other pertinent information and open a new <a href="https://github.com/JuliaLang/julia/issues?q=is%3Aopen">issue</a> on Github with a link to the gist.</p><h2><a class="nav-anchor" id="Glossary-1" href="#Glossary-1">Glossary</a></h2><p>A few terms have been used as shorthand in this guide:</p><ul><li><p><code>&lt;julia_root&gt;</code> refers to the root directory of the Julia source tree; e.g. it should contain folders such as <code>base</code>, <code>deps</code>, <code>src</code>, <code>test</code>, etc.....</p></li></ul><footer><hr/><a class="previous" href="require.html"><span class="direction">Previous</span><span class="title">Module loading</span></a><a class="next" href="debuggingtips.html"><span class="direction">Next</span><span class="title">gdb debugging tips</span></a></footer></article></body></html>