Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in Profiler.print on windows #29924

Closed
atbug opened this issue Nov 4, 2018 · 9 comments
Closed

Crash in Profiler.print on windows #29924

atbug opened this issue Nov 4, 2018 · 9 comments
Assignees
Labels
system:windows Affects only Windows

Comments

@atbug
Copy link

atbug commented Nov 4, 2018

The following script kills julia on windows

using LinearAlgebra, Profile

function getreducedH(t; α, β, g)
    σx = [0.0 1.0; 1.0 0.0]
    σy = [0.0 -im; im 0.0]
    σz = [1.0 0.0; 0.0 -1.0]
    return α*(cos(t)*σy+sin(t)*σx)+β*(cos(t)*σx+sin(t)*σy)-g*σz/4
end

function getA(H, t0, t1; N=100)
    A = Matrix{ComplexF64}(I, 2, 2)
    dt = (t1-t0)/N
    for it = 1:N
        t = t0+(it-1)*dt
        A = exp(-im*H(t)*dt)*A
    end
    return A
end

function getclosesteig(A, egval)
    egvals, egvecs = eigen(A)
    return (egvals[1], egvecs[:, 1])
end

function getBerry()
    r = 0.1
    gbar = 2+4*√2
    αbar = 2
    θs = 0.0:0.01:2π
    (e, u0) = getclosesteig(getA(t->getreducedH(t, α=αbar+r*sin(θs[1]), β=r*cos(θs[1]), g=gbar), 0.0, 2π), 0.0)
    u1 = u0
    for θ = θs
        e, u = getclosesteig(getA(t->getreducedH(t, α=αbar+r*sin(θ), β=r*cos(θ), g=gbar), 0.0, 2π), e)
        u1 = u*(uu1)
    end
    return (u1./u0)
end

getBerry()
@profile getBerry()
Profile.print(format=:flat, sortedby=:count)

The error message is

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (i
n their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x43a2e1c9a -- gc_try_setmark at /home/Administrator/buildb
ot/worker/package_win64/build/src\gc.c:1425 [inlined]
gc_mark_loop at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:1869
in expression starting at D:\Workspace\NoTB.jl\drawboard.jl:41
gc_try_setmark at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:1422 [inlined]
gc_mark_loop at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:1869
_jl_gc_collect at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:2468
jl_gc_collect at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:2633
jl_gc_pool_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:954 [inlined]
jl_gc_alloc_ at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:274 [in
lined]
jl_gc_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:2668
_new_array_ at /home/Administrator/buildbot/worker/package_win64/build/src\array.c:100 [inlined]
_new_array at /home/Administrator/buildbot/worker/package_win64/build/src\array.c:158 [inlined]
jl_alloc_array_1d at /home/Administrator/buildbot/worker/package_win64/build/src\array.c:418
Type at .\boot.jl:394 [inlined]
Type at .\boot.jl:408 [inlined]
Type at .\compiler/ssair\ir.jl:470
compact! at .\compiler/ssair\ir.jl:1024
run_passes at .\compiler/ssair\driver.jl:121
optimize at .\compiler\optimize.jl:162
typeinf at .\compiler\typeinfer.jl:35
abstract_call_method_with_const_args at .\compiler\abstractinterpretation.jl:202
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:102
abstract_call at .\compiler\abstractinterpretation.jl:790
abstract_eval_call at .\compiler\abstractinterpretation.jl:819
abstract_eval at .\compiler\abstractinterpretation.jl:904
typeinf_local at .\compiler\abstractinterpretation.jl:1128
typeinf_nocycle at .\compiler\abstractinterpretation.jl:1184
typeinf at .\compiler\typeinfer.jl:15
typeinf_ext at .\compiler\typeinfer.jl:567
typeinf_ext at .\compiler\typeinfer.jl:604
jfptr_typeinf_ext_1.clone_1 at C:\Users\wangc\AppData\Local\Julia-1.0.1\lib\julia\sys.dll (unknown l
ine)
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
jl_apply_with_saved_exception_state at /home/Administrator/buildbot/worker/package_win64/build/src\r
tutils.c:257
jl_type_infer at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:275
jl_compile_method_internal at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1786
[inlined]
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1830
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
run_finalizer at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:115
jl_gc_run_finalizers_in_list at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:210
jl_gc_run_all_finalizers at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:245
jl_atexit_hook at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/bui
ldbot/worker/package_win64/build/src\init.c:260
jl_exit at /home/Administrator/buildbot/worker/package_win64/build/src\jl_uv.c:604
__julia_personality at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrato
r/buildbot/worker/package_win64/build/src\signals-win.c:297
_chkstk at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
RtlWalkFrameChain at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
KiUserExceptionDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
jl_typemap_entry_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\typemap.
c:125
jl_typemap_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal
.h:883 [inlined]
jl_typemap_level_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\typemap.
c:833
jl_typemap_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal
.h:886 [inlined]
jl_typemap_level_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\typemap.
c:833
jl_typemap_assoc_exact at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal
.h:886 [inlined]
jl_lookup_generic_ at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2135 [inlined
]
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2181
lookup at .\stacktraces.jl:114
lookup at .\stacktraces.jl:119 [inlined]
#6 at .\none:0
iterate at .\generator.jl:47 [inlined]
Type at .\dict.jl:104
getdict at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.0\Profile\src\Profile.jl:182 [inlined]
#print at .\none:0 [inlined]
#print at .\none:0
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:324
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:430
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:363 [in
lined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:678
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\
interpreter.c:795
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 0000000004B2D0EF)
unknown function (ip: 0000000000000006)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:813
jl_parse_eval_all at /home/Administrator/buildbot/worker/package_win64/build/src\ast.c:838
include_string at .\loading.jl:1005
#124 at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:125
withpath at C:\Users\wangc\.julia\packages\CodeTools\hB4Hy\src\utils.jl:30
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184 [inlined]
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
jl_invoke at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:56
withpath at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:46 [inlined]
#123 at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:122 [inlined]
with_logstate at .\logging.jl:397
with_logger at .\logging.jl:493 [inlined]
#122 at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:121 [inlined]
hideprompt at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\repl.jl:85
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
macro expansion at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:120 [inlined]
macro expansion at C:\Users\wangc\.julia\packages\Media\ItEPc\src\dynamic.jl:24 [inlined]
#121 at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\eval.jl:109
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
handlemsg at C:\Users\wangc\.julia\packages\Atom\v2iqN\src\comm.jl:164
unknown function (ip: 000000000A6E267C)
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
jl_f__apply at /home/Administrator/buildbot/worker/package_win64/build/src\builtins.c:556
#19 at .\task.jl:259
unknown function (ip: 000000000A6D86AE)
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
start_task at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:268
Allocations: 51854932 (Pool: 51846553; Big: 8379); GC: 121
julia> versioninfo()
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "C:\Users\wangc\AppData\Local\atom\app-1.32.1\atom.exe" -a
  JULIA_NUM_THREADS = 2

This is not always reproducible, but can be triggered easily but running it several times.

@andreasnoack
Copy link
Member

Probably dup of #28648

@andreasnoack
Copy link
Member

Closing as dup. Please comment if this is still an issue.

@atbug
Copy link
Author

atbug commented Jan 15, 2019

I think I can reproduce this on 1.1.0-rc2 official build.

julia> versioninfo()
Julia Version 1.1.0-rc2.0
Commit 980eda064e (2019-01-13 00:19 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

@andreasnoack andreasnoack reopened this Jan 15, 2019
@andreasnoack
Copy link
Member

What if you launch Julia with --cpu-target=nehalem?

@atbug
Copy link
Author

atbug commented Jan 15, 2019

What if you launch Julia with --cpu-target=nehalem?

Indeed this solves the problem, not sure why though.

@andreasnoack
Copy link
Member

@vtjnash It looks like this might not be completely fixed by #30369. Anything that @Mistguy can do to help debug this?

@atbug
Copy link
Author

atbug commented May 3, 2020

Still reproducible on julia-1.4.1

@ViralBShah ViralBShah added the system:windows Affects only Windows label Feb 25, 2022
@ViralBShah
Copy link
Member

Doesn't crash for me on mac. Can we close this if someone can try it out on windows?

@vtjnash vtjnash closed this as completed Feb 25, 2022
@vtjnash
Copy link
Member

vtjnash commented Feb 25, 2022

Does seem like we have been able to reproduce ourselves, but might be fixed by #43570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

4 participants