Skip to content

Re-compiled the file engines - #241

Merged
cometsong merged 2 commits into
vim-ctrlspace:masterfrom
lemeb:master
Nov 4, 2019
Merged

Re-compiled the file engines#241
cometsong merged 2 commits into
vim-ctrlspace:masterfrom
lemeb:master

Conversation

@lemeb

@lemeb lemeb commented Oct 5, 2019

Copy link
Copy Markdown
Contributor

tl;dr: The file engine binary was failing on macOS 10.15, and the outdated version of the Go compiler was a likely culprit: the recompiled binaries are in this PR, as well as binaries for MIPS architectures.

Hi everyone, hi @cometsong,

Nice work doing this extension! :D

As soon as I installed CtrlSpace though, it started to dysfunction when I wanted to look at the file list. After digging a little, I realized that the file_engine that was in the binary folder was crashing over and over again. See the enclosed error messages for more detail.

After looking around at what the error messages meant, it dawned on me that the version of Go that was used to compile the engine — 1.5.1, per the error messages — was severely outdated: I could go nowhere if I didn't recompile the engine to a newer version first.

And so I did, and now the engine works as intended! I'm surmising that the newest versions of macOS that have shipped in the mean time — I am running Catalina — have made some Go programs nonoperational.

Anyway, here are the two following pull requests:

  • file_engine_binaries (File engine binaries #240): I recompiled file_engine.go with go 1.13, and with the newest stable version of gox. This yielded a few more binaries than usual, notably Linux computers running on MIPS chips. I included them in addition to the recompiled binaries.
  • master (this PR): the four main binaries are recompiled with the newest go toolchain, and I adjusted the documentation to account for the new MIPS binaries.

Error Messages

In both cases, I went around the error messages inside vim by manually doing the work of this line in engine.vim:

let results  = split(system(s:config.FileEngine, context), "\n")

So I generated the context string, and passed it to the file_engine binary. Here are the two results I was getting over and over again.

$ ./file_engine_darwin_amd64_as_shipped_currently
{"Query":"","Columns":89,"Limit":0,"Source":"/Users/l/software/react-blank-slate/.git/cs_files","Dots":"…","DotsSize":1}
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0xb01dfacedebac1e pc=0x20af9]

runtime stack:
runtime.throw(0x1731e0, 0x2a)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:527 +0x90
runtime.sigpanic()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/sigpanic_unix.go:12 +0x5a
runtime.(*gcWork).put(0xc82001f220, 0xc8204db030)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mgcwork.go:87 +0x49
runtime.greyobject(0xc8204db030, 0x0, 0x0, 0xc81ffd927e, 0x2, 0x44b628, 0xc82001f220)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mgcmark.go:956 +0x2f1
runtime.shade(0xc8204db030)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mgcmark.go:894 +0x9a
runtime.gcmarkwb_m(0xc820414598, 0xc8204db030)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mbarrier.go:91 +0xc1
runtime.writebarrierptr_nostore1.func1()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mbarrier.go:117 +0x134
runtime.systemstack(0xc82001e000)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:262 +0x79
runtime.mstart()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc1.go:674

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:216 fp=0xc8200499e8 sp=0xc8200499e0
runtime.writebarrierptr_nostore1(0xc820414598, 0xc8204db030)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mbarrier.go:118 +0x71 fp=0xc820049a20 sp=0xc8200499e8
runtime.writebarrierptr(0xc820414598, 0xc8204db030)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mbarrier.go:137 +0x4b fp=0xc820049a50 sp=0xc820049a20
main.(*ItemCollection).Init(0x1fe080, 0x0, 0x0)
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:166 +0x4ae fp=0xc820049bf0 sp=0xc820049a50
main.Init(0xc820036008, 0x0, 0x0)
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:260 +0x27c fp=0xc820049db0 sp=0xc820049bf0
main.main()
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:333 +0x44 fp=0xc820049f50 sp=0xc820049db0
runtime.main()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc.go:111 +0x2b0 fp=0xc820049fa0 sp=0xc820049f50
runtime.goexit()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc820049fa8 sp=0xc820049fa0
$ ./file_engine_darwin_amd64_as_shipped_currently
{"Query":"","Columns":89,"Limit":0,"Source":"/Users/l/software/react-blank-slate/.git/cs_files","Dots":"…","DotsSize":1}
fatal error: still in list

runtime stack:
runtime.throw(0x14d910, 0xd)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:527 +0x90
runtime.mHeap_AllocSpanLocked(0x2054c0, 0x1, 0x44ba00)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mheap.go:590 +0x40c
runtime.mHeap_Alloc_m(0x2054c0, 0x1, 0xc, 0x4b924)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mheap.go:425 +0x1ac
runtime.mHeap_Alloc.func1()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mheap.go:484 +0x41
runtime.systemstack(0xc820073e50)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:278 +0xab
runtime.mHeap_Alloc(0x2054c0, 0x1, 0x1000000000c, 0x105ef)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mheap.go:485 +0x63
runtime.mCentral_Grow(0x20d688, 0x0)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mcentral.go:190 +0x93
runtime.mCentral_CacheSpan(0x20d688, 0x0)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mcentral.go:86 +0x4d4
runtime.mCache_Refill(0x2504b8, 0xc, 0xc8204e20e8)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/mcache.go:118 +0xcf
runtime.mallocgc.func2()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/malloc.go:611 +0x2b
runtime.systemstack(0xc820020a00)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:262 +0x79
runtime.mstart()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc1.go:674

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:216 fp=0xc8200498d8 sp=0xc8200498d0
runtime.mallocgc(0xb0, 0x0, 0x3, 0x0)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/malloc.go:612 +0x842 fp=0xc8200499a8 sp=0xc8200498d8
runtime.rawruneslice(0x29, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/string.go:297 +0xec fp=0xc8200499f8 sp=0xc8200499a8
runtime.stringtoslicerune(0x0, 0xc8204fe028, 0x0, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/string.go:169 +0x1c7 fp=0xc820049a50 sp=0xc8200499f8
main.(*ItemCollection).Init(0x1fe080, 0x0, 0x0)
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:164 +0x321 fp=0xc820049bf0 sp=0xc820049a50
main.Init(0xc820036008, 0x0, 0x0)
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:260 +0x27c fp=0xc820049db0 sp=0xc820049bf0
main.main()
	/Users/szw/Shared/Projects/vim-ctrlspace/go/file_engine.go:333 +0x44 fp=0xc820049f50 sp=0xc820049db0
runtime.main()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc.go:111 +0x2b0 fp=0xc820049fa0 sp=0xc820049f50
runtime.goexit()
	/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc820049fa8 sp=0xc820049fa0

@lemeb lemeb mentioned this pull request Oct 5, 2019
@cometsong

Copy link
Copy Markdown
Member

This looks great!
Thanks for updating the go compilations @lemeb.
It was on my eventually-someday-soon todo list. 👍

@cometsong
cometsong merged commit 00b4457 into vim-ctrlspace:master Nov 4, 2019
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.

2 participants