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

Fix empty sysimage test on 1.5.3. Fix app test on nightly #476

Merged
merged 4 commits into from
Dec 27, 2020

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Dec 11, 2020

Tidied up summary:

  • On 1.5.3 temp_cleanup_purge was failing to compile at exit during generation of a blank sysimage, so this clears the _atexit activites during the sysimage generation subprocess. This is more of a bandaid than a fix. I couldn't figure out why it was failing

  • The checked-in Manifest for the test app was causing stdlib jll problems, so the Manifest has been deleted and an instantiate step has been added to create_app. On nightly ubuntu a deadlock was occurring when autoprecomp was enabled after instantiate, but not on macos. I couldn't figure out why, but I disabled autoprecomp

A windows failure remains during the first app test. I have no clues on that one (apart from it appearing to be another _atexit-related issue)

@codecov-io
Copy link

codecov-io commented Dec 11, 2020

Codecov Report

Merging #476 (fec20d4) into master (6bce25d) will increase coverage by 4.70%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #476      +/-   ##
==========================================
+ Coverage   77.98%   82.69%   +4.70%     
==========================================
  Files           2        2              
  Lines         368      393      +25     
==========================================
+ Hits          287      325      +38     
+ Misses         81       68      -13     
Impacted Files Coverage Δ
src/PackageCompiler.jl 82.05% <75.00%> (+3.86%) ⬆️
src/juliaconfig.jl 88.09% <0.00%> (+11.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bce25d...fec20d4. Read the comment docs.

@IanButterworth
Copy link
Member Author

IanButterworth commented Dec 11, 2020

On 1.5.3, the final empty sysimage test fails (which doesn't fail on 1.5.2 or nightly)

julia> tmp = mktempdir()
julia> sysimage_path = joinpath(tmp, "empty." * Libdl.dlext)
julia> foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"])
julia> create_sysimage(; sysimage_path=sysimage_path, incremental=false, filter_stdlibs=true, project=tmp)
[ Info: PackageCompiler: creating base system image (incremental=false)...
┌ Debug: running `/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia --color=yes --startup-file=no --cpu-target native --output-ji /var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_IEd1J2/corecompiler.ji -g0 -O0 /Applications/Julia-1.5.app/Contents/Resources/julia/bin/../share/julia/base/compiler/compiler.jl`
└ @ PackageCompiler ~/Documents/GitHub/PackageCompiler.jl/src/PackageCompiler.jl:153
┌ Debug: running `/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia --color=yes --startup-file=no --cpu-target native --sysimage=/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_IEd1J2/corecompiler.ji -g1 -O0 --output-ji=/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_IEd1J2/sys.ji /var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_IEd1J2/sysimage_packagecompiler_673d25e2-3b6c-11eb-2be4-41dc7f7fed91.jl`
└ @ PackageCompiler ~/Documents/GitHub/PackageCompiler.jl/src/PackageCompiler.jl:164
FATAL ERROR: Symbol "ccall_jl_safe_printf_44698"not found
signal (6): Abort trap: 6
in expression starting at none:0
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)

not filtering stdlibs succeeds

julia> create_sysimage(; sysimage_path=sysimage_path, incremental=false, filter_stdlibs=false, project=tmp)
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...

@IanButterworth IanButterworth changed the title WIP: Trying to fix app artifact tests Fix empty sysimage test on 1.5.3. Fix app test on nightly Dec 13, 2020
@IanButterworth IanButterworth marked this pull request as ready for review December 13, 2020 04:17
@visr
Copy link
Contributor

visr commented Dec 16, 2020

A windows failure remains during the first app test. I have no clues on that one (apart from it appearing to be another _atexit-related issue)

Not much help, but looking at the two segfaults reported in Windows nightly CI at https://github.com/JuliaLang/PackageCompiler.jl/pull/476/checks?check_run_id=1544435610, they both crash in jl_load_and_lookup, and only one has _atexit in the stacktrace.

Exception: EXCEPTION_ACCESS_VIOLATION at 0x68f8524e -- jl_load_and_lookup at C:\hostedtoolcache\windows\julia\nightly\x64\bin\libjulia.dll (unknown line)
in expression starting at none:0
jl_load_and_lookup at C:\hostedtoolcache\windows\julia\nightly\x64\bin\libjulia.dll (unknown line)
nthreads at .\threadingconstructs.jl:19 [inlined]
__preinit_threads__ at .\task.jl:563
jfptr___preinit_threads___19483 at C:\Users\RUNNER~1\AppData\Local\Temp\jl_YfCVsn\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1701 [inlined]
_julia_init at /cygdrive/c/buildbot/worker/package_win64/build/src\init.c:770
repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:682
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:51
BaseThreadInitThunk at C:\windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 2651 (Pool: 2641; Big: 10); GC: 0

Could this be related to changes made at JuliaLang/julia#36588 or followup JuliaLang/julia#38160? That is new on 1.6, deals with loading, and has some Windows specific code. Perhaps @staticfloat can tell. Some linking updates were already done in #471.

@staticfloat
Copy link
Member

It might be related. It depends on what library it's trying to load. Is there a way to either instrument the build or catch it in gdb or somesuch to figure out what it's trying to load?

@@ -1,70 +0,0 @@
# This file is machine-generated - editing it directly is not advised
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removed because it wasn't compatible between julia versions?

@visr
Copy link
Contributor

visr commented Dec 22, 2020

I'm not sure how to find it out. It is using a custom system image created before that in the test, that holds Example.jl. Couldn't get it to work on a debug build. Did get this, but it doesn't give much extra information:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000068f853f8 in jl_load_and_lookup () from C:\bin\julia-1.7\bin\libjulia.dll
(gdb) bt
#0  0x0000000068f853f8 in jl_load_and_lookup () from C:\bin\julia-1.7\bin\libjulia.dll
#1  0x000000000eca7ab4 in nthreads () at threadingconstructs.jl:19
#2  julia___preinit_threads___34049 () at task.jl:563
#3  0x000000000eca7d0f in jfptr___preinit_threads___34050 () from c:\tmp\PkgCompiler\debug\sysimage\sys.dll
#4  0x00000000027c1c57 in jl_apply (nargs=1, args=0xc3fd60) at /cygdrive/c/buildbot/worker/package_win64/build/src/julia.h:1707
#5  _julia_init (rel=JL_IMAGE_CWD) at /cygdrive/c/buildbot/worker/package_win64/build/src/init.c:770
#6  0x00000000027c2845 in julia_init__threading (rel=<optimized out>) at /cygdrive/c/buildbot/worker/package_win64/build/src/task.c:317
#7  0x00000000027ff35a in repl_entrypoint (argc=<optimized out>, argv=<optimized out>) at /cygdrive/c/buildbot/worker/package_win64/build/src/jlapi.c:693
#8  0x0000000000401a64 in mainCRTStartup () at /cygdrive/c/buildbot/worker/package_win64/build/cli/loader_exe.c:51
(gdb)

@staticfloat
Copy link
Member

We just merged a PR that changes some areas of this on Windows; can you try again and see if the latest nightly still has issues here?

@visr
Copy link
Contributor

visr commented Dec 26, 2020

I still see the same failure on the latest nightly:

Julia Version 1.7.0-DEV.168
Commit dedf290c99 (2020-12-25 20:12 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.0 (ORCJIT, skylake)

@staticfloat
Copy link
Member

@visr can you try with JuliaLang/julia#39009

@KristofferC
Copy link
Member

Merging this as a improvement.

@KristofferC KristofferC merged commit e408e64 into JuliaLang:master Dec 27, 2020
@visr
Copy link
Contributor

visr commented Dec 27, 2020

@staticfloat unfortunately that PR doesn't resolve this issue:

Version 1.7.0-DEV.172 (2020-12-27)
sf/dlopen_libjulia/176a6e6a4a (fork: 2 commits, 0 days)

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

@staticfloat
Copy link
Member

Can you open a new issue with steps on how to reproduce that? Thanks!

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

Successfully merging this pull request may close these issues.

5 participants