-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Task cannot be serialized
error during precompilation disappeared in 1.9
#49513
Comments
This seems to work on 1.10 with the precompilation system waiting on the task:
|
Now you know why we made that addition/change. |
Both 1.8 and 1.10 behavior is fine by me (with 1.10 being better of course). 1.9 behavior seems bad. |
👀 I tried adding some PkgImage precompilation to our main application (RAICode) at RAI, and I saw something very similar.
and just kept logging and logging for hours and never returns. 😢 I'm not following from the discussion above - do we know what the cause of this is? Is there a way to fix it? Do we have to wait for 1.10 to do precompilation with PkgImages? That would be 😭. |
🤔 okay on 1.10 i'm also seeing the same kind of log messages, but i have to say that these are mysterious and don't really help me understand what's happening:
Does this mean that the module is somehow pointing to a running Task object, and that's preventing the precompilation from shutting down? Or that some task(s) are still running, and precompile won't finish until they've all shut down? Is that something new in 1.9 or 1.10? |
... Okay so by attaching with LLDB and printing out those addresses, i was able to surmise that yes, this means there's a Task that's still running. It turns out our snoop script started up some background tasks for reporting out metrics and one of those was never shut down. Some thoughts:
|
But also also, i see that it's waiting on a
I also printed the cond variable's queue and there's nothing in there waiting... I tried collecting task backtraces, and the only things i see waiting are builtin tasks on profiling and distributed, and the main task which is waiting as part of ijl_write_compiler_output - presumably waiting for the background tasks to end? But there aren't any! thread (1) ++++ Task backtraces
thread (1) ==== Thread 1 created 4 live tasks
thread (1) ---- Root task (0x10a09c010)
thread (1) (sticky: 1, started: 1, state: 0, tid: 1)
thread (1) jl_swap_fiber at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:1346
thread (1) ctx_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:571
thread (1) ijl_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:650
thread (1) try_yieldto at ./task.jl:921
thread (1) wait at ./task.jl:995
thread (1) jfptr_wait_75012 at /Users/nathandaly/builds/julia-1.10+RAI/usr/lib/julia/sys.dylib (unknown line)
thread (1) _jl_invoke at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:0 [inlined]
thread (1) ijl_apply_generic at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:3074
thread (1) jl_task_wait_empty at /Users/nathandaly/builds/julia-1.10+RAI/src/partr.c:357
thread (1) ijl_write_compiler_output at /Users/nathandaly/builds/julia-1.10+RAI/src/precompile.c:78
thread (1) ijl_atexit_hook at /Users/nathandaly/builds/julia-1.10+RAI/src/init.c:251
thread (1) jl_repl_entrypoint at /Users/nathandaly/builds/julia-1.10+RAI/src/jlapi.c:732
thread (1) ---- End root task
thread (1) ---- Task 1 (0x10a09c4c0)
thread (1) (sticky: 0, started: 1, state: 0, tid: 0)
thread (1) jl_swap_fiber at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:1346
thread (1) ctx_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:571
thread (1) ijl_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:650
thread (1) try_yieldto at ./task.jl:921
thread (1) wait at ./task.jl:995
thread (1) #wait#645 at ./condition.jl:130
thread (1) wait at ./condition.jl:125 [inlined]
thread (1) _trywait at ./asyncevent.jl:138
thread (1) wait at ./asyncevent.jl:155 [inlined]
thread (1) profile_printing_listener at ./Base.jl:566
thread (1) #1055 at ./Base.jl:602
thread (1) jfptr_YY.1055_85336 at /Users/nathandaly/builds/julia-1.10+RAI/usr/lib/julia/sys.dylib (unknown line)
thread (1) _jl_invoke at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:0 [inlined]
thread (1) ijl_apply_generic at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:3074
thread (1) jl_apply at /Users/nathandaly/builds/julia-1.10+RAI/src/./julia.h:1981 [inlined]
thread (1) start_task at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:1238
thread (1) ---- End task 1
thread (1) ---- Task 2 (0x10b7387e0)
thread (1) (sticky: 0, started: 1, state: 0, tid: 0)
thread (1) jl_start_fiber_swap at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:1433
thread (1) ctx_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:617
thread (1) ijl_switch at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:650
thread (1) try_yieldto at ./task.jl:921
thread (1) wait at ./task.jl:995
thread (1) #wait#645 at ./condition.jl:130
thread (1) wait at ./condition.jl:125 [inlined]
thread (1) #138 at /Users/nathandaly/builds/julia-1.10+RAI/usr/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:281 [inlined]
thread (1) lock at ./lock.jl:229
thread (1) lock at ./condition.jl:78 [inlined]
thread (1) #137 at /Users/nathandaly/builds/julia-1.10+RAI/usr/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:279
thread (1) unknown function (ip: 0x151a28093)
thread (1) _jl_invoke at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:0 [inlined]
thread (1) ijl_apply_generic at /Users/nathandaly/builds/julia-1.10+RAI/src/gf.c:3074
thread (1) jl_apply at /Users/nathandaly/builds/julia-1.10+RAI/src/./julia.h:1981 [inlined]
thread (1) start_task at /Users/nathandaly/builds/julia-1.10+RAI/src/task.c:1238
thread (1) ---- End task 2
thread (1) ---- Task 3 (0x324675910)
thread (1) (sticky: 0, started: 1, state: 0, tid: 1)
thread (1) jl_rec_backtrace at /Users/nathandaly/builds/julia-1.10+RAI/src/stackwalk.c:876 [inlined]
thread (1) jlbacktracet at /Users/nathandaly/builds/julia-1.10+RAI/src/stackwalk.c:1148
thread (1) jl_print_task_backtraces at /Users/nathandaly/builds/julia-1.10+RAI/src/stackwalk.c:1216
thread (1) ---- End task 3
thread (1) ==== End thread 1
thread (1) ++++ Done Anything obvious that i'm doing wrong? thanks |
Oh, i am also only just noticing that the pointers for the timers are different in each log message. So does this mean something is creating Timers and then they're being invoked over and over? |
Addressed by #51895 |
Doing the following in the Downloads.jl package (JuliaLang/Downloads.jl#224):
Downloads.download("file://" * @__FILE__)
tosrc/Downloads.jl
causes the following on 1.8:
causing the precompilation to fail.
On 1.9 on the other hand, a precompile file is emitted but it segfaults when Julia tries to load it:
During the precompilation of Downloads there is also some debug output (on 1.9) that I don't know where it comes from:
The text was updated successfully, but these errors were encountered: