bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coredump from C-c-ed function


From: xftroxgpx
Subject: coredump from C-c-ed function
Date: Tue, 23 Jan 2018 03:30:58 -0500

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' 
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_FORTIFY_SOURCE=2 
-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong 
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' 
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc' 
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS 
-Wno-parentheses -Wno-format-security
uname output: Linux z5 4.15.0-rc9-g0c5b9b5d9adb #177 SMP PREEMPT Mon Jan 22 
09:51:52 CET 2018 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release

Description:
bash coredumps by interrupting a called a function via C-c

Repeat-By:
1. get interactive bash shell
2. paste this function definition at command prompt
function dv3() {
  local ec=1
  time while test "$ec" -ne "0"; do
    sleep 1
    ls /$RANDOM
    ec="$?"
  done
}
3. now call it: $ dv3
4. C-c at any point

two things can happen:
A) coredump and immediate exit (also command history is not saved)
B) (coredump?(unsure) and) you still have the bash prompt but the next dv3 
command will do A.

Stacktraces sample:
Jan 23 09:16:53 systemd-coredump[12705]: Process 12703 (bash) of user 1000 
dumped core.

Stack trace of thread 12703:
#0  0x00007f624c8ff3dc _int_malloc (libc.so.6)
#1  0x00007f624c9012f3 malloc (libc.so.6)
#2  0x000000000047224e xmalloc (bash)
#3  0x000000000045eb2b array_create (bash)
#4  0x000000000045eb71 array_copy (bash)
#5  0x0000000000459e86 run_exit_trap (bash)
#6  0x000000000045c7c9 n/a (bash)
#7  0x000000000045c911 termsig_sighandler (bash)
#8  0x00007f624c8b38e0 __restore_rt (libc.so.6)
#9  0x00007f624c8ff49d _int_malloc (libc.so.6)
#10 0x00007f624c9012f3 malloc (libc.so.6)
#11 0x000000000047224e xmalloc (bash)
#12 0x000000000042a1c9 make_bare_word (bash)
#13 0x000000000043c8ed copy_word_list (bash)
#14 0x000000000043ce3f copy_command (bash)
#15 0x000000000043ce09 copy_command (bash)
#16 0x000000000043cf5e n/a (bash)
#17 0x000000000043cbb1 copy_command (bash)
#18 0x000000000043cbf9 copy_command (bash)
#19 0x000000000043cc3a copy_command (bash)
#20 0x0000000000434c01 n/a (bash)
#21 0x00000000004310d9 n/a (bash)
#22 0x0000000000431e4c execute_command_internal (bash)
#23 0x000000000047894f parse_and_execute (bash)
#24 0x000000000044dd71 command_substitute (bash)
#25 0x000000000045285e n/a (bash)
#26 0x0000000000453d11 n/a (bash)
#27 0x0000000000455409 expand_prompt_string (bash)
#28 0x000000000041dd74 decode_prompt_string (bash)
#29 0x000000000041e791 n/a (bash)
#30 0x0000000000427c46 yyparse (bash)
#31 0x000000000041c12f parse_command (bash)
#32 0x000000000041c218 read_command (bash)
#33 0x000000000041c3f9 reader_loop (bash)
#34 0x000000000041b1b5 main (bash)
#35 0x00007f624c89ff4a __libc_start_main (libc.so.6)
#36 0x000000000041b6fa _start (bash)
Jan 23 09:16:53 systemd-coredump[12710]: Process 12708 (bash) of user 1000 
dumped core.

Stack trace of thread 12708:
#0  0x00007f624c8ff3dc _int_malloc (libc.so.6)
#1  0x00007f624c9012f3 malloc (libc.so.6)
#2  0x000000000047224e xmalloc (bash)
#3  0x000000000045ead4 array_create_element (bash)
#4  0x000000000045eb4d array_create (bash)
#5  0x000000000045eb71 array_copy (bash)
#6  0x0000000000459e86 run_exit_trap (bash)
#7  0x000000000045c7c9 n/a (bash)
#8  0x000000000045c911 termsig_sighandler (bash)
#9  0x00007f624c8b38e0 __restore_rt (libc.so.6)
#10 0x00007f624c8ff49d _int_malloc (libc.so.6)
#11 0x00007f624c9012f3 malloc (libc.so.6)
#12 0x000000000047224e xmalloc (bash)
#13 0x000000000042a1c9 make_bare_word (bash)
#14 0x000000000043c8ed copy_word_list (bash)
#15 0x000000000043ce3f copy_command (bash)
#16 0x000000000043cdf4 copy_command (bash)
#17 0x000000000043cbf9 copy_command (bash)
#18 0x000000000043cbe8 copy_command (bash)
#19 0x000000000043cc3a copy_command (bash)
#20 0x0000000000434c01 n/a (bash)
#21 0x00000000004310d9 n/a (bash)
#22 0x0000000000431e4c execute_command_internal (bash)
#23 0x000000000047894f parse_and_execute (bash)
#24 0x000000000044dd71 command_substitute (bash)
#25 0x000000000045285e n/a (bash)
#26 0x0000000000453d11 n/a (bash)
#27 0x0000000000455409 expand_prompt_string (bash)
#28 0x000000000041dd74 decode_prompt_string (bash)
#29 0x000000000041e791 n/a (bash)
#30 0x0000000000427c46 yyparse (bash)
#31 0x000000000041c12f parse_command (bash)
#32 0x000000000041c218 read_command (bash)
#33 0x000000000041c3f9 reader_loop (bash)
#34 0x000000000041b1b5 main (bash)
#35 0x00007f624c89ff4a __libc_start_main (libc.so.6)
#36 0x000000000041b6fa _start (bash)
Jan 23 09:16:56 login[12085]: pam_unix(login:session): session closed for user 
xftroxgpx
Jan 23 09:16:56 systemd-coredump[12773]: Process 12138 (bash) of user 1000 
dumped core.

Stack trace of thread 12138:
#0  0x00007f624c8ff3dc _int_malloc (libc.so.6)
#1  0x00007f624c9012f3 malloc (libc.so.6)
#2  0x000000000047224e xmalloc (bash)
#3  0x000000000045ead4 array_create_element (bash)
#4  0x000000000045eb4d array_create (bash)
#5  0x000000000045eb71 array_copy (bash)
#6  0x0000000000459e86 run_exit_trap (bash)
#7  0x000000000045c7c9 n/a (bash)
#8  0x000000000045c911 termsig_sighandler (bash)
#9  0x00007f624c8b38e0 __restore_rt (libc.so.6)
#10 0x00007f624c8ff49d _int_malloc (libc.so.6)
#11 0x00007f624c9012f3 malloc (libc.so.6)
#12 0x000000000047224e xmalloc (bash)
#13 0x000000000045b39b unwind_protect_mem (bash)
#14 0x000000000043500a n/a (bash)
#15 0x00000000004310d9 n/a (bash)
#16 0x0000000000431e4c execute_command_internal (bash)
#17 0x0000000000433a6e execute_command (bash)
#18 0x000000000041c492 reader_loop (bash)
#19 0x000000000041b1b5 main (bash)
#20 0x00007f624c89ff4a __libc_start_main (libc.so.6)
#21 0x000000000041b6fa _start (bash)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]