From nobody Fri Sep 13 05:37:24 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X4jkF1nmGz5VvgL for ; Fri, 13 Sep 2024 05:37:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X4jkD5HFXz4C9M for ; Fri, 13 Sep 2024 05:37:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726205844; a=rsa-sha256; cv=none; b=KHshkeX6JQjG+6z7ooZjaTPl0Um0GOvG8vF46152Xvpsf1syAc4x3tIoNg6heigLpfPYpE vkbTgQHA0P9ETAABwE2iPCb1mP3kMIS/krMxnDGUDnHgkmEYaGUwW5NuTIKzIrPbEHqiUR lh+swV9jemM1OlAxWxP0vQx7/l3LO23YvlelvIwxzc34HO8PTfcFQGIl0uM5z+R5BI779n JVqnD8ggVPUQyf+ftgeBIuc/XNoQNwchZwAXQ4hXBbemzQ4bBmAUoelDLRNKMsJj1F8u81 rMHFdShtxn6e6Iraih2pvMT++YEcinqNS7Vy7Hzz87/L7prEKcnweDO4lh4+iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726205844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fPP6bXiXKQOMWc0fE+BDyuhSgECdpKw1GPbdPY5tmgo=; b=IawbNlonoyBYdxeGJ3m61fUF90Lqjr7htFEpvs4iKddM4btbQkmksH3kvW57DWCNUGRGUE w2Tm9NYf8hGW7/nWPy+GItiE77imF1kL0TVZA0WBj9PHeKMPgnOoq1nLzhCjmQoTxdwa/Y q2BICWV5zy6QHfXyBYtJYUZ7poyKZFIP49OtD2NF7kJ5BnnnKnYYpsa1lwKwgdfo1P4OEl XNnk0kbkEYSwcuFe84xXGI8utmN2FkfbdrDW54oWVVEzTN/aulTU8zO5zSgXdxmHo9cDWN YIw9/OUTkTNqlzTRqA68U+V27BXibniyaQNN0zHHVmd5ePuwK5X2Nf9lWggT1g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X4jkD4bltzWPd for ; Fri, 13 Sep 2024 05:37:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 48D5bO7q011633 for ; Fri, 13 Sep 2024 05:37:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 48D5bOj8011630 for bugs@FreeBSD.org; Fri, 13 Sep 2024 05:37:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 281471] ASLR: jemalloc RES memory keeps on increasing until process cores Date: Fri, 13 Sep 2024 05:37:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rupeshpilania@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281471 Bug ID: 281471 Summary: ASLR: jemalloc RES memory keeps on increasing until process cores Product: Base System Version: Unspecified Hardware: arm64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rupeshpilania@gmail.com Hi Team, I noticed Jemalloc doesn't bring down RES memory to original one even after calling free and setting these flags. MALLOC_CONF=3D"xmalloc:true,dirty_decay_ms:0,retain:false"=20 The only way to make it work is to disable aslr at kernel level along with MALLOC_CONF=3D"xmalloc:true,dirty_decay_ms:0,retain:false"=20 Test Results: ASLR Enabled: cat /etc/sysctl.conf | grep aslr kern.elf32.aslr.enable=3D1 kern.elf32.aslr.pie_enable=3D1 kern.elf64.aslr.enable=3D1 kern.elf64.aslr.pie_enable=3D1 13.2-RELEASE-p12 FreeBSD 13.2-RELEASE-p12 MESSAGING_GATEWAY amd64 C600V-DUT018:rtestuser 16] ./mem-fragment Hello! This program will fragment its process heap. Run top -p 5364 to fo= llow along! Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMA= ND 5364 root 1 20 0 10M 2280K ttyin 6 0:00 0.00% mem-= frag 500k 5KB chunks were just provisioned Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMM= AND 5364 root 1 52 0 4898M 3034M ttyin 6 0:02 0.00% mem-= frag 500k 5KB chunks were just provisioned Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMA= ND 5364 root 1 48 0 9816M 6064M ttyin 6 0:04 0.00% mem-= frag The first allocations were just free()'d. Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMM= AND 5364 root 1 27 0 7266M 3541M ttyin 6 0:05 0.00% mem-= frag The 2nd allocations were just free()'d. Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMM= AND 5364 root 1 28 0 4716M 1018M ttyin 6 0:05 0.00% mem-= frag ASLR Disabled: cat /etc/sysctl.conf | grep aslr kern.elf32.aslr.enable=3D0 kern.elf32.aslr.pie_enable=3D0 kern.elf64.aslr.enable=3D0 kern.elf64.aslr.pie_enable=3D0 C600V-DUT018:rtestuser 8] setenv MALLOC_CONF "xmalloc:true,dirty_decay_ms:0,retain:false" C600V-DUT018:rtestuser 10] ./mem-fragment Hello! This program will fragment its process heap. Run top -p 3884 to fo= llow along! Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMA= ND 3884 root 1 20 0 16M 2152K ttyin 5 0:00 0.00% mem-= frag 500k 5KB chunks were just provisioned Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COM 3884 root 1 44 0 2592M 2072M ttyin 5 0:02 0.00% mem 500k 5KB chunks were just provisioned Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COM 3884 root 1 45 0 5168M 4142M ttyin 5 0:03 0.00% mem The first allocations were just free()'d. Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COM 3884 root 1 25 0 2618M 2097M ttyin 5 0:04 0.00% mem The 2nd allocations were just free()'d. Press Enter to continue... PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COM 3884 root 1 26 0 68M 52M ttyin 5 0:04 0.00% mem --=20 You are receiving this mail because: You are the assignee for the bug.=