Bug 1570021

Summary: emacs: Requires overcommit
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: emacsAssignee: Jan Synacek <jsynacek>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: jkeating, jonathan.underwood, jsynacek, msekleta, phracek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-23 07:19:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Florian Weimer 2018-04-20 12:53:55 UTC
Emacs does this on startup:

mmap(NULL, 154618822656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = -1 ENOMEM (Cannot allocate memory)

MAP_NORESERVE does not have the intended effect with vm.overcommit_memory=2 (which enables the beancounter/disables overcommit).

The standard way of reserving address space is to use a PROT_NONE mapping and make parts readable/writable as needed using mprotect later.  This will work with vm.overcommit_memory=2 as well because initially PROT_NONE mappings do not count towards the commit limit.

Seen with:

emacs-25.3-3.fc27.x86_64

Comment 1 Jan Synacek 2018-04-23 06:36:39 UTC
Is Emacs doing this? Or is it actually webkit, as in bug 1569478?

Comment 2 Florian Weimer 2018-04-23 07:19:47 UTC

*** This bug has been marked as a duplicate of bug 1569478 ***