1pkg/gotcha

fatal error: unexpected signal during runtime execution

Closed this issue · 1 comments

Run the following code

	n := 3
	for i := 0; i < n; i++ {
		go func() {
			size := rand.Intn(100)
			innerSlice := make([]string, size, size)
			for _, v := range innerSlice {
				_ = v
			}

			gotcha.Trace(context.Background(), func(ctx gotcha.Context) {
				b, o, c := ctx.Used()
				fmt.Println("allocation info ", b, o, c)
			})
			time.Sleep(time.Duration(30) * time.Second)

		}()

	}

under centos with golang 1.16, error fatal error: unexpected signal during runtime execution comes up. Is there anything missing?

1pkg commented

@richzw this is expected, the technique which is used - to directly patch machine code in runtime link . I tested it only for 1 specific go version 1.15.6 with the one specific architecture amd64. There is no goal to support this patch for any other permutation, as this is not feasible task. Moreover, the actual goal of this library was to show the technique itself and not necessary provide the utility.