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

runtime: TestArenaCollision should be skipped when sysReserve cannot return an address based on the given hint #49415

Open
hajimehoshi opened this issue Nov 6, 2021 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@hajimehoshi
Copy link
Member

hajimehoshi commented Nov 6, 2021

https://cs.opensource.google/go/go/+/master:src/runtime/export_test.go;l=495-509;drc=4f543b59c5618abccf0e78a17a2aeb173c085a91

func MapNextArenaHint() (start, end uintptr) {
	hint := mheap_.arenaHints
	addr := hint.addr
	if hint.down {
		start, end = addr-heapArenaBytes, addr
		addr -= physPageSize
	} else {
		start, end = addr, addr+heapArenaBytes
	}
	sysReserve(unsafe.Pointer(addr), physPageSize)
	return
}

MapNextArenaHint is a function for testing, and returns the addresses for an arena region. sysReserve might not use the given address in some special environments like Wasm or Plan9. MapNextArenaHint should return the actual allocated addresses, rather than the given addresses.

@hajimehoshi hajimehoshi changed the title runtime: MapNextArenaHint should return the actually allocated addresses instead of the preserved addresses runtime: MapNextArenaHint should return the actually allocated addresses instead of the hint addresses Nov 6, 2021
@hajimehoshi
Copy link
Member Author

hajimehoshi commented Nov 6, 2021

@gopherbot
Copy link

gopherbot commented Nov 6, 2021

Change https://golang.org/cl/361956 mentions this issue: runtime: fix MapNextArenaHint return actual addresses

@hajimehoshi
Copy link
Member Author

hajimehoshi commented Nov 6, 2021

I started to think we should skip TestArenaCollision on Plan 9 and Wasm.

CC @aclements

@gopherbot
Copy link

gopherbot commented Nov 6, 2021

Change https://golang.org/cl/361957 mentions this issue: runtime: skip TestArenaCollision when sysReserve returns nil

@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Nov 7, 2021
@hajimehoshi hajimehoshi changed the title runtime: MapNextArenaHint should return the actually allocated addresses instead of the hint addresses runtime: TestArenaCollision should be skipped when sysReserve cannot return an address based on the given hint Nov 8, 2021
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
Status: Triage Backlog
Development

No branches or pull requests

4 participants