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

Profiling running tasks can crash due to unloadable Profile stdlib #49413

Closed
maleadt opened this issue Apr 19, 2023 · 2 comments · Fixed by #49429
Closed

Profiling running tasks can crash due to unloadable Profile stdlib #49413

maleadt opened this issue Apr 19, 2023 · 2 comments · Fixed by #49429

Comments

@maleadt
Copy link
Member

maleadt commented Apr 19, 2023

PkgEval is now sending SIGUSR1 to hung/timed-out tests to get some additional information (#43179), however it seems that a well timed signal and arrives during some Pkg oepration can result in a crash of the profile listener. For example, https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/1c6271f/Braket.primary.log:

======================================================================================
Information request received. A stacktrace will print followed by a 1.0 second profile
======================================================================================

cmd: /opt/julia/bin/julia 1 running 0 of 1

signal (10): User defined signal 1
epoll_wait at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
uv__io_poll at /workspace/srcdir/libuv/src/unix/epoll.c:236
uv_run at /workspace/srcdir/libuv/src/unix/core.c:400
ijl_task_get_next at /source/src/partr.c:411
poptask at ./task.jl:974
wait at ./task.jl:983
#wait#628 at ./condition.jl:130
wait at ./condition.jl:125 [inlined]
wait at ./process.jl:661
jfptr_wait_51611.1 at /opt/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
subprocess_handler at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2025
#130 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1970
withenv at ./env.jl:235
#117 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1818
with_temp_env at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1692
#115 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1781
#mktempdir#24 at ./file.jl:764
unknown function (ip: 0x7f66c497db2d)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
mktempdir at ./file.jl:760
mktempdir at ./file.jl:760 [inlined]
#sandbox#114 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1739
sandbox at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1730
unknown function (ip: 0x7f66c497672a)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
#test#127 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1949
test at /source/usr/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1893 [inlined]
#test#146 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:441
test at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:420
unknown function (ip: 0x7f66c497628d)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
#test#77 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:156
unknown function (ip: 0x7f66c4975ca6)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
test at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:145
#test#75 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:144 [inlined]
test at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:144 [inlined]
#test#74 at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:143 [inlined]
test at /source/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:143
unknown function (ip: 0x7f66c4972822)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
jl_apply at /source/src/julia.h:1879 [inlined]
do_call at /source/src/interpreter.c:125
eval_value at /source/src/interpreter.c:222
eval_stmt_value at /source/src/interpreter.c:173 [inlined]
eval_body at /source/src/interpreter.c:620
eval_body at /source/src/interpreter.c:529
eval_body at /source/src/interpreter.c:529
jl_interpret_toplevel_thunk at /source/src/interpreter.c:760
jl_toplevel_eval_flex at /source/src/toplevel.c:911
jl_toplevel_eval_flex at /source/src/toplevel.c:854
ijl_toplevel_eval_in at /source/src/toplevel.c:970
eval at ./boot.jl:370 [inlined]
include_string at ./loading.jl:1906
include_string at ./loading.jl:1916 [inlined]
include_string at ./loading.jl:1916
unknown function (ip: 0x7f66c49341d6)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
jl_apply at /source/src/julia.h:1879 [inlined]
do_call at /source/src/interpreter.c:125
eval_value at /source/src/interpreter.c:222
eval_stmt_value at /source/src/interpreter.c:173 [inlined]
eval_body at /source/src/interpreter.c:620
jl_interpret_toplevel_thunk at /source/src/interpreter.c:760
jl_toplevel_eval_flex at /source/src/toplevel.c:911
jl_toplevel_eval_flex at /source/src/toplevel.c:854
ijl_toplevel_eval_in at /source/src/toplevel.c:970
eval at ./boot.jl:370 [inlined]
exec_options at ./client.jl:280
_start at ./client.jl:541
jfptr__start_57634.1 at /opt/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /source/src/gf.c:2864 [inlined]
ijl_apply_generic at /source/src/gf.c:3046
jl_apply at /source/src/julia.h:1879 [inlined]
true_main at /source/src/jlapi.c:577
jl_repl_entrypoint at /source/src/jlapi.c:729
main at /source/cli/loader_exe.c:58
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x401098)
unknown function (ip: (nil))

==============================================================
Profile collected. A report will print at the next yield point
==============================================================

┌ Error: Profile printing listener crashed
│   exception =
│    ArgumentError: Package Profile not found in current path.
│    - Run `import Pkg; Pkg.add("Profile")` to install the Profile package.
│    Stacktrace:
│     [1] macro expansion
│       @ ./loading.jl:1623 [inlined]
│     [2] macro expansion
│       @ ./lock.jl:267 [inlined]
│     [3] require(into::Module, mod::Symbol)
│       @ Base ./loading.jl:1604
│     [4] profile_printing_listener()
│       @ Base ./Base.jl:142
│     [5] (::Base.var"#1028#1029")()
│       @ Base ./threadingconstructs.jl:373
└ @ Base Base.jl:572

Feel free to close if this is expected.

cc @IanButterworth

@IanButterworth
Copy link
Member

Yeah if the stdlibs aren't in the path at that time it will fail. Not sure what to do

@KristofferC
Copy link
Member

This:

profile = @something(profile, require(Base, :Profile))

could at least be changed to have a full PkgId (like it is done for other stdlibs that gets loaded in Base).

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 a pull request may close this issue.

3 participants