Hello, I have some more info. I tried with versions: 5.0.018 and 4.4.012 and I get the same behavior. Also, I'm installing Bash with depothelper ( http://hpux.connect.org.uk/hppd/cgi-bin/search?term=bash&Search=Search).
Best wishes, Gyorgy On Mon, Aug 9, 2021 at 1:08 PM Gyorgy Matyasfalvi <matyasfa...@ampl.com> wrote: > Hello, > > Would like to report the following: > > ########################################################################### > Configuration Information [Automatically generated, do not change]: > Machine: ia64 > OS: hpux11.31 > Compiler: cc > Compilation CFLAGS: -O -I/usr/local/include -D_XOPEN_SOURCE_EXTENDED +DD64 > uname output: HP-UX sovmh352 B.11.31 U ia64 1429105484 unlimited-user > license > Machine Type: ia64-hp-hpux11.31 > > Bash Version: 5.1 > Patch Level: 8 > Release Status: release > > Description: > When a regex matches inside [[ ]] it results in a malloc error. > Whereas if it doesn't you get expected behavior. > > Take the code below: > > ---------------------------------------------------------------------------------- > #!/usr/bin/env bash > > text="123 text!" > if [[ "$text" =~ "123" ]]; then > printf "'123' in '$text'\n" > else > printf "'123' not in '$text'\n" > fi > > ---------------------------------------------------------------------------------- > You will receive: > > ---------------------------------------------------------------------------------- > malloc: shmatch.c:115: assertion botched > free: start and end chunk sizes differ > Aborting...ABORT instruction (core dumped) > > ---------------------------------------------------------------------------------- > > On the other hand the code below works as expected: > > ---------------------------------------------------------------------------------- > #!/usr/bin/env bash > > text="123 text!" > > if [[ "$text" =~ "zzz" ]]; then > printf "'zzz' in '$text'\n" > else > printf "'zzz' not in '$text'\n" > fi > > ---------------------------------------------------------------------------------- > You will receive: > > ---------------------------------------------------------------------------------- > 'zzz' not in '123 text!' > > ---------------------------------------------------------------------------------- > > Repeat-By: > fails.sh: > > ---------------------------------------------------------------------------------- > text="123 text!" > if [[ "$text" =~ "123" ]]; then > printf "'123' in '$text'\n" > else > printf "'123' not in '$text'\n" > fi > > ---------------------------------------------------------------------------------- > Then execute: bash fails.sh > ########################################################################### > > Let me know if you need anything else. Best wishes, > Gyorgy >