zsh-workers
 help / color / mirror / Atom feed
* Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh
@ 2021-10-06 23:05 Andrew Owen
  2021-10-07  1:03 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Owen @ 2021-10-06 23:05 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

All, 

I seem to have found a curious bug in how zsh interacts with pwsh on macOS 11.6. I first reported it to the pwsh team, here: https://github.com/PowerShell/PowerShell/issues/16174 <https://github.com/PowerShell/PowerShell/issues/16174>

With further investigation I’ve only seen zsh demonstrate the buggy die-on-resize behavior? 

Are there any recommendations for how to track down issues like this?

Thanks,

Andrew

[-- Attachment #2: Type: text/html, Size: 1629 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh
  2021-10-06 23:05 Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh Andrew Owen
@ 2021-10-07  1:03 ` Bart Schaefer
  2021-10-07  1:44   ` Andrew Owen
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2021-10-07  1:03 UTC (permalink / raw)
  To: Andrew Owen; +Cc: Zsh hackers list

On Wed, Oct 6, 2021 at 4:06 PM Andrew Owen
<andrew.owen@principlestudios.com> wrote:
>
> I seem to have found a curious bug in how zsh interacts with pwsh on macOS 11.6. I first reported it to the pwsh team, here: https://github.com/PowerShell/PowerShell/issues/16174

I presume we can ignore the typo in
https://github.com/PowerShell/PowerShell/issues/16174#issuecomment-934715868
("/usr/local/bin pwsh ...").

"Process exited 130" normally means that a QUIT signal was received
somehow.  Zsh itself ignores QUIT but restores the default behavior
when starting a subprocess, unless that signal has been explicitly
ignored (here I assume the MacOS zsh is built with POSIX_SIGNALS
defined).  The handling of INT and QUIT also changes when the zsh
MONITOR option is not set, which typically happens when zsh is not
interactive (as with #! it is not because it's running a script file).

I would suggest two things:
1) Examine the pwsh process with dtruss while attempting to reproduce
the issue, to give some hint of whether QUIT is actually being
received.  Maybe you can figure out from where.
2) Try using "exec /usr/local/bin/pwsh ..." in the script so the zsh
parent is removed from the process tree, and then try to reproduce the
issue.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh
  2021-10-07  1:03 ` Bart Schaefer
@ 2021-10-07  1:44   ` Andrew Owen
  2021-10-07  2:51     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Owen @ 2021-10-07  1:44 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1811 bytes --]



> On Oct 6, 2021, at 7:03 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> On Wed, Oct 6, 2021 at 4:06 PM Andrew Owen
> <andrew.owen@principlestudios.com> wrote:
>> 
>> I seem to have found a curious bug in how zsh interacts with pwsh on macOS 11.6. I first reported it to the pwsh team, here: https://github.com/PowerShell/PowerShell/issues/16174
> 
> I presume we can ignore the typo in
> https://github.com/PowerShell/PowerShell/issues/16174#issuecomment-934715868
> ("/usr/local/bin pwsh ...”).
Yes, that typo doesn’t exist in the actual script, Safari has some spell-correcting in place that misfires on occasion. 

> I would suggest two things:
> 1) Examine the pwsh process with dtruss while attempting to reproduce
> the issue, to give some hint of whether QUIT is actually being
> received.  Maybe you can figure out from where.

This is what I see when I target the zsh parent process (I got sidetracked with the pwsh process, which seems rather noisy from a syscall standpoint)

SYSCALL(args) 		 = return
dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
dtrace: error on enabled probe ID 2212 (ID 270: syscall::ioctl:return): invalid user access in action #5 at DIF offset 0
dtrace: error on enabled probe ID 2082 (ID 530: syscall::sigreturn:return): invalid user access in action #5 at DIF offset 0


> 2) Try using "exec /usr/local/bin/pwsh ..." in the script so the zsh
> parent is removed from the process tree, and then try to reproduce the
> issue.
This makes it so that the reproduction steps I listed before no longer lead to the crash. 


[-- Attachment #2: Type: text/html, Size: 4238 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh
  2021-10-07  1:44   ` Andrew Owen
@ 2021-10-07  2:51     ` Bart Schaefer
  2021-10-07  2:58       ` Andrew Owen
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2021-10-07  2:51 UTC (permalink / raw)
  To: Andrew Owen; +Cc: Zsh hackers list

On Wed, Oct 6, 2021 at 6:44 PM Andrew Owen
<andrew.owen@principlestudios.com> wrote:
>
> SYSCALL(args)  = return
> dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
> dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
> dtrace: error on enabled probe ID 2212 (ID 270: syscall::ioctl:return): invalid user access in action #5 at DIF offset 0
> dtrace: error on enabled probe ID 2082 (ID 530: syscall::sigreturn:return): invalid user access in action #5 at DIF offset 0

I would guess that means you need to "sudo dtruss ..."

> 2) Try using "exec /usr/local/bin/pwsh ..." in the script
>
> This makes it so that the reproduction steps I listed before no longer lead to the crash.

Well, there's your workaround, then.  It's marginally more "correct" as well.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh
  2021-10-07  2:51     ` Bart Schaefer
@ 2021-10-07  2:58       ` Andrew Owen
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Owen @ 2021-10-07  2:58 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list



> On Oct 6, 2021, at 8:51 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> On Wed, Oct 6, 2021 at 6:44 PM Andrew Owen
> <andrew.owen@principlestudios.com> wrote:
>> 
>> SYSCALL(args)  = return
>> dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
>> dtrace: error on enabled probe ID 1657 (ID 258: syscall::sigprocmask:return): invalid user access in action #5 at DIF offset 0
>> dtrace: error on enabled probe ID 2212 (ID 270: syscall::ioctl:return): invalid user access in action #5 at DIF offset 0
>> dtrace: error on enabled probe ID 2082 (ID 530: syscall::sigreturn:return): invalid user access in action #5 at DIF offset 0
> 
> I would guess that means you need to "sudo dtruss ..."

My results were gathered with "sudo dtruss -p PID", I think that macOS locks some things down more than not 

>> 2) Try using "exec /usr/local/bin/pwsh ..." in the script
>> 
>> This makes it so that the reproduction steps I listed before no longer lead to the crash.
> 
> Well, there's your workaround, then.  It's marginally more "correct" as well.

It is a viable workaround, this error seems notable for occurring only with zsh and not dash or sh on osx though.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-07  2:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 23:05 Strange terminal resizing behavior on macOS 11.6 and calling pwsh under zsh Andrew Owen
2021-10-07  1:03 ` Bart Schaefer
2021-10-07  1:44   ` Andrew Owen
2021-10-07  2:51     ` Bart Schaefer
2021-10-07  2:58       ` Andrew Owen

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ https://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git