ahgamut / superconfigure

wrap autotools configure scripts to build with Cosmopolitan Libc
The Unlicense
159 stars 22 forks source link

zsh `TRAPUSR1` is not respected #22

Open mrdomino opened 6 months ago

mrdomino commented 6 months ago
System:

Apple Silicon (MacOS 14.2.1)

To reproduce:
  1. Put this in your ~/.zshrc:
    TRAPUSR1() { echo . }
  2. Start up another zsh session
  3. Run pkill -USR1 zsh from the first session
Expected behavior:

The other session prints a ..

Actual behavior:

The other session dies (as is zsh's default SIGUSR1 behavior)

Most likely a cosmopolitan issue but reporting it here since zsh is technically part of superconfigure. At some point someone (I or you) can do some digging and report the upstream issue if there is one.

ahgamut commented 6 months ago

Does the function work on Linux? What is the value of SIGUSR1 on your host system?

mrdomino commented 6 months ago

Dies on Linux too, and @jart says there are tests for catching SIGUSR1 that pass on Mac.

ahgamut commented 6 months ago

Can you try again with https://cosmo.zip/pub/cosmos/bin/zsh ? (I changed the VSIGCOUNT value because I think it is not set properly)

mrdomino commented 6 months ago

That segfaults at the definition of TRAPUSR1.

ahgamut commented 6 months ago

Ok, I think this is happening because the value of SIGCOUNT and VSIGCOUNT are decided by some ./configure check, and the current build is setting SIGCOUNT as zero for some reason:

https://github.com/zsh-users/zsh/blob/master/Src/signames2.awk

https://github.com/zsh-users/zsh/blob/master/Src/signals.c#L51