[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash encountered a coredump issue with stepping on memory
From: |
wang yuhang |
Subject: |
bash encountered a coredump issue with stepping on memory |
Date: |
Mon, 4 Dec 2023 22:38:30 +0800 |
Hi
A bash coredump has appeared in my environment, the stack information displayed
by GDB is as follows:
#0 __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6,
no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007fbc77a8d2b3 in __pthread_kill_internal (signo=6, threadid=<optimized
out>)
at pthread_kill.c:78
#2 0x00007fbc77a41146 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#3 0x00007fbc77a2c4f7 in __GI_abort () at abort.c:79
#4 0x00007fbc77a81397 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7fbc77bbb120 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#5 0x00007fbc77a96d0c in malloc_printerr (
str=str@entry=0x7fbc77bb91d4 "malloc(): corrupted top size") at
malloc.c:5671
#6 0x00007fbc77a9a18c in _int_malloc (av=av@entry=0x7fbc77bf1aa0
<main_arena>, bytes=bytes@entry=48)
at malloc.c:4375
#7 0x00007fbc77a9abf7 in __GI___libc_malloc (bytes=bytes@entry=48) at
malloc.c:3323
#8 0x000055ec512aebb0 in xmalloc (bytes=bytes@entry=48) at xmalloc.c:114
#9 0x000055ec51266a14 in new_shell_variable (name=name@entry=0x7ffe664871d3
"HDCOMMON_ETC_PATH")
at variables.c:2771
#10 0x000055ec5126a580 in make_new_variable (name=name@entry=0x7ffe664871d3
"HDCOMMON_ETC_PATH",
table=table@entry=0x55ec51a6f720) at variables.c:2800
#11 0x000055ec5126a60d in bind_variable_internal (name=<optimized out>,
value=0x7ffe664871e5
"/opt/oss/envs/Product-NdpKafkaService/24.11.2225/rtsp/NdpCommonComponent/etc",
table=0x55ec51a6f720, hflags=<optimized out>, aflags=0) at variables.c:3153
#12 0x000055ec5126d577 in initialize_shell_variables (env=<optimized out>,
privmode=0)
at variables.c:458
#13 0x000055ec5124a508 in shell_initialize () at shell.c:1945
#14 0x000055ec5124887f in main (argc=3, argv=0x7ffe66482a68,
env=0x7ffe66482a88) at shell.c:572
(gdb) f 13
#13 0x000055ec5124a508 in shell_initialize () at shell.c:1945
through analyzing GDB, I found that this may be a problem with bash
stepping on memory
(gdb) p main_arena->top
$14 = (mchunkptr) 0x55ec51aa16e0
(gdb) x/10cb 0x55ec51aa16e0
0x55ec51aa16e0: 65 'A' 84 'T' 72 'H' 61 '=' 47 '/' 111 'o' 112 'p' 116 't'
0x55ec51aa16e8: 47 '/' 111 'o'
(gdb) x/60cb 0x55ec51aa16d0
0x55ec51aa16d0: 72 'H' 68 'D' 67 'C' 79 'O' 77 'M' 77 'M' 79 'O' 78 'N'
0x55ec51aa16d8: 95 '_' 67 'C' 76 'L' 65 'A' 83 'S' 83 'S' 95 '_' 80 'P'
0x55ec51aa16e0: 65 'A' 84 'T' 72 'H' 61 '=' 47 '/' 111 'o' 112 'p' 116 't'
0x55ec51aa16e8: 47 '/' 111 'o' 115 's' 115 's' 47 '/' 101 'e' 110 'n' 118 'v'
0x55ec51aa16f0: 115 's' 47 '/' 80 'P' 114 'r' 111 'o' 100 'd' 117 'u' 99 'c'
0x55ec51aa16f8: 116 't' 45 '-' 78 'N' 100 'd' 112 'p' 75 'K' 97 'a' 102 'f'
0x55ec51aa1700: 107 'k' 97 'a' 83 'S' 101 'e' 114 'r' 118 'v' 105 'i' 99 'c'
0x55ec51aa1708: 101 'e' 47 '/' 50 '2' 52 '4'
(gdb) p *main_arena->top
$15 = {mchunk_prev_size = 8390328354473530433, mchunk_size =
8533869598388481839,
fd = 0x6375646f72502f73, bk = 0x66614b70644e2d74, fd_nextsize =
0x636976726553616b,
bk_nextsize = 0x2e31312e34322f65}
the problematic bash version is 5.1.8
I hope to get your help !
- bash encountered a coredump issue with stepping on memory,
wang yuhang <=