Memory continusely increase

2018-12-19 Thread jake
Hi all,

I did a test about run a bash scriplt never quit,but met a memory usage
issue that cause used memory continuous increase.
This issue was present in bash-3.2.x, bash-4.0.x, bash-4.1.x, bash-4.2.x,
bash-4.3.x. However, This issue was disappeared in bash-4.4.0, I can't trace
which patch fixed the issue or which new feature was introduced in
bash-4.4.0.

Here is bash script:
--
#!/bin/bash

logger "Started testing"
while(true);do 
 while (true); do 
   ls > /dev/null 
 done
done
---
root@localhost:/root> cat /proc/767/smaps |grep -A10 heap
01ba5000-01be8000 rw-p  00:00 0 
[heap]
Size:268 kB
Rss: 152 kB
Pss: 152 kB
Shared_Clean:  0 kB
Shared_Dirty:  0 kB
Private_Clean: 0 kB
Private_Dirty:   152 kB
Referenced:  152 kB
Swap:  0 kB
KernelPageSize:4 kB
--
root@localhost:/root> cat /proc/767/smaps |grep -A10 heap
00d4c000-00e55000 rw-p  00:00 0 
[heap]
Size:   1060 kB
Rss:1048 kB
Pss:1048 kB
Shared_Clean:  0 kB
Shared_Dirty:  0 kB
Private_Clean: 0 kB
Private_Dirty:  1048 kB
Referenced: 1048 kB
Swap:  0 kB
KernelPageSize:4 kB
--
Could someone help to tell me which part of changes in bash-4.4.0, that
would be give me a direction backport code changes from bash-4.4 to
bash-3.2.x and bash-4.3.x.

Thanks,
Chen.



--
Sent from: http://gnu-bash.2382.n7.nabble.com/



Memory continuesly increase

2018-12-19 Thread jake
Hi all,I did a test about run a bash scriplt never quit,but met a memory
usage issue that cause used memory continuous increase.This issue was
present in bash-3.2.x, bash-4.0.x, bash-4.1.x, bash-4.2.x, bash-4.3.x.
However, This issue was disappeared in bash-4.4.0, I can't trace which patch
fixed the issue or which new feature was introduced in bash-4.4.0.Here is
bash
script:--#!/bin/bashlogger
"Started testing"while(true);do  while (true); dols > /dev/null 
donedone---root@localhost:/root>
cat /proc/767/smaps |grep -A10 heap01ba5000-01be8000 rw-p  00:00 0  
   
[heap]Size:268 kBRss: 152 kBPss:
152 kBShared_Clean:  0 kBShared_Dirty:  0 kBPrivate_Clean:  
  
0 kBPrivate_Dirty:   152 kBReferenced:  152 kBSwap: 
0 kBKernelPageSize:4
kB--root@localhost:/root>
cat /proc/767/smaps |grep -A10 heap00d4c000-00e55000 rw-p  00:00 0  
   
[heap]Size:   1060 kBRss:1048 kBPss:   
1048 kBShared_Clean:  0 kBShared_Dirty:  0 kBPrivate_Clean: 
   
0 kBPrivate_Dirty:  1048 kBReferenced: 1048 kBSwap: 
0 kBKernelPageSize:4
kB--Could
someone help to tell me which part of changes in bash-4.4.0, that would be
give me a direction backport code changes from bash-4.4 to bash-3.2.x and
bash-4.3.x.Thanks,Chen.



--
Sent from: http://gnu-bash.2382.n7.nabble.com/


One Crash per Log-in Caused by: echo '' > >(echo)

2019-03-12 Thread jake
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-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_GNU_SOURCE -DRECYCLES_PIDS 
-DDEFAULT_PATH_VALUE='/usr/local/bin:/usr/bin'  -O2 -g -pipe -Wall 
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-fexceptions -fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-Wno-parentheses -Wno-format-security

uname output: Linux vineyard.localdomain 4.20.14-200.fc29.x86_64 #1 SMP Tue Mar 
5 19:55:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Machine Type: x86_64-redhat-linux-gnu



Bash Version: 4.4

Patch Level: 23

Release Status: release



Description:

    Under the circumstances described below, the following command crashes Bash:

        

    echo '' > >(echo)

   

    Replacing '' with "", ' ', or " " has the same effect.

    

    Replacing >(echo) with >( echo ) has the same effect (spaces added).

    

    Please see the old bug titled "Fatal bug with redirection". It gives the 
following command:

    

  { echo a >&3 ; } 3> >( echo b )

  

    That command has the same effect, however, like the one I give first, it 
only crashes Bash

    *once* per login, a property not mentioned in the old bug's mailing thread.

    

    Below, I give further details on how the bug is associated with log-ins.



Repeat-By:



#

#   #

#  Heads-up: this is an intermittent bug.   #

#  The below recipe is as close to a guarantee  #

#  of recreation as I can get you.  #

#   #

#

    

      * Restart computer

      

      * Log in to *one* tty only. I have not determined whether a second tty 
login alters the behavior of this bug.

      

      * Open a Bash prompt. I am using KDE, so my terminal emulator is Konsole.

      

      * Do the command given in the title.

      

      * In my case, this results in Konsole giving me an error:

       

       Warning: Program '/bin/bash' crashed.

       

  * Now, open another tab in your terminal emulator or open a new window of 
it and do the command again.

    

   No error this time. (Usually.)

   

  * Log out of your GUI and log back in. Repeat. You'll see that again, you 
get the error once per log-in.

  

  

  -- Part 2 --

  

  * Log out of GUI and log back in.

  

  * Open terminal emulator. Log in to a shell within a shell with either 
just "su" or "su [non-root user]"

  

  * Enter the command. It crashes with:

  

  Broken pipe

  

    and kicks you back to the parent shell.

    

  * Repeat the "shell within a shell" thing and, again, enter the command. 
It does not break this time. Exit inner shell.

  

  * Enter the command in the outer shell. Again, it does *not* crash 
(usually).

  

  

  -- Part 3 --

  

  * Log out of your GUI.

  

  * Does logging-out take longer than normal? Does it get really stuck and 
force you to open another tty to restart your machine?

    I have witnessed both. I have also witnessed it having little to no 
effect on how long it takes to log out.

    

    

Additional Notes:



  * One time I did Part 2 with just "su" and the outer shell still crashed. At 
this moment, I consider the incident a fluke.

    Again, understand that this bug is intermittent.


Re: One Crash per Log-in Caused by: echo '' > >(echo)

2019-03-22 Thread jake
It is intermittent. Let's not give up just yet. I just reproduced it again 
after reading your response.

https://www.dropbox.com/s/7yy6kbpjlx1zpty/Reproduced.png?dl=0



Have your tried booting into runlevel 1 or 3 and doing it first thing?



Recall it only happens once per log-in, so if you have any scripts going off 
automatically during log-in, they may be

hiding the bug.



I am using KDE, your GUI may be "concealing" the bug.



I am also using Fedora 29. My current bash version is "4.4.23(1)-release", 
instead of just "4.4.23", though.