Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Debugserver doesn't continue with specified signal in `vCont` packet #42888

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR43918
Status NEW
Importance P enhancement
Reported by Dmitry Neverov (dmitry.neverov@gmail.com)
Reported on 2019-11-06 06:46:38 -0800
Last modified on 2019-11-06 06:47:37 -0800
Version unspecified
Hardware Macintosh MacOS X
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments delve.log (55605 bytes, text/x-log)
debugserver.log (320741 bytes, text/x-log)
Blocks
Blocked by
See also

Created attachment 22778 delve.log

I'm debugging the following go program on MacOS 10.14.6.

package main

import (
  "fmt"
  "os"
  "os/signal"
)

func main() {
  sigs := make(chan os.Signal, 1)
  signal.Notify(sigs, os.Interrupt)
  sig := <- sigs
  fmt.Printf("Got a signal '%v', start shutting down...\n", sig)
}

The program waits for the SIGINT and exits. I'm sending SIGINT via kill -2 <pid>. Attached logs show that debugserver notifies go debugger that the program got SIGINT ($T02 package), go debugger responds with vCont;C02, debugserver receives the packet, but doesn't call MachProcess::Signal and the program doesn't get the SIGINT.

Quuxplusone commented 4 years ago

Attached delve.log (55605 bytes, text/x-log): delve.log

Quuxplusone commented 4 years ago

Attached debugserver.log (320741 bytes, text/x-log): debugserver.log