LanguageServer.jl icon indicating copy to clipboard operation
LanguageServer.jl copied to clipboard

Segfault when loading `PythonCall`

Open josephsdavid opened this issue 3 years ago • 5 comments

I am working on a project where I need to use pythoncall, which seems to segfault the language server, causing it to not index any other nonlocal packages. Is there a way to work around this? Perhaps to ignore a certain package, so at least the other packages are indexed? Attached is some relevant info:

  • Client: Neovim 0.7 (latest stable release)
  • languageserver versions:
LanguageServer = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7"
StaticLint = "b3cc710f-9c33-5bdb-a03d-a94903873e97"
SymbolServer = "cf896787-08d5-524d-9de7-132aaa0cb996"
julia_version = "1.7.2"

  • Error when indexing python call (truncated)
    message = '[ ...
[ Info: Will cache package PythonCall (6099a3de-0909-46bc-b1f4-468b9a2dfc0d)

signal (11): Segmentation fault: 11
in expression starting at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/server.jl:94
function_code_fastcall at /Users/djosephs/secretdirectory/project.jl/.CondaPkg/env/lib/libpython3.9.dylib (unknown line)
PyObject_CallObject at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/cpython/pointers.jl:297 [inlined]
macro expansion at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/Py.jl:131 [inlined]
pycallargs at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/abstract/object.jl:153 [inlined]
#pycall#57 at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/abstract/object.jl:171
pycall at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/abstract/object.jl:161 [inlined]
#_#11 at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/Py.jl:360 [inlined]
Py at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/Py.jl:360 [inlined]
getdoc at /Users/djosephs/.julia/packages/PythonCall/XgP8G/src/Py.jl:460
getdoc at ./docs/Docs.jl:271
_doc at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/utils.jl:186
#symbols#22 at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/symbols.jl:458
symbols##kw at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/symbols.jl:404 [inlined]
#symbols#22 at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/symbols.jl:463
symbols at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/symbols.jl:404
jl_apply_generic at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
top-level scope at /Users/djosephs/.julia/packages/SymbolServer/0mFCc/src/server.jl:117
jl_toplevel_eval_flex at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_in at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
eval at ./boot.jl:373 [inlined]
include_string at ./loading.jl:1196
jl_apply_generic at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
_include at ./loading.jl:1253
include at ./Base.jl:418
jl_apply_generic at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
exec_options at ./client.jl:292
_start at ./client.jl:495
jfptr__start_41570 at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
true_main at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_repl_entrypoint at /Users/djosephs/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia-internal.1.7.dylib (unknown line)
Allocations: 48556296 (Pool: 48541985; Big: 14311); GC: 60

josephsdavid avatar Apr 18 '22 04:04 josephsdavid

I am new to julia and to julia open source etc, so any way I can help with diagnostics/making a clearer issue I am happy to do, for more info, in other projects where I am NOT using pythoncall, the language server works just fine! I am running it with the defaults described here

josephsdavid avatar Apr 18 '22 04:04 josephsdavid

Hm, this shouldn't actually crash the LS, Will try to repro.

pfitzseb avatar Apr 19 '22 13:04 pfitzseb

Thank you! Here is the dependencies/compat for the project:

[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
Legolas = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd"
Lighthouse = "ac2c24cd-07f0-4848-96b2-1b82c3ea0e59"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
CairoMakie = "0.7.0"
Legolas = "0.3.0"
Lighthouse = "0.14.0"
PythonCall = "0.8.0"
julia = "1.6"

And if you need the contents of the CondaPkg.toml file I can share as well (I doubt the julia lsp indexes that :) )

josephsdavid avatar Apr 19 '22 15:04 josephsdavid

Hmm so I was able to resolve this issue actually just with a setting change, for others who may bump into this issue, here is my current config:

	julials = {
		settings = {
			julia = {
				symbolCacheDownload = false,
				lint = {
					missingrefs = "all",
					iter = true,
					lazy = true,
					modname = true,
				},
			},
		},
	},

It doesn't manage to index PythonCall, but all the other libraries in there it manages to index now, without a segfault!

josephsdavid avatar May 02 '22 19:05 josephsdavid

Glad that works for you. I'll reopen this so we don't forget about it -- something is wrong after all.

pfitzseb avatar May 02 '22 20:05 pfitzseb