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

Comments

@hajimehoshi
Copy link
Member

@hajimehoshi 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 hajimehoshi commented Nov 6, 2021

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 6, 2021

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

Loading

@hajimehoshi
Copy link
Member Author

@hajimehoshi hajimehoshi commented Nov 6, 2021

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

CC @aclements

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 6, 2021

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

Loading

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants