Skip to content

Call to /proc/sys/vm/overcommit_memory breaks jemalloc-enabled application when running as unprivileged user #430

Closed

Description

@Whissi

I noticed that rsyslog's test suite suddenly stopped working on my build cluster.

After inspecting changes I noticed that dev-libs/jemalloc was recently updated from v4.1.0 to v4.2.0.

I cannot tell you any error message because I don't see anyone. However I bisected jemalloc and this is the bad commit:

commit c2f970c
Author: Jason Evans
Date: Thu May 5 17:45:02 2016 -0700

Modify pages_map() to support mapping uncommitted virtual memory.

If the OS overcommits:
- Commit all mappings in pages_map() regardless of whether the caller
  requested committed memory.
- Linux-specific: Specify MAP_NORESERVE to avoid
  unfortunate interactions with heuristic overcommit mode during
  fork(2).

This resolves #193.

I am attaching two strace logs. One when running the test suite as unprivileged user (that's why I don't think this is a dupe of #399 because the file isn't opened yet; however I don't understand why it is hanging here because the user can access the file, i.e. $ cat /proc/sys/vm/overcommit_memory works) and one when running the same test as root.

# emerge --info                                                                                                                                                      [243/243]
Portage 2.2.28 (python 2.7.11-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r2, 4.6.3-gentoo x86_64)
=================================================================
System uname: Linux-4.6.3-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:     4022864 total,   2184524 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of repository gentoo: Sun, 10 Jul 2016 19:22:43 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p46::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo, 3.5.1-r3::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2-r1::gentoo
sys-apps/openrc:          0.21.2::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo

Activity

  1. stefantalpalaru commented on Jul 31, 2016

    @stefantalpalaru

    It's the interaction with sys-apps/sandbox that triggers this for me. See https://bugs.gentoo.org/show_bug.cgi?id=589378

  2. kspinka commented on Aug 12, 2016

    @kspinka

    I think you've hit issue #443.

  3. Whissi commented on Aug 12, 2016

    @Whissi
    Author

    You are right. Closing my issue in favor of your excellent analysis in #443.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions