Get correct stacktraces for goroutine panics

This commit is contained in:
Kovid Goyal
2025-06-01 13:07:11 +05:30
parent d1faccdd1c
commit 7657b2b8c6
2 changed files with 35 additions and 22 deletions

View File

@@ -394,7 +394,7 @@ func (self *Loop) run() (err error) {
self.write_msg_id_counter = 0
write_done_channel := make(chan IdType)
self.wakeup_channel = make(chan byte, 256)
self.panic_channel = make(chan any)
self.panic_channel = make(chan error)
self.pending_writes = make([]write_msg, 0, 256)
err_channel := make(chan error, 8)
self.death_signal = SIGNULL
@@ -565,7 +565,7 @@ func (self *Loop) run() (err error) {
select {
case <-timeout_chan:
case p := <-self.panic_channel:
panic(p)
return p
case <-self.wakeup_channel:
for len(self.wakeup_channel) > 0 {
<-self.wakeup_channel