Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?UTF-8?Q?kutay_=C3=BCner?= Newsgroups: gnu.bash.bug Subject: SEGFAULT ON TILDE EXPANSION Date: Fri, 10 Apr 2020 17:59:13 +0300 Lines: 31 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1586538066 9296 209.51.188.17 (10 Apr 2020 17:01:06 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=iydOJ6WzQOjnlRBgbwYS+X95nqyB0IerXJrj+Ov2T0g=; b=txisCPLbHWXaGfgpfvjT7DlBRk67pGwooZBkv0+He2Xql3TedZqMCocTxc3JYkDYZj 1+4BaoLDhgCQxEfasexzhOd9Xi8ipUu2P4+QNJe/sMb3U8w+SQGYRRT+U1GzZvBB2HpU d5IKZ1uQEPWsfOBmbxWYNVPGl9ycZP4u7WMmpmxACyvc6Hq4Foj7g20gQq7BjpkVTscD 9clcYwdfVG5ObV0g2eFQPiVRPihDdHWfc8EGV7c7L9u1S81ou2LjN5UYfNDkA/Qx3hur kZm5sT+koBida4Xzwuib8881323eu6OGDABIf2NheoNcJUvSiOO4Fzy/B/qwsvNGWsJW aB7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iydOJ6WzQOjnlRBgbwYS+X95nqyB0IerXJrj+Ov2T0g=; b=OwbpjZHkioBWSTYaVa8vTgOjk8bo5z8b1ruM9zDUIwDT71tdcicVcf5m02TkPg4mLM DhB16qVvEcvQI85fu5jZdVI0FD3md4GcffHNAKyYnhLCHGz/zq44Mv762ISlCPURTcsQ QYbnMxo9b6/njZpMvqvQn/06DvGoZ+uCC+X4ZxKy42EG16cbBbIGJsyWMyo5jBZQ/Ydz fZGkU6zTsHQonEbHRB7w7EMLKWBeEiNkkmsVxqootb0LEj66YvW8DFQKUxH4R8xDl4N6 O7jCw9GRR5YRhDxxaLxZL4br71t+rSC+kPdp1QUOpAQHfNEmLqBwyz2PdbFBCxBkHZh5 GMkg== X-Gm-Message-State: AGi0PuY11GlJTmNBGA5VXG8fR0A9ysXyb7Tp4M0s4Qs8Z28m01SC0LwS lzeQspXpz7t4TJ9utbKMK+MhwnclfEsnufEY6opjuYnCEd0= X-Google-Smtp-Source: APiQypJVRDCYyIBCHEYTgFtucq0dcwQXFsjZCr7us6iPfUc1zxMdSyInHhsO4NbNJsaDiyxSdHcegCsxEr26gyOAHAQ= X-Received: by 2002:a92:dcd1:: with SMTP id b17mr5526091ilr.80.1586530764491; Fri, 10 Apr 2020 07:59:24 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12a X-Mailman-Approved-At: Fri, 10 Apr 2020 13:01:04 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:16118 Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -O0 -ggdb -Wno-parentheses -Wno-format-security uname output: Linux hk 5.6.3-arch1-1 #9 SMP PREEMPT Thu, 09 Apr 2020 03:39:30 +0000 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 5.0 Patch Level: 16 Release Status: release Description: Trying to tab expand a tilde causes segfault. This action requires us to get user entries by calling getpwent which is provided by libnss_systemd.so on my system. If we compile bash with it's malloc implementation, libraries it depends on also start to use this version of malloc. getpwent function in libnss_systemd.so takes advantage of the C malloc returning max_align_t aligned memory. Bash malloc returns 8 byte aligned memory which is less than 16 byte requirement on my x86-64 system. This is the root cause of segfault. Repeat-By: $ echo ~u Fix: ./configure --without-bash-malloc