[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash encountered a coredump issue with stepping on memory
From: |
wang yuhang |
Subject: |
Re: bash encountered a coredump issue with stepping on memory |
Date: |
Wed, 6 Dec 2023 17:28:19 +0800 |
> The initialize_shell_variables function is processing env. When the for
loop
> reaches env[16], glibc needs to use the main_arena.top variable. However,
the
> value in the address pointed to by the top variable is overwritten by
env[15],
> causing a glibc exception and resulting in a coredump
When the for loop reaches env, the values of each env are:
(gdb) p env[0]
$5 = 0x7ffce3c2e0bc "SHELL=/bin/bash"
(gdb) p env[1]
$6 = 0x7ffce3c2e0cc "REPO_PATH=/opt/pub/software"
(gdb) p env[2]
$7 = 0x7ffce3c2e0e8 "CURL_ALIAS=/usr/bin/curl"
(gdb) p env[3]
$8 = 0x7ffce3c2e101 "FIND_ALIAS=/usr/bin/find"
(gdb) p env[4]
$9 = 0x7ffce3c2e11a "IPMC_AGENT_ROOT=/opt/oss/manager/agent/DeployAgent"
(gdb) p env[5]
$10 = 0x7ffce3c2e14d "PGREP_ALIAS=/usr/bin/pgrep"
(gdb) p env[6]
$11 = 0x7ffce3c2e168 "FSCK_ALIAS=/usr/sbin/fsck.ext4"
(gdb) p env[7]
$12 = 0x7ffce3c2e187 "enableServiceIdentity=/uds"
(gdb) p env[8]
$13 = 0x7ffce3c2e1a2 "SUPER_ROOT=/opt/sudobin/"
(gdb) p env[9]
$14 = 0x7ffce3c2e1bb "HOSTNAME_ALIAS=/bin/hostname"
(gdb) p env[10]
$15 = 0x7ffce3c2e1d8 "SUDO_GID=2000"
(gdb) p env[11]
$16 = 0x7ffce3c2e1e6 "HISTCONTROL="
(gdb) p env[12]
$17 = 0x7ffce3c2e1f3 "MKFIFO_ALIAS=/usr/bin/mkfifo"
(gdb) p env[13]
$18 = 0x7ffce3c2e210 "CHOWN_ALIAS=/bin/chown"
(gdb) p env[14]
$19 = 0x7ffce3c2e227 "BASH_ALIAS=/bin/bash"
(gdb) p env[15]
$20 = 0x7ffce3c2e23c "PROCESS_NAME=hofsosdfileagent"
(gdb) p env[16]
$21 = 0x7ffce3c2e25a "DIRNAME_ALIAS"
(gdb) p env[17]
$22 = 0x7ffce3c2e279 "PID="