28 lines
16 KiB
HTML
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
|
||
|
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 <julia_root>
|
||
|
$ 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><enter></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 <julia_root>
|
||
|
$ make debug
|
||
|
$ gdb --args usr/bin/julia-debug <path_to_your_script></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'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'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><julia_root></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>
|