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

mmap on wsl is ignoring RLIMIT_AS? #3505

Closed
KiYugadgeter opened this issue Aug 26, 2018 · 6 comments
Closed

mmap on wsl is ignoring RLIMIT_AS? #3505

KiYugadgeter opened this issue Aug 26, 2018 · 6 comments
Labels

Comments

@KiYugadgeter
Copy link

Windows10 1803 build:17134

I tried build golang from source.
But it has failed on ubuntu 18.04 on WSL.
This error is caused by wrong mmap behavior.

--- FAIL: TestRlimitAs (0.00s)
syscall_linux_test.go:180: Mmap: unexpectedly suceeded after setting RLIMIT_AS

mmap of WSL seems like does not respect RESOURCE_AS limitation.

@KiYugadgeter
Copy link
Author

My Version is : Windows10 1803 build:17134.228

I have put code here:
https://gist.github.com/KiYugadgeter/a26aabcadb8fffa8fbdda2c75a44cd38

@therealkenc
Copy link
Collaborator

therealkenc commented Aug 26, 2018

Fail is here. Yes, please fill out TEMPLATE.md (with special attention to the last sentence of the first paragraph). Most important being an strace capturing the setrlimit() and mmap() bits for that part of syscall_linux_test.go. [ed: thanks for the test code our posts crossed]

But in this instance, this is essentially dupe #2526. The strace log is almost certainly going to show setrlimit() and mmap() succeeding because (we can reasonably assume) RLIMIT_AS is stubbed. So, it will boil down to stating the use case, namely identifying the "killer golang applications with widespread adoption" that a stubbed RLIMIT_AS is blocking.

Snippet of test golang test code at issue:

	// RLIMIT_AS was set to the page size, so mmap()'ing twice the page size
	// should fail. See 'man 2 getrlimit'.
	_, err = unix.Mmap(-1, 0, 2*unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)
	if err == nil {
		t.Fatal("Mmap: unexpectedly suceeded after setting RLIMIT_AS")
	}

@therealkenc therealkenc changed the title mmap on wsl is ignoring RESOURCE_AS? mmap on wsl is ignoring RLIMIT_AS? Aug 26, 2018
@KiYugadgeter
Copy link
Author

KiYugadgeter commented Sep 25, 2018

I have tried strace some times but it does not done despite I waited several hours.

@KiYugadgeter
Copy link
Author

This bug is fixed on beta?

@gnaggnoyil
Copy link

gnaggnoyil commented Nov 14, 2022

Can confirm setrlimit(RLIMIT_AS) still fails silently on WSL1 environment, different with real linux environment even if the linux distribution are the same. I'm using WSL1 on Windows 10 22H2 19045.2251.

https://gist.github.com/gnaggnoyil/cda2ff5748beab3c519467eba66d80da

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

4 participants