Re: [External] : Re: receiving SIGHCHLD if job control is disabled - expected behavior?

2021-10-01 Thread Vladimir Marek
On Fri, Oct 01, 2021 at 09:39:50AM -0400, Chet Ramey wrote: > On 10/1/21 4:24 AM, Vladimir Marek wrote: > > Hello, > > > > The code in question is > > > > set +m > > echo $BASH_VERSION > > echo $SHELLOPTS > > trap 'echo =SIGCHLD=' 18 &g

receiving SIGHCHLD if job control is disabled - expected behavior?

2021-10-01 Thread Vladimir Marek
Hello, The code in question is set +m echo $BASH_VERSION echo $SHELLOPTS trap 'echo =SIGCHLD=' 18 sleep 1 echo done Bash 5 output: 5.0.17(1)-release braceexpand:hashall:interactive-comments =SIGCHLD= done Bash 4 output: 4.4.19(1)-release

Re: SIGSEGV in GNU bash, version 5.1.4(1)-release (sparc-sun-solaris2.10)

2021-01-04 Thread Vladimir Marek
Hi, As a Solaris bash maintainer this interests me very much. I haven't yet tried to upgrade bash to 5.1.x as there is no immediate need, sorry :) I'll try to test the new bash on latest Solaris (11.4). What did you do to observe the issue? Just execute the binary? The two most common problems

Re: Bash-5.0 Official patch 7

2019-04-26 Thread Vladimir Marek
Hi, > > Bash is one of the components we follow closely, so I'll be filing > > internal bugs to update to latest patch level tomorrow. The Makefile > > lists requirements > > > > REQUIRED_PACKAGES += library/ncurses > > REQUIRED_PACKAGES += shell/ksh93 > > REQUIRED_PACKAGES += terminal/screen >

Re: Bash-5.0 Official patch 7

2019-04-22 Thread Vladimir Marek
> >>I don't think bash 5 has hit Debian sid yet. As for "commercial" UNIX > >>like Solaris, well, that platform is on life support and a nightmare to > >>deal with. So no sense in wasting time there anymore. > > > >I'm sorry to hear that Solaris is a nightmare. Solaris 11.4 (the current >

Re: Bash-5.0 Official patch 7

2019-04-22 Thread Vladimir Marek
Hi, > I don't think bash 5 has hit Debian sid yet. As for "commercial" UNIX > like Solaris, well, that platform is on life support and a nightmare to > deal with. So no sense in wasting time there anymore. I'm sorry to hear that Solaris is a nightmare. Solaris 11.4 (the current supported

Re: Linux Local Privilege Escalation

2019-04-12 Thread Vladimir Marek
It escapes me how changing your own $PATH makes another user execute files in /tmp. And if someone has /tmp in $PATH moreover before anything else (or . for that matter) he deserves it. Right? -- Vlad > I written an exploit which allow to became root when a normal user use sudo. > The

Re: FIFO race condition on SunOS kernels

2019-01-04 Thread Vladimir Marek
For the record, my colleague found the issue. There is bug in libc, race condition between signal and popen. Thank you for the report -- Vlad

Re: [IDEA] more granular shell options to fix errexit

2019-01-03 Thread Vladimir Marek
Hi, [...] > The following suggested options aim to eliminate all cases that still exist, > outlined on the above link, where an exit code of a command is > swallowed/ignored. [...] My take on this, purely from user's point of view is to be able to instruct bash to exit any time any command

Re: FIFO race condition on SunOS kernels

2019-01-02 Thread Vladimir Marek
Hi, I gave it second look. I think it could be a flaw in your script after all. = a.sh = tmpdir=/var/tmp/FIFOs$$ trap "exec rm -rf $tmpdir" EXIT INT TERM PIPE mkdir "$tmpdir" || exit i=0; while test "$((i+=1))" -le 100; do

Re: FIFO race condition on SunOS kernels

2019-01-01 Thread Vladimir Marek
Hi, > You'd think that establishing a pipe between two processes is a very basic > UNIX feature that should work reliably on all UNIX variants. One would think that _opening_ a file is a very basic UNIX feature ... :) > But the following script seems to break consistently on Solaris and

Re: The usage of `cd builtins && $(MAKE) ...`

2018-12-30 Thread Vladimir Marek
Hi, > I see things like `cd builtins && $(MAKE) ...` in the Makefiles in > bash source code. GNU Make has the option of -C for entering a > directory and make. Is the reason to cd then make for compatibility > with other make's that don't support -C? Thanks. I'm afraid that you are in wrong

Re: Bash patches format

2018-05-30 Thread Vladimir Marek
> > > > If people are willing to do the conversion between patch formats for > > > their > > > > own purposes, more power to them. I don't see any compelling reason to > > > > change the format I use. > > > > > > > Could I at least convince you to start doing -p1, if not unified? > > > > > > > I

Re: [here string] uncompatible change on here string function

2017-11-27 Thread Vladimir Marek
> > It's not the point. the problem is bash-4.4 auto add quote around $var or > > $(cmd) after '<<<' > > > > On bash-4.2 and before following command always works fine > > read ignore fstype <<<$(df --output=fstype $mountpoint) > > > > But after Update bash-4.4, our customer's script get

Re: Core dump

2017-04-27 Thread Vladimir Marek
> > array_to_key() { > ># Converts 1 2 3 -> 1,2,3, (comma at the end) > >printf '%d,' "$@" > > } > > > > multi_store() { > >local array_name="$1"; shift > >local value="$1"; shift > >if unset -v "$array_name"; then > > declare -A $array_name >

Core dump

2017-04-27 Thread Vladimir Marek
Hi, array_to_key() { # Converts 1 2 3 -> 1,2,3, (comma at the end) printf '%d,' "$@" } multi_store() { local array_name="$1"; shift local value="$1"; shift if unset -v "$array_name"; then declare -A $array_name declare --

Re: q// / qq// syntax or built-ins please ?

2017-03-24 Thread Vladimir Marek
While quoting can be difficult at time, one can make his life simpler DELIM=\' CHAR="[^$DELIM]" REGEX="$CHAR*$DELIM($CHAR+)$DELIM$CHAR*" $ echo " Error: Cannot find file '/missing/file_1'. Error: Cannot find file '/missing/file_2'. " | while read line; do if [[ $line =~ $REGEX ]];

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> >> Posix says a word expansion error shall cause a non-interactive shell to > >> exit: > >> > >> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01 > >> > >> Bash posix mode changed as the result of this report: > >> > >>

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> Posix says a word expansion error shall cause a non-interactive shell to > exit: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01 > > Bash posix mode changed as the result of this report: > >

Re: Change in behavior

2016-12-13 Thread Vladimir Marek
> > $ cat configure > > set -o posix > > echo ${0.8} > > echo after > > > > $ bash a.sh > > 3.2.52(1)-release > > a.sh: line 3: ${0.8}: bad substitution > > after > Is `a.sh' a copy of `configure'? Oh, yes, sorry, it's the same file. It's a part of libvisual-plugins's configure script. --

Change in behavior

2016-12-13 Thread Vladimir Marek
Hi, by coincidence I found change in behavior in how bash treats syntax error. Can you see the difference on your machines too? $ cat configure set -o posix echo ${0.8} echo after $ bash a.sh 3.2.52(1)-release a.sh: line 3: ${0.8}: bad substitution after $ bash a.sh 4.3.46(1)-release

Tests are using fixed path /tmp/x

2016-12-07 Thread Vladimir Marek
Hi, I'm sure you already love me :) Here's little something I hit recently. Cheers -- Vlad # The test new-exp1 used /tmp/x which is too common file to and might be # already present. The test then fails with: # # run-new-exp # ... # 171,172c171 # < ./new-exp1.sub: line 8: /tmp/x:

Re: SHOBJ_STATUS problem

2016-12-07 Thread Vladimir Marek
> > And last nit I have stumbled upon ... > > Thanks, I fixed this one in early October as the result of > > http://lists.gnu.org/archive/html/bug-bash/2016-10/msg4.html But it's not part of bash-4.4 patchlevel 5, so do you keep your fixes somewhere else? Looking around there is git

SHOBJ_STATUS problem

2016-12-07 Thread Vladimir Marek
Hi, And last nit I have stumbled upon ... Cheers -- Vlad # If $ac_cv_func_dlopen is not 'yes' a bit earlier, SHOBJ_LIBS remains # undefiled. Later during 'make install' stage, examples/loadables/Makefile # calls install-$(SHOBJ_STATUS), and since the target 'install-' is undefined, #

Re: bash tests failing when compiled with --enable-xpg-echo-default=yes

2016-12-07 Thread Vladimir Marek
> >>> And second patch we use because of xpg-echo. Would it have sense to have > >>> it included, or maybe stop the tests completely instead? > >> > >> You could just have turned off the xpg_echo option instead of going through > >> a convoluted test (which just emulates `shopt -q') to determine

Re: Another little patch I would like to put upstream

2016-12-07 Thread Vladimir Marek
> using ^ as an anchor doesn't seem that much better than % > > autoconf uses & and |, but they tend to do it for vars where it's > unlikely those will show up (like path vars) > > how about something like: > @s=$$(printf '\001'); \ > sed -e "s$$s!MACHINE!$$s$(Machine)$$s" ... Good

Another little patch I would like to put upstream

2016-12-04 Thread Vladimir Marek
Studio compiler may use things like '-xregs=no%frameptr' for example. Thank you -- Vlad # Our compiler flags contain percent sign which get mixed up with percent sign # seprators used by sed. # Submitted to bug-bash@gnu.org --- Makefile.in 2014-01-25 13:27:30.0 -0800 +++

Re: bash tests failing when compiled with --enable-xpg-echo-default=yes

2016-12-04 Thread Vladimir Marek
> > And second patch we use because of xpg-echo. Would it have sense to have > > it included, or maybe stop the tests completely instead? > > You could just have turned off the xpg_echo option instead of going through > a convoluted test (which just emulates `shopt -q') to determine whether or >

Re: bash tests failing when compiled with --enable-xpg-echo-default=yes

2016-12-02 Thread Vladimir Marek
And second patch we use because of xpg-echo. Would it have sense to have it included, or maybe stop the tests completely instead? Thank you -- Vlad On Thu, Dec 01, 2016 at 10:44:02PM +, Vladimir Marek wrote: > Hi, > > On Solaris bash is compiled with --enable-xpg-echo-de

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
> > Nice analysis, does the second example look similar? > > > > bash -c 'bash -i 1; read -t 2 a < /dev/tty' > > > > I think it's the same problem. After "bash -i" exited, "bash -c" is not the > controlling process any more so it cannot read from the tty. Ah, I see. Thanks! -- Vlad

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
Nice analysis, does the second example look similar? bash -c 'bash -i 1; read -t 2 a < /dev/tty' Thanks! -- Vlad On Fri, Dec 02, 2016 at 12:59:37PM +0800, Clark Wang wrote: > On Fri, Dec 2, 2016 at 6:28 AM, Vladimir Marek <vladimir.ma...@oracle.com> > wrote: > &

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
> > I'm not sure what is going on, but the bash test suite was getting > > stopped (as if SIGSTOP was received) in the middle. Trying to find > > minimal set of conditions it came to this: > > > > - my ~/.bashrc has to contain 'cd /' (any dir works) > > - the tests have to first execute

Re: problem with redir test

2016-12-02 Thread Vladimir Marek
> > during testing of latest bash on Solaris I found strange behavior. We > > run the tests with clear environment (env -). It seems to be caused by > > undefined SHELL variable. The test reported > > > > 150,151c150,151 > > < ./redir11.sub: line 26: echo: write error: Bad file number > > <

Re: Various improvements to tests/run-all

2016-12-02 Thread Vladimir Marek
> > I am attaching patch against tests/run-all with the hope that the > > changes can be accepted upstream. The patch should be self explanatory. > > For completeness here are the errors I saw before I erased SHELLOPTS > > variable > > I can see doing this. From the error messages in your

Various improvements to tests/run-all

2016-12-01 Thread Vladimir Marek
Hi, I am attaching patch against tests/run-all with the hope that the changes can be accepted upstream. The patch should be self explanatory. For completeness here are the errors I saw before I erased SHELLOPTS variable run-redir warning: the text of a system error message may vary between

bash tests failing when compiled with --enable-xpg-echo-default=yes

2016-12-01 Thread Vladimir Marek
Hi, On Solaris bash is compiled with --enable-xpg-echo-default=yes (and --enable-usg-echo-default=yes if that makes difference). I have no idea why, but since it was shipped like this for a long time, I am afraid of changing that :) Because of this setting the tests are failing. I am attaching a

Testsuite problem when HOME is not defined

2016-12-01 Thread Vladimir Marek
In spirit similar problem to the previous one, when the tests are executed with $HOME undefined, I was getting this error: 26d25 < ./comsub-posix.tests: line 103: cd: HOME not set 28d26 < ./comsub-posix.tests: line 106: cd: HOME not set I am attaching the patch I am using for workaround, maybe

problem with redir test

2016-12-01 Thread Vladimir Marek
Hi, during testing of latest bash on Solaris I found strange behavior. We run the tests with clear environment (env -). It seems to be caused by undefined SHELL variable. The test reported 150,151c150,151 < ./redir11.sub: line 26: echo: write error: Bad file number < ./redir11.sub: line 27:

Strange bash behavior

2016-12-01 Thread Vladimir Marek
Hi, I'm not sure what is going on, but the bash test suite was getting stopped (as if SIGSTOP was received) in the middle. Trying to find minimal set of conditions it came to this: - my ~/.bashrc has to contain 'cd /' (any dir works) - the tests have to first execute run-execscript, namely it

Re: slow bgp_delete

2015-06-23 Thread Vladimir Marek
The patch works nicely. However there were internal concerns that this change might cause some incompatibility to existing scripts. I would like to ask for your opinion on it. I am trying to come up with a scenario where this change might cause existing script to break. This would be

Re: slow bgp_delete

2015-06-23 Thread Vladimir Marek
Hi Chet, ... a) decreasing size of the 'bgpids' list. Why do we need 30k entries if we don't trust that the IDs are unique? Maybe configuration or runtime option? I've thought about it. Posix only requires saving the statuses of the last CHILD_MAX asynchronous pids. The bash code has

Re: slow bgp_delete

2015-05-19 Thread Vladimir Marek
a) decreasing size of the 'bgpids' list. Why do we need 30k entries if we don't trust that the IDs are unique? Maybe configuration or runtime option? I've thought about it. Posix only requires saving the statuses of the last CHILD_MAX asynchronous pids. The bash code has traditionally

slow bgp_delete

2015-05-18 Thread Vladimir Marek
Hi, Our customer updated from bash 3.0.16 to 3.2.57 and claims that it caused decreased performance. The report is slightly vague and says that bash now consumes more memory and is slower after running ~ 3 commands. My current belief (and I want to have it confirmed form customer) is that the