Homebrew-core: zsh hangs on $(...) command substitution in Big Sur 11.0.1

Created on 16 Nov 2020  ·  8Comments  ·  Source: Homebrew/homebrew-core

Bug report

I know Big Sur 11.0.1 is unsupported, so please let me know if this is the wrong forum, and if so, where I should register it instead

  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [x] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

Link to discussion confirming reproducibility:
https://github.com/Homebrew/discussions/discussions/141

brew config output

HOMEBREW_VERSION: 2.5.10
ORIGIN: https://github.com/Homebrew/brew
HEAD: b43c0fed789b4cae33cd200284c44a095db57c3c
Last commit: 4 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 922c58d90ece1cf52a285b2270e45fa4aeb993f4
Core tap last commit: 3 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.0.1-x86_64
CLT: 12.2.0.0.1.1604076827
Xcode: 12.2

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You are using macOS 11.0.
We do not provide support for this released but not yet supported version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or any other official channels. You are responsible for
resolving any issues you experience while you are running this
released but not yet supported version.

What you were trying to do (and why)

Run command subsitution in zsh.

What happened (include command output)

Zsh seems to hang. Command does not return.
Pressing ctrl+c also fails to return the prompt.


Command output


What you expected to happen

I expected the command to return.

Step-by-step reproduction instructions (by running brew install commands)

start zsh without rcs (this should start a new shell):

brew install zsh
/usr/local/bin/zsh --no-rcs
Enter the following command in the new shell:
echo $(date)

Most helpful comment

Fixed proposed: https://github.com/Homebrew/homebrew-core/pull/64923

_Edit: One hour from report to analysis, upstream report, and local workaround is not bad for a volunteer-based team. Please consider sponsoring our work if you can: https://github.com/sponsors/Homebrew_

All 8 comments

What makes you suspect this is an issue with the packaging of zsh rather than the code?

I can reproduce on Catalina when building from source (with Xcode 12.2), while our Catalina bottles do not show this problem (they were build with an earlier Xcode). So it seems to be a problem with zsh and recent clang.

The backtrace is:

  * frame #0: 0x00007fff6750429e libsystem_kernel.dylib`__sigsuspend + 10
    frame #1: 0x00007fff67469d22 libsystem_c.dylib`pause + 30
    frame #2: 0x000000010005ec9e zsh`signal_suspend + 85
    frame #3: 0x00000001000354df zsh`waitforpid + 265
    frame #4: 0x0000000100017fea zsh`getoutput + 705
    frame #5: 0x0000000100061b7a zsh`___lldb_unnamed_symbol263$$zsh + 1140
    frame #6: 0x0000000100061201 zsh`prefork + 457
    frame #7: 0x000000010001c466 zsh`___lldb_unnamed_symbol39$$zsh + 2782
    frame #8: 0x000000010001b75f zsh`___lldb_unnamed_symbol37$$zsh + 296
    frame #9: 0x0000000100016d53 zsh`___lldb_unnamed_symbol21$$zsh + 647
    frame #10: 0x0000000100016794 zsh`execlist + 1844
    frame #11: 0x0000000100016041 zsh`execode + 200
    frame #12: 0x000000010002f826 zsh`loop + 799
    frame #13: 0x00000001000327c4 zsh`zsh_main + 1179
    frame #14: 0x00007fff673a2cc9 libdyld.dylib`start + 1
    frame #15: 0x00007fff673a2cc9 libdyld.dylib`start + 1

Confirmed to be a zsh bug in the configure script. Many bugs, actually:

fx@rmeur zsh-5.8 % grep 'implicitly declaring' config.log
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:24: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:40: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:293:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:302:9: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:286:5: error: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:288:14: error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:31: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:320:13: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
fx@rmeur zsh-5.8 % grep 'C99' config.log        
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:289:8: error: implicit declaration of function 'mkfifo' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:294:11: error: implicit declaration of function 'fork' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:299:17: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:302:22: error: implicit declaration of function 'write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:27: error: implicit declaration of function 'getpid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:37: error: implicit declaration of function 'rand' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:298:5: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

I've reported the issue by email to zsh-workers at https://www.zsh.org/mla/workers/2020/index.html
Note that “The archives are not currently updating” so my message does not yet appear, however.

Fixed proposed: https://github.com/Homebrew/homebrew-core/pull/64923

_Edit: One hour from report to analysis, upstream report, and local workaround is not bad for a volunteer-based team. Please consider sponsoring our work if you can: https://github.com/sponsors/Homebrew_

I've reported the issue by email to zsh-workers at https://www.zsh.org/mla/workers/2020/index.html
Note that “The archives are not currently updating” so my message does not yet appear, however.

You can still view the latest emails by looking at the raw archives here (scroll all the way to the bottom for the latest emails): https://www.zsh.org/mla/zsh-workers/

It's not a convenient way to read the list, but it works if one is desperate enough.

@fxcoudert, this seems to be the patch that was being referred to in response to your original post to zsh-workers, in case you haven't found it: https://www.zsh.org/mla/zsh-workers/47560

The fix has landed. Can you confirm it's now working fine for you?

Works for me. I was able to reproduce the original report. Repeating the same steps now works as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BluePawDev picture BluePawDev  ·  3Comments

ghostbar picture ghostbar  ·  4Comments

Thirudhas picture Thirudhas  ·  4Comments

xeoneux picture xeoneux  ·  3Comments

daviderestivo picture daviderestivo  ·  4Comments