2023-03-19T14:50:17.591-0500 ERROR Compiler.compiler_protocol compiler/compiler_fs_protocol.go:135 read failed {"error": "io: read/write on closed pipe"}
github.com/toitware/toit.git/toitlsp/lsp/compiler.(*CompilerFSProtocol).HandleConn
/Users/runner/work/toit/toit/tools/toitlsp/lsp/compiler/compiler_fs_protocol.go:135
github.com/toitware/toit.git/toitlsp/lsp/compiler.(*PipeFileServer).handleConn
/Users/runner/work/toit/toit/tools/toitlsp/lsp/compiler/file_server_pipe.go:52
jag monitor / jag watch
if error != null
delve
dlv attach pid
toit.lsp
➜ bin dlv attach 61015
Type 'help' for list of commands.
(dlv)
threads
Thread 3792956 at :0
Thread 3792960 at :0
* Thread 3792961 at 0x108d200 /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 sort.SearchInts
Thread 3792962 at :0
Thread 3792963 at :0
Thread 3792994 at 0x1014830 /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/mbitmap.go:947 runtime.heapBitsSetType
Thread 3793039 at 0x1093ed1 /Users/runner/hostedtoolcache/go/1.17.13/x64/src/internal/poll/fd_mutex.go:186 internal/poll.(*fdMutex).rwunlock
Thread 3793044 at :0
Thread 3793045 at :0
Thread 3793046 at :0
Thread 3793047 at :0
Thread 3793048 at 0x105f0e8 /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/netpoll.go:284 internal/poll.runtime_pollReset
Thread 3793087 at :0
Thread 3793088 at 0x1109fed /Users/runner/hostedtoolcache/go/1.17.13/x64/src/bufio/bufio.go:105 bufio.(*Reader).fill
Thread 3793118 at :0
Thread 3793645 at :0
Thread 3793646 at 0x100c86b /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/malloc.go:858 runtime.mallocgc
Thread 3793647 at :0
Thread 3793648 at 0x10644be /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/asm_amd64.s:772 runtime.asmcgocall
Thread 3793649 at :0
Thread 3793651 at :0
Thread 3793652 at :0
Thread 3796699 at :0
Thread 3797876 at 0x1045f2e /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/select.go:310 runtime.selectgo
Thread 3798078 at :0
Thread 3798079 at 0x10368df /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/proc.go:410 runtime.acquireSudog
Thread 3798080 at :0
Thread 3798081 at :0
goroutines
goroutine X
list
bt
(dlv) list
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Command failed: open /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go: no such file or directory
up
bt
(dlv) goroutine 2636
Switched from 2636 to 2636 (thread 3792961)
(dlv) bt
0 0x000000000108d200 in sort.SearchInts
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83
1 0x00000000012a6119 in github.com/toitware/toit.git/toitlsp/lsp/toit.FindLastGreaterThanIdx
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/summary.go:544
2 0x00000000012aaa0d in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).topLevelReferenceFromGlobalID
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:776
3 0x00000000012a91b3 in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).readType
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:430
4 0x00000000012a8b6a in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).readMethod
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:359
5 0x00000000012a8325 in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).readFunctions
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:257
6 0x00000000012a785b in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).readModule
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:121
7 0x00000000012a7545 in github.com/toitware/toit.git/toitlsp/lsp/toit/text.(*summaryReader).Read
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:82
8 0x00000000012a728c in github.com/toitware/toit.git/toitlsp/lsp/toit/text.ParseSummary
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:49
9 0x00000000012b3ca7 in github.com/toitware/toit.git/toitlsp/lsp/compiler.(*parser).AnalyzeOutput
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/compiler/parser.go:69
10 0x00000000012ac1da in github.com/toitware/toit.git/toitlsp/lsp/compiler.(*Compiler).Analyze.func1
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/compiler/compiler.go:136
11 0x00000000012ae903 in github.com/toitware/toit.git/toitlsp/lsp/compiler.(*Compiler).run.func1
at /Users/runner/work/toit/toit/tools/toitlsp/lsp/compiler/compiler.go:336
12 0x0000000001064661 in runtime.goexit
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/asm_amd64.s:1581
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 1: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/summary.go:544 (PC: 12a6119)
(dlv) up
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 2: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:776 (PC: 12aaa0d)
(dlv) up
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 3: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:430 (PC: 12a91b3)
(dlv) up
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 4: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:359 (PC: 12a8b6a)
(dlv) up
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 5: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:257 (PC: 12a8325)
(dlv) up
> sort.SearchInts() /Users/runner/hostedtoolcache/go/1.17.13/x64/src/sort/search.go:83 (PC: 0x108d200)
Warning: debugging optimized function
Frame 6: /Users/runner/work/toit/toit/tools/toitlsp/lsp/toit/text/parser.go:121 (PC: 12a785b)
continue
ctrl-c
received SIGINT, stopping process (will not forward signal)
Stopped at: 0x7ff80872911a
=> 1: no source available
(dlv) bt
0 0x00007ff80872911a in ???
at ?:-1
1 0x0000000001066490 in runtime.pthread_cond_wait_trampoline
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/sys_darwin_amd64.s:535
2 0x00000000010644ed in runtime.asmcgocall
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/asm_amd64.s:795
3 0x0000000000000000 in ???
at ?:-1
4 0x0000000001052c34 in runtime.pthread_cond_wait
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/sys_darwin.go:444
5 0x000000000102fdad in runtime.semasleep
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/os_darwin.go:66
6 0x000000000100b2e5 in runtime.notesleep
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/lock_sema.go:182
7 0x000000000103904a in runtime.mPark
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/proc.go:1441
8 0x000000000103a558 in runtime.stopm
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/proc.go:2408
9 0x000000000103e6d6 in runtime.exitsyscall0
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/proc.go:4115
10 0x0000000001062543 in runtime.mcall
at /Users/runner/hostedtoolcache/go/1.17.13/x64/src/runtime/asm_amd64.s:307
Sending output to pager...
(dlv) list
Stopped at: 0x7ff80872911a
=> 1: no source available
goroutines
tmate
toit.lsp
toitLanguageServer.command
toit.lsp
--toitc
--cpuprofile
[
"/home/flo/.cache/jaguar/sdk/bin/toit.lsp",
"--toitc", "/home/flo/.cache/jaguar/sdk/bin/toit.compile",
"--cpuprofile", "/home/flo/tmp/lsp-profile"
]
ctrl-shift-p
Developer: Reload Window
.prof
go tool pprof PATH_TO_TOIT_LSP PATH_TO_PROFILE_FILE
➜ jag version
Version: v1.9.14
SDK version: v2.0.0-alpha.71
Build date: 2023-03-25T18:51:50Z
➜ toit
toitLanguageServer.trace.server
.toit
// Save as hello.toit
import uart
import gpio
import reader show BufferedReader
import writer show Writer
import net
import mqtt
import net.x509
import certificate_roots
import encoding.json
import gpio
import gpio
import gpio.adc show Adc
// Include a random number, as we are sharing test.mosquitto.org with other users.
CLIENT_ID ::= "tio-$(random)"
HOST ::= "broker.mqttdashboard.com"
PORT ::= 8000
TOPIC ::= "tio"
main:
print "Hello totto!"
port := uart.Port
--rx=gpio.Pin 1 //blue
--tx=gpio.Pin 0 //purple
--baud_rate=9600
writer := Writer port
writer.write "Hello\n\n\n\n"
network := net.open
transport := mqtt.TcpTransport network --host=HOST
client := mqtt.Client --transport=transport
client.start --client_id=CLIENT_ID
client.subscribe TOPIC:: | topic/string payload/ByteArray |
writer.write payload
writer.write "\n\n\n"
print "Hello world?"
button1 := gpio.Pin 4 --input
button1Pressed := false
// butotn1: 2
// light1: 3
// button2: 4
// light2: 5ss
output_pin := gpio.Pin 5
--output
output_pin.set 1
print "light 1"
while true:
button1.wait_for 1
print "clicked"
sleep --ms=100
// writer.write "ooo button pushed\v n\n\n\n"
// print button1.get
// // sleep --ms 100
// sleep --ms=100
// if button1.get == 1 and not button1Pressed:
// print "passed"
// button1Pressed = true
// // writer.write "button1 pushed\v n\n\n\n"
// // client.publish TOPIC:: "button1 pushed\v n\n\n\n"
killall toit.lsp
mqtt
toit.lsp
toit.lsp
toit.lsp
.packages
.packages
.packages
jag pkg install
It's unlikely, but maybe the download of the packages left the package download in a bad state. (Not sure why that would lead to 100% CPU though)
ps
import mqtt
initialize
code --install-extension toit-1.6.6.vsix
initialize
Starting Toit LSP server: workingDir=/home/flo/work/pkg-tar
jaguar/sdk/lib/crypto
jaguar/sdk/lib/system/base
jaguar/sdk/lib/system
jaguar/sdk/lib/encoding
jaguar/sdk/lib/tls
or you have an extension that opens files if there is a diagnostic for them