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

tests segfault on Windows, julia 1.6+ #484

Closed
visr opened this issue Dec 27, 2020 · 2 comments
Closed

tests segfault on Windows, julia 1.6+ #484

visr opened this issue Dec 27, 2020 · 2 comments

Comments

@visr
Copy link
Contributor

visr commented Dec 27, 2020

This came up originally in #476 (comment).

It happens when running the tests, at this point:

str = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'println(Example.hello("foo")); script_func()'`, String)

It happens everytime for me, also on this PR: JuliaLang/julia#39009 by @staticfloat.
This is the output I get (on that branch):

┌ Debug: instantiating project at "C:\\Users\\VISSER~1\\AppData\\Local\\Temp\\jl_aVzymA"
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:418
┌ Debug: running precompilation execution script...
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:210
ER~1\AppData\Local\Temp\jl_aVzymA' --compile=all '--trace-compile=C:\Users\VISSER~1\AppData\Local\Temp\jl_aGWflNt3Yk' 'C:\Users\visser_mn\.julia\dev\PackageCompiler\test\precompile
_execution.jl'`
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:185
┌ Debug: running `'C:\bin\julia\usr\bin\julia.exe' --color=yes --startup-file=no '--sysimage=C:\bin\julia\usr\lib\julia\sys.dll' '--project=C:\Users\VISSER~1\AppData\Local\Temp\jl_
aVzymA' -e 'import Example'`
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:194
┌ Debug: creating object file at C:\Users\VISSER~1\AppData\Local\Temp\jl_TpjYhzfx5p.o
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:300
[ Info: PackageCompiler: creating system image object file, this might take a while...
┌ Debug: running `'C:\bin\julia\usr\bin\julia.exe' --color=yes --startup-file=no --cpu-target=native '--sysimage=C:\bin\julia\usr\lib\julia\sys.dll' '--project=C:\Users\VISSER~1\Ap
pData\Local\Temp\jl_aVzymA' '--output-o=C:\Users\VISSER~1\AppData\Local\Temp\jl_TpjYhzfx5p.o' -e 'Base.reinit_stdio()
│ @eval Sys BINDIR = ccall(:jl_get_julia_bindir, Any, ())::String
│ @eval Sys STDLIB = "C:\\bin\\julia\\usr\\share\\julia\\stdlib\\v1.7"
│ Base.init_load_path()
│ if isdefined(Base, :init_active_project)
│     Base.init_active_project()
│ end
│ Base.init_depot_path()
│ import Example
│ # This @eval prevents symbols from being put into Main
│ @eval Module() begin
│     PrecompileStagingArea = Module()
│     for (_pkgid, _mod) in Base.loaded_modules
│         if !(_pkgid.name in ("Main", "Core", "Base"))
│             eval(PrecompileStagingArea, :(const $(Symbol(_mod)) = $_mod))
│         end
│     end
│     precompile_files = String[
│         "C:\\Users\\VISSER~1\\AppData\\Local\\Temp\\jl_aGWflNt3Yk"
│         "C:\\Users\\visser_mn\\.julia\\dev\\PackageCompiler\\test\\precompile_statements.jl"
│         "C:\\Users\\visser_mn\\.julia\\dev\\PackageCompiler\\test\\precompile_statements2.jl"
│     ]
│     for file in precompile_files, statement in eachline(file)
│         # println(statement)
│         # The compiler has problem caching signatures with \`Vararg{?, N}\`. Replacing
│         # N with a large number seems to work around it.
│         statement = replace(statement, r"Vararg{(.*?), N} where N" => s"Vararg{\1, 100}")
│         try
│             Base.include_string(PrecompileStagingArea, statement)
│         catch
│             # See julia issue #28808
│             @debug "failed to execute $statement"
│         end
│     end
│ end # module
│ include("C:\\Users\\VISSER~1\\AppData\\Local\\Temp\\jl_mHpJ6vz9Ho")
│ empty!(LOAD_PATH)
│ empty!(DEPOT_PATH)
│ '`
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:305
┌ Warning: using Pkg instead of using LazyArtifacts is deprecated
│   caller = ip:0x0
└ @ Core :-1
  Downloaded artifact: x86_64-w64-mingw32
┌ Debug: running `'C:\Users\VISSER~1\AppData\Local\Temp\jl_IOcNXt\artifacts\fdff308295487f361ef6e8dc2d27f5abe8a6eee9\mingw64\bin\gcc.exe' -m64 -march=x86-64 -shared '-LC:\bin\julia
\usr\bin' '-LC:\bin\julia\usr\bin' -o 'C:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll' -Wl,--whole-archive 'C:\Users\VISSER~1\AppData\Local\Temp\jl_TpjYhzfx5p.o' -Wl,--no-w
hole-archive -ljulia-internal -ljulia -Wl,--export-all-symbols`
└ @ PackageCompiler C:\Users\visser_mn\.julia\dev\PackageCompiler\src\PackageCompiler.jl:495

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6d3453ec -- jl_load_and_lookup at C:\bin\julia\usr\bin\libjulia.dll (unknown line)
in expression starting at none:0
jl_load_and_lookup at C:\bin\julia\usr\bin\libjulia.dll (unknown line)
nthreads at .\threadingconstructs.jl:19 [inlined]
__preinit_threads__ at .\task.jl:563
jfptr___preinit_threads___35264 at C:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll (unknown line)
jl_apply at /cygdrive/c/bin/julia/src\julia.h:1708 [inlined]
_julia_init at /cygdrive/c/bin/julia/src\init.c:774
repl_entrypoint at /cygdrive/c/bin/julia/src\jlapi.c:693
mainCRTStartup at /cygdrive/c/bin/julia/cli\loader_exe.c:51
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 2657 (Pool: 2647; Big: 10); GC: 0

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6d3453ec -- jl_load_and_lookup at C:\bin\julia\usr\bin\libjulia.dll (unknown line)
in expression starting at none:0
jl_load_and_lookup at C:\bin\julia\usr\bin\libjulia.dll (unknown line)
jlplt_jl_array_del_beg_8390 at C:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll (unknown line)
_deletebeg! at .\array.jl:877 [inlined]
popfirst! at .\array.jl:1281 [inlined]
_atexit at .\initdefs.jl:341
jfptr__atexit_23249 at C:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll (unknown line)
jl_apply at /cygdrive/c/bin/julia/src\julia.h:1708 [inlined]
jl_atexit_hook at /cygdrive/c/bin/julia/src\init.c:223
jl_exit at /cygdrive/c/bin/julia/src\jl_uv.c:632
jl_exception_handler at /cygdrive/c/bin/julia/src\signals-win.c:318
__julia_personality at /cygdrive/c/bin/julia/src/support\win32_ucontext.c:28
_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_load_ at C:\bin\julia\usr\bin\libjulia.dll (unknown line)
nthreads at .\threadingconstructs.jl:19 [inlined]
__preinit_threads__ at .\task.jl:563
jfptr___preinit_threads___35264 at C:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll (unknown line)
jl_apply at /cygdrive/c/bin/julia/src\julia.h:1708 [inlined]
_julia_init at /cygdrive/c/bin/julia/src\init.c:774
repl_entrypoint at /cygdrive/c/bin/julia/src\jlapi.c:693
mainCRTStartup at /cygdrive/c/bin/julia/cli\loader_exe.c:51
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 2657 (Pool: 2647; Big: 10); GC: 0
PackageCompiler.jl: Error During Test at C:\Users\visser_mn\.julia\dev\PackageCompiler\test\runtests.jl:21
  Got exception outside of a @test
  failed process: Process(`'C:\bin\julia\usr\bin\julia.exe' -Cnative '-JC:\bin\julia\usr\lib\julia\sys.dll' --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no -J 'C
:\Users\VISSER~1\AppData\Local\Temp\jl_k9XAON\sys.dll' -e 'println(Example.hello("foo")); script_func()'`, ProcessExited(1)) [1]

  Stacktrace:
    [1] pipeline_error
      @ .\process.jl:525 [inlined]
    [2] read(cmd::Cmd)
      @ Base .\process.jl:412
    [3] read(cmd::Cmd, #unused#::Type{String})
      @ Base .\process.jl:421
    [4] macro expansion
      @ ~\.julia\dev\PackageCompiler\test\runtests.jl:41 [inlined]
    [5] macro expansion
      @ C:\bin\julia\usr\share\julia\stdlib\v1.7\Test\src\Test.jl:1148 [inlined]
    [6] top-level scope
      @ ~\.julia\dev\PackageCompiler\test\runtests.jl:22
    [7] include(fname::String)
      @ Base.MainInclude .\client.jl:451
    [8] top-level scope
      @ none:6
    [9] eval(m::Module, e::Any)
      @ Core .\boot.jl:369
   [10] exec_options(opts::Base.JLOptions)
      @ Base .\client.jl:268
   [11] _start()
      @ Base .\client.jl:492
Test Summary:      | Error  Total
PackageCompiler.jl |     1      1
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at C:\Users\visser_mn\.julia\dev\PackageCompiler\test\runtests.jl:21
ERROR: Package PackageCompiler errored during testing
@visr
Copy link
Contributor Author

visr commented Dec 31, 2020

I tried this again after JuliaLang/julia#39052, and with that all tests pass on Windows.

@visr visr closed this as completed Dec 31, 2020
@staticfloat
Copy link
Member

Ah, great! Thanks for the test Martjin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants