Re: My script makes a defunct subshell and sticks on read

2018-01-31 Thread Øyvind Hvidsten
Here. Now it's reading from stdin, and it locks up after a few seconds every time. No fifo's, pipes, non-standard file descriptors or anything. bash -c 'for ((i=0; ; i++)); do (( i%100 )) || printf "%s\n" "$i"; read -t 0.1; done' I'll shut up now.

Re: My script makes a defunct subshell and sticks on read

2018-01-31 Thread Øyvind Hvidsten
On 30/01/18 22:51, Chet Ramey wrote: On 1/30/18 3:04 PM, Øyvind Hvidsten wrote: Bash Version: 4.4 Patch Level: 12 Release Status: release Description:     Running the included script, which does nothing useful but is cut down a lot to demonstrate the issue, my main computer (amd64 based

Re: My script makes a defunct subshell and sticks on read

2018-01-31 Thread Øyvind Hvidsten
On 30/01/18 22:54, Øyvind Hvidsten wrote: > On 30/01/18 22:51, Chet Ramey wrote: >> On 1/30/18 3:04 PM, Øyvind Hvidsten wrote: >> >>> Bash Version: 4.4 >>> Patch Level: 12 >>> Release Status: release >>> >>> Description: >>&g

Re: My script makes a defunct subshell and sticks on read

2018-01-30 Thread Øyvind Hvidsten
On 30/01/18 22:51, Chet Ramey wrote: On 1/30/18 3:04 PM, Øyvind Hvidsten wrote: Bash Version: 4.4 Patch Level: 12 Release Status: release Description:     Running the included script, which does nothing useful but is cut down a lot to demonstrate the issue, my main computer (amd64 based

My script makes a defunct subshell and sticks on read

2018-01-30 Thread Øyvind Hvidsten
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-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACK

Re: Bash leaks memory when doing function calls while reading from subshell as stdin

2017-12-17 Thread Øyvind Hvidsten
Awesome. Thanks! On 08/12/17 15:57, Chet Ramey wrote: On 12/7/17 7:41 AM, Øyvind Hvidsten wrote: Bash Version: 4.4 Patch Level: 12 Release Status: release Description: Somehow the included script causes a memory leak. Memory usage will grow huge over a very short timeframe. Thanks for

Bash leaks memory when doing function calls while reading from subshell as stdin

2017-12-07 Thread Øyvind Hvidsten
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-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACK

Bash leaks memory when doing function calls while reading from subshell as stdin

2017-12-07 Thread Øyvind Hvidsten
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-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACK

Nested calls to getopts incorrectly parses clustered options

2014-05-31 Thread Øyvind Hvidsten
For a simple test: $ f() { local OPTIND=1 OPTARG OPTERR opt; while getopts ":abcxyz" opt; do echo "opt: $opt"; if [[ "$opt" = "y" ]]; then f -a -b -c; fi; done; }; f -x -y -z opt: x opt: y opt: a opt: b opt: c opt: z However, if the options are clustered: $ f() { local OPTIND=1 OPTARG OPTERR

bash blocking on exec assigning an output file descriptor to a fifo

2012-02-14 Thread Øyvind Hvidsten
Please correct any mistakes in my wording, as I would very much like to be able to use the correct terms when describing this. Also, please ask if anything is unclear :) My problem occurs when I do the following: mkfifo foo; exec 3<"foo"; echo done This blocks on the exec statement, and never

Re: String replacements leak small amounts of memory each time

2010-06-14 Thread Øyvind Hvidsten
oint. The testcases need to be run in the / directory, or the command has to be: while read line; do test=${line#\ }; done < <(ls -lR /) ..in order to generate enough input to reproduce the issue. On 14/06/10 04:52, Chet Ramey wrote: On 6/13/10 5:33 PM, Øyvind Hvidsten wrote: It could be

Re: String replacements leak small amounts of memory each time

2010-06-13 Thread Øyvind Hvidsten
It could be logical leaks, or whatever is the correct english term for them. Memory that's used, and kept track of, but not used again, and not freed until the program shuts down. The memory usage is constantly increasing. I have a process using 3 gigs now, and it just runs one of those testcas