google / swift-jupyter

Apache License 2.0
618 stars 90 forks source link

Assertion `isInt<32>(RealOffset)' failed #123

Open marcrasi opened 3 years ago

marcrasi commented 3 years ago

This used to be https://bugs.swift.org/browse/TF-747, but I'm moving the issue here and adding more details.

It's flaky and hard to reproduce, but here are the kinds of things you need to try:

If you trigger it, the kernel will crash and this will print out on the terminal:

/swift-base/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:307: void llvm::RuntimeDyldELF::resolveX86_64Relocation(const llvm::SectionEntry &, uint64_t, uint64_t, uint32_t, int64_t, uint64_t): Assertion `isInt<32>(RealOffset)' failed.

Our guess at the reason and how to fix:

If you load up too many shared libraries in jupyter then most of the address space gets used and the memory manager starts giving you pieces of memory that are too far apart for the relocation, causing this error. The only real fix we can think of is migrating LLDB to use orcjit, which Saleem thinks is O(months) of work.

PythonKit + TensorFlow is "too much" for the purposes of this problem, so notebooks using both are going to be flaky.