Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: sleep builtin freezes after suspending #814

Open
McDutchie opened this issue Jan 3, 2025 · 4 comments
Open

macOS: sleep builtin freezes after suspending #814

McDutchie opened this issue Jan 3, 2025 · 4 comments
Labels
bug Something is not working

Comments

@McDutchie
Copy link

Steps to reproduce:

  1. sleep 3
  2. press Ctrl+Z before it finishes (sleep builtin is forked into its own process and suspended)
  3. fg

sleep should resume and terminate, but instead, the forked sleep builtin freezes, consuming 100% CPU. Only SIGKILL (kill -9) will terminate it, although it can still be suspended again.

This is reproducible on (at least) macOS 12.7.6 arm64. I can also reproduce this on 93u+ 2012-08-01 and on ksh2020.

@McDutchie McDutchie added the bug Something is not working label Jan 3, 2025
@McDutchie
Copy link
Author

I suspect this is a bug in macOS.

@posguy99, can you reproduce this on a later macOS version?

@posguy99
Copy link

posguy99 commented Jan 3, 2025

Yes, Ventura 13.7.2 on arm64.

$ sw_vers
ProductName:		macOS
ProductVersion:		13.7.2
BuildVersion:		22H313
$ sleep 3
^Z[1] + Stopped                  sleep 3
$ fg
sleep 3

And the shell process is stuck at 100% CPU afterwards according to Activity Monitor.

@posguy99
Copy link

posguy99 commented Jan 3, 2025

Doesn't happen on a Debian x86 VM.

@posguy99
Copy link

posguy99 commented Jan 4, 2025

Here's a different behavior. Same macOS version, this is x64 vs arm64.

$ sw_vers
ProductName:		macOS
ProductVersion:		13.7.2
BuildVersion:		22H313
$ sleep 3
^Z[1] + Stopped                  sleep 3
$ fg
sleep 3
Illegal instruction
$ 

ksh-2025-01-03-212426.ips.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants