Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large core dumps generated on macos #3307

Open
derekparker opened this issue Mar 16, 2023 · 1 comment
Open

Large core dumps generated on macos #3307

derekparker opened this issue Mar 16, 2023 · 1 comment

Comments

@derekparker
Copy link
Member

  1. What version of Delve are you using (dlv version)?

Delve Debugger
Version: 1.20.1
Build: cf65f94

  1. What version of Go are you using? (go version)?

go version go1.20.2 darwin/arm64

  1. What operating system and processor architecture are you using?

darwin/arm64

  1. What did you do?

Generated a core dump using the following program after continuing to main and nexting a few times:

package main

import (
	"fmt"
	"runtime"
	"strconv"
)

type Rectangle struct{}

func (r *Rectangle) Height() int {
	h, _ := strconv.ParseInt("7", 10, 0)
	return int(h)
}

func (r *Rectangle) Width() int {
	return 6
}

func (r *Rectangle) Area() int { return r.Height() * r.Width() }

func main() {
	var r Rectangle
	runtime.Breakpoint()
	fmt.Println(r.Area())
	fmt.Println(r.Area() * 2)
	fmt.Println(r.Area() * 3)
}
  1. What did you expect to see?

A reasonably sized core dump (for example, same program core dump generated on linux/amd64 is around 45M)

  1. What did you see instead?

A core dump generated that's 3.6G.

@aarzilli
Copy link
Member

We only skip things that are marked not readable, this might be a consequence of how the runtime allocates memory on macos. I don't know if we can do anything about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants