[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Valgrind detects invalid read in bash. malloc assertion fails.
From: |
Johannes Müller |
Subject: |
Valgrind detects invalid read in bash. malloc assertion fails. |
Date: |
Tue, 30 Apr 2019 13:06:09 +0200 |
User-agent: |
Posteo Webmail |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux debian 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1
(2019-04-12) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.0
Patch Level: 0
Release Status: release
Description:
When I run "valgrind bash valgrind_issue.sh" on my up-to-date
Debian stretch,
then valgrind shows invalid read errors and an assertion in
malloc.c fails.
At first, I observed this in the default bash & valgrind that
ships with Debian:
- bash --version: GNU bash, version 4.4.12(1)-release
(x86_64-pc-linux-gnu)
- valgrind --version: valgrind-3.12.0.SVN
Then I reproduced it with the latest bash and valgrind (see
attached log file):
- bash --version: GNU bash, version 5.0.0(3)-release
(x86_64-pc-linux-gnu)
- valgrind --version: valgrind-3.15.0
The problem does not reproduce on my RHEL 7.6.
It also reproduces on my second Debian stretch. The content of
valgrind_issue.sh:
#!/bin/bash
for aFile in *; do
echo "aFile=$aFile"
done
Repeat-By:
- Log into a Debian stretch
- Execute: valgrind bash valgrind_issue.sh
Fix:
bash_valgrind_issue.zip
Description: Zip archive
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Valgrind detects invalid read in bash. malloc assertion fails.,
Johannes Müller <=