<p dir="auto">For a future metaprogramming module, I would like to have a <code class="notranslate">deparse(ex::Expr)</code> function that produces a reasonable string that could have been parsed to produce <code class="notranslate">ex</code>. I implemented a simplistic version of this in the Calculus package to make the results of symbolic differentiation more readable:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function deparse(ex::Expr)
    if ex.head != :call
        return string(ex)
    else
        if contains([:+, :-, :*, :/, :^], ex.args[1])
            if length(ex.args) == 2
                return strcat(ex.args[1], deparse(ex.args[2]))
            else
                return join(map(x -&gt; deparse(x), ex.args[2:end]),
                            strcat(&quot; &quot;, string(ex.args[1]), &quot; &quot;))
            end
        else
            return strcat(ex.args[1],
                          &quot;(&quot;,
                          join(map(x -&gt; deparse(x), ex.args[2:end]), &quot;, &quot;),
                          &quot;)&quot;)
        end
    end
end
deparse(other::Any) = string(other)"><pre class="notranslate"><code class="notranslate">function deparse(ex::Expr)
    if ex.head != :call
        return string(ex)
    else
        if contains([:+, :-, :*, :/, :^], ex.args[1])
            if length(ex.args) == 2
                return strcat(ex.args[1], deparse(ex.args[2]))
            else
                return join(map(x -&gt; deparse(x), ex.args[2:end]),
                            strcat(" ", string(ex.args[1]), " "))
            end
        else
            return strcat(ex.args[1],
                          "(",
                          join(map(x -&gt; deparse(x), ex.args[2:end]), ", "),
                          ")")
        end
    end
end
deparse(other::Any) = string(other)
</code></pre></div>
<p dir="auto">Hi everyone,</p>
<p dir="auto">I occasionally get a certain type of error upon calling "using [Package Name]" that crashes Julia. This error occurs at unpredictable timings; I would use a basic package during one session, but suddenly be prevented from loading it at all during the next session.</p>
<p dir="auto">For example,</p>
<p dir="auto">If I call<br>
<code class="notranslate">using Plots</code><br>
I would get the following:</p>
<p dir="auto"><code class="notranslate">[ Info: Recompiling stale cache file C:\Users\karen\.julia\compiled\v1.0\Plots\ld3vC.ji for Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] </code></p>
<p dir="auto">and then after a while, the error:</p>
<p dir="auto"><code class="notranslate">Exception: EXCEPTION_ACCESS_VIOLATION at 0x6b6496af -- jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1191 in expression starting at no file:0 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1191 emit_invoke at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3094 emit_expr at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3893 emit_ssaval_assign at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3615 emit_stmtpos at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3801 [inlined] emit_function at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:6262 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1159 emit_invoke at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3094 emit_expr at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3893 emit_ssaval_assign at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3615 emit_stmtpos at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3801 [inlined] emit_function at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:6262 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1159 emit_invoke at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3094 emit_expr at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3893 emit_ssaval_assign at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3615 emit_stmtpos at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3801 [inlined] emit_function at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:6262 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1159 emit_invoke at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3094 emit_expr at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3893 emit_ssaval_assign at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3615 emit_stmtpos at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3801 [inlined] emit_function at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:6262 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1159 emit_invoke at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3094 emit_expr at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3893 emit_ssaval_assign at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3615 emit_stmtpos at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:3801 [inlined] emit_function at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:6262 jl_compile_linfo at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\codegen.cpp:1159 jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1774 jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2162 wsitem at C:\Users\karen\.julia\packages\Atom\9h5Up\src\workspace.jl:22 wsitem at C:\Users\karen\.julia\packages\Atom\9h5Up\src\workspace.jl:19 jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2162 #255 at C:\Users\karen\.julia\packages\Atom\9h5Up\src\workspace.jl:8 _collect at .\generator.jl:47 map at .\array.jl:561 [inlined] workspace at C:\Users\karen\.julia\packages\Atom\9h5Up\src\workspace.jl:8 jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1809 jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2162 handlemsg at C:\Users\karen\.julia\packages\Atom\9h5Up\src\comm.jl:169 unknown function (ip: 00000000144AE923) jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2162 jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined] jl_f__apply at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\builtins.c:556 #31 at .\task.jl:259 unknown function (ip: 0000000001E126DA) jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2162 jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined] start_task at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\task.c:268 Allocations: 70192196 (Pool: 70176962; Big: 15234); GC: 150 </code></p>
<p dir="auto">Then Julia exits. I load the package again, then get the same errors...<br>
(All other commands not involving loading packages work as normal.)</p>
<p dir="auto">Again, I cannot think of what is causing this recurring problem. Previously, simply rebooting Atom or updating packages got rid of the error; that didn't work today but deleting/recompiling ~/.julia/registries/General has fixed it, at least for now.</p>
<p dir="auto">I realize that this report is quite vague / not generally reproducible, but any ideas on what could be the cause, and perhaps a permanent solution?</p>
<p dir="auto">Thank you!</p>