Closed ngocphamm closed 5 years ago
Interestingly I was about to post about the same problem. It's been a regular occurrence for me in the past weeks; CPU and memory usage go high during the "removing" part. If I cancel via ctrl+c then do a brew cleanup, it also takes much longer than it used to, although it does not spike as badly as the brew upgrade.
"Good" that I'm not the only one so it might be somewhat reproducible π
I ran
brew upgrade
to upgrade all (unpinned) packages and noticed a huge spikes in both CPU and RAM usage forruby
task, and the brew process did not seem to finish until I doCtrl + C
(in the terminal). I did not wait for long this time (probably around 30 seconds) but it happened before so I know it won't stop until I doCtrl + C
.It looks like it hung trying to remove old packages or something.
You only waited 30s so I don't see any evidence that it hung. It's searching for packages that need to be upgraded.
We'll accept pull requests to improve the performance on this but this is not a bug.
I ran
brew upgrade
to upgrade all (unpinned) packages and noticed a huge spikes in both CPU and RAM usage forruby
task, and the brew process did not seem to finish until I doCtrl + C
(in the terminal). I did not wait for long this time (probably around 30 seconds) but it happened before so I know it won't stop until I doCtrl + C
. It looks like it hung trying to remove old packages or something.You only waited 30s so I don't see any evidence that it hung. It's searching for packages that need to be upgraded.
I probably should have been more clear. I only waited 30s this time, because I knew it's not gonna finish. I waited for a much longer time before (10-15 minutes) and it didn't finish either. If that's still not a bug, then okay.
But I guess I should let it try next time and maybe capture a better screenshot of it taking longer than a minute. I noticed this just because I have never seen it before the whole time I've been using homebrew (years now).
Do you have an SSD? How many packages do you have installed $(brew list | wc -l)
? If you can reproduce this with --verbose --debug
before killing: that would be useful.
Yes MBP 2015 with SSD. Not the fastest one in market (I wish) but it should not be "that" slow I would think.
brew list | wc -l
returns 155
.
I will try to do --verbose --debug
next time and see. As I said before, it didn't happen every single time so I know it's kinda annoying to debug, and I wasn't sure if it fits the "reproducible" requirement but I was glad someone else had it too. I might have something in the next few days. I run brew upgrade
a lot (just really want to keep things updated π ).
Is everything related to Homebrew on your SSD? I'm sure the answer is probably "yes".
Yes because I don't have any external HDD/SDD attached to the mac.
I've been getting this too, and the last one hung for about 30 min β didn't realize that it was still going until I was trying to figure out why my machine slowed to a crawl. But I did get the traceback info on Ctrl-C in case it's helpful. I've cut out the middle because it's all the same. Recursive call gone amuck, or cyclic graph somewhere?
Traceback (most recent call last):
6251: from /usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
6250: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:114:in `upgrade'
6249: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:367:in `check_dependents'
6248: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
6247: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
6246: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
[...]
55: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
54: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
53: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
52: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
51: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
50: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
49: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
48: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
47: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
46: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
45: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
44: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
43: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
42: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
41: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
40: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
39: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
38: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
37: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
36: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
35: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
34: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
33: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
32: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
31: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
30: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
29: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
28: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
27: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
26: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
25: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
24: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
23: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
22: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
21: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
20: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
19: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
18: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
17: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
16: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
15: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
14: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
13: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
12: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
11: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
10: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `block (2 levels) in broken_dependents'
9: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `each'
8: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `block (3 levels) in broken_dependents'
7: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `new'
6: from /usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:27:in `initialize'
5: from /usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:86:in `check_dylibs'
4: from /usr/local/Homebrew/Library/Homebrew/linkage_cache_store.rb:53:in `fetch'
3: from /usr/local/Homebrew/Library/Homebrew/linkage_cache_store.rb:23:in `keg_exists?'
2: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:31:in `get'
1: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:88:in `db'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/json/common.rb:157:in `parse': Interrupt
2: from /usr/local/Homebrew/Library/Homebrew/brew.rb:38:in `<main>'
1: from /usr/local/Homebrew/Library/Homebrew/brew.rb:138:in `rescue in <main>'
/usr/local/Homebrew/Library/Homebrew/brew.rb:138:in `exit': exit (SystemExit)
/usr/local/Homebrew/Library/Homebrew/brew.rb: Interrupt
@arbelt Please provide your brew config
output.
Okay so it just happened again. And it actually stopped (after about 5 minutes), so I apologize for saying that it didn't stop earlier. I clearly just didn't wait long enough. Not too sure about the time when I felt like I waited 10-15 minutes.
==> Upgrading 3 outdated packages:
libheif 1.5.1_1 -> 1.5.1_2
ffmpeg 4.2.1_1 -> 4.2.1_2
x265 3.2 -> 3.2.1
.... A LOT MORE VERBOSE, DEBUG MESSAGES...
Removing: /usr/local/Cellar/ffmpeg/4.2.1_1... (287 files, 56.5MB)
Removing: /usr/local/Cellar/x265/3.2... (11 files, 35.2MB)
Removing: /Users/ngoc/Library/Caches/Homebrew/x265--3.2.mojave.bottle.tar.gz... (4.8MB)
==> Checking dependents for outdated formulae
==> No dependents to upgrade
==> Checking dependents for broken library links
Error: stack level too deep
Please report this bug:
https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/pathname.rb:350:in `initialize'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/pathname.rb:350:in `new'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/pathname.rb:350:in `+'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:452:in `core_path'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:409:in `loader_for'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:317:in `factory'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:37:in `to_formula'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/delegate.rb:349:in `each'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1518:in `recursive_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1775:in `declared_runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1553:in `runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1561:in `runtime_formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:168:in `check_formula_deps'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:145:in `check_dylibs'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:27:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `new'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `block (3 levels) in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `block (2 levels) in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each_key'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
...ANOTHER ~3000 LINES SIMILAR TO THESE
It did NOT happen the time before that
==> Upgrading 1 outdated package:
composer 1.9.0 -> 1.9.1
==> Upgrading composer
.... A LOT MORE VERBOSE, DEBUG MESSAGES...
Removing: /usr/local/Cellar/composer/1.9.0... (3 files, 1.8MB)
Removing: /Users/ngoc/Library/Caches/Homebrew/composer--1.9.0.phar... (1.8MB)
==> Checking dependents for outdated formulae
==> No dependents to upgrade
==> Checking dependents for broken library links
==> No broken dependents to reinstall
This is also happened to me
brew upgrade
==> Upgrading 1 outdated package:
sqlite 3.29.0 -> 3.30.1
[...]
==> Summary
πΊ /usr/local/Cellar/sqlite/3.30.1: 11 files, 3.9MB
Removing: /usr/local/Cellar/sqlite/3.29.0... (11 files, 3.9MB)
Error: stack level too deep
Please report this bug:
https://docs.brew.sh/Troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `initialize_dup'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `+'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:452:in `core_path'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:409:in `loader_for'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:317:in `factory'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:37:in `to_formula'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1518:in `recursive_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1775:in `declared_runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1553:in `runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1561:in `runtime_formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:168:in `check_formula_deps'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:145:in `check_dylibs'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:27:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `new'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `block (3 levels) in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
[brew_upgrade_output.txt](https://github.com/Homebrew/brew/files/3801179/brew_upgrade_output.txt)
[... +- 9000 similar lines ...]
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:367:in `check_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:114:in `upgrade'
/usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
and this is my brew config if you need
HOMEBREW_VERSION: 2.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2bf8015bc44878d432fb9da4f11e1d8abcef8f32
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a45b186f5d00b5c3c32aad5001ad07e35af804da
Core tap last commit: 29 minutes ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.21.0 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 11.0.1
macOS: 10.15.1-x86_64
CLT: 1100.0.33.8
Xcode: N/A
XQuartz: 2.7.11 => /opt/X11
Same problem here.
Also, for me this is not just a problem of "poor performance", but breaks brew upgrade
. I had to kill the process after 15 minutes. By that time it used 16 GB of memory and began swapping.
brew config
:
HOMEBREW_VERSION: 2.1.15-107-g5da322d
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 5da322d6be314e5f8b1729e91e60be743a1e7d8e
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 18e37e02262fb31723ef265d3ac1aa36555a63a8
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: quad-core 64-bit sandybridge
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: 10.0 build 1000
Git: 2.23.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: N/A
XQuartz: 2.7.11 => /opt/X11
I'm having a similar issue. brew upgrade
is failing with the Error: stack level too deep
that others have posted above, followed by a very lengthy trace. During this process, I'm also seeing Ruby use several gigabytes of memory (8+ GB in my case) before failing with this error.
brew doctor
:
Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.
brew config
:
HOMEBREW_VERSION: 2.1.15-109-g5f3302b
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 5f3302b3f7b85a308289cc62a9cd7a00ffe527d4
Last commit: 5 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9fc6eaac4c4cc7e3d76c30ee8cfe098fd8fc4177
Core tap last commit: 41 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.23.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_92, 1.7.0_65
macOS: 10.15.1-x86_64
CLT: N/A
Xcode: 11.1
Linking in this Issue thread from homebrew-core, myself and others have been experiencing this since the last 12 days.
Is there any reason why some debug lines couldn't be added to upgrade.rb#check_dependents
that check for the stack trace depth and print off debug info why there is an infinite loop?
I can confirm this. I have the same issue when running brew upgrade
. The stack trace also looks similar. Posting my brew config
as I seem to be the only one on macOS 10.14 to be affected:
HOMEBREW_VERSION: 2.1.15-109-g5f3302b
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5f3302b3f7b85a308289cc62a9cd7a00ffe527d4
Last commit: 9 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 89bf3a54383d884f8b8511c6237325dd5b5ae6ba
Core tap last commit: 42 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_112
macOS: 10.14.6-x86_64
CLT: 11.0.0.0.1.1559496560
Xcode: 11.2
CLT headers: 11.0.0.0.1.1559496560
XQuartz: 2.7.11 => /opt/X11
Seeing similar behavior during brew upgrade
.
$ brew config
HOMEBREW_VERSION: 2.1.15-109-g5f3302b
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 5f3302b3f7b85a308289cc62a9cd7a00ffe527d4
Last commit: 12 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 40d7edfb0548493ddf9871fbd879095d36167978
Core tap last commit: 11 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_NO_ANALYTICS: 1
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: 10.0 build 1001
Git: 2.23.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: N/A
CLT headers: 10.3.0.0.1.1562985497
XQuartz: 2.7.11 => /opt/X11
Still seeing it here too on almost any update it does:
-> % brew config
HOMEBREW_VERSION: 2.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2bf8015bc44878d432fb9da4f11e1d8abcef8f32
Last commit: 3 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 115d708582c957638622eff95e461bffc02dc74d
Core tap last commit: 37 minutes ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.1-x86_64
CLT: N/A
Xcode: 11.1
Upgrading ruby-build
==> Downloading https://github.com/rbenv/ruby-build/archive/v20191102.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20191102
######################################################################## 100.0%
==> ./install.sh
πΊ /usr/local/Cellar/ruby-build/20191102: 461 files, 231KB, built in 5 seconds
Removing: /usr/local/Cellar/ruby-build/20191024... (460 files, 230.2KB)
Removing: /Users/john/Library/Caches/Homebrew/ruby-build--20191024.tar.gz... (62.1KB)
Removing: /usr/local/Cellar/x265/3.2... (11 files, 35.2MB)
Removing: /Users/john/Library/Caches/Homebrew/x265--3.2.catalina.bottle.tar.gz... (4.8MB)
^[[A^[[B
Error: stack level too deep
Please report this bug:
https://docs.brew.sh/Troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `initialize_dup'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:350:in `+'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:452:in `core_path'
/usr/local/Homebrew/Library/Homebrew/formula.rb:185:in `initialize'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:114:in `new'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:114:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:317:in `factory'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:37:in `to_formula'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:105:in `block in expand'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:87:in `expand'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1518:in `recursive_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1775:in `declared_runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1553:in `runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1561:in `runtime_formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:168:in `check_formula_deps'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:145:in `check_dylibs'
/usr/local/Homebrew/Library/Homebrew/linkage_checker.rb:27:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `new'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:280:in `block (3 levels) in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:274:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
/usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
Can confirm this on macOS Catalina 10.15 on MacBook Air Early 2015, 4GB RAM and 128GB SSD. Process ruby
ate like 11 GiB of RAM in Activity Monitor. The hang happened in the end of a brew upgrade
session while seemingly cleaning old packages:
brett@brettdeMacBook-Air ~ % brew update
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-drivers).
==> New Formulae
manticoresearch
==> Updated Formulae
cmake β ack flake8 gmt itk kyma-cli nvm qt tile38 yq
git β dcmtk flyway gtk-gnutella jfrog-cli-go libssh offlineimap siril ucloud
harfbuzz β deark git-delta hydra jsvc mercurial php-cs-fixer sourcedocs yafc
==> Deleted Formulae
gmtl
brett@brettdeMacBook-Air ~ % brew upgrade
Updating Homebrew...
==> Upgrading 3 outdated packages:
cmake 3.15.4 -> 3.15.5
harfbuzz 2.6.2 -> 2.6.4
git 2.23.0_1 -> 2.24.0
==> Upgrading cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.15.5.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/46/46b47f448f7690bbed70526a42f27bea54aa7562c9eefb86955102fc83d1366d?__gda__=exp=1572872894~hmac=c816357ca95721844f93b11ed5b3bfe2a4
######################################################################## 100.0%
==> Pouring cmake-3.15.5.catalina.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> Summary
πΊ /usr/local/Cellar/cmake/3.15.5: 5,801 files, 53.4MB
Removing: /usr/local/Cellar/cmake/3.15.4... (5,800 files, 53.4MB)
Removing: /Users/brett/Library/Caches/Homebrew/cmake--3.15.4.mojave.bottle.tar.gz... (15.0MB)
==> Upgrading harfbuzz
==> Downloading https://homebrew.bintray.com/bottles/harfbuzz-2.6.4.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/fe/feed99de447de882a40417ee9b0739faf8827d01d3dfb25f01d89e73aa1f2444?__gda__=exp=1572872947~hmac=fb99662388a212688b2c9548193a7d5fb2
######################################################################## 100.0%
==> Pouring harfbuzz-2.6.4.catalina.bottle.tar.gz
πΊ /usr/local/Cellar/harfbuzz/2.6.4: 158 files, 10.8MB
Removing: /usr/local/Cellar/harfbuzz/2.6.2... (158 files, 10.6MB)
Removing: /Users/brett/Library/Caches/Homebrew/harfbuzz--2.6.2.mojave.bottle.tar.gz... (2.5MB)
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.24.0.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/fa/fa754c684673a191b999528995c1dc4b0d597a95ed6a2b1dd213c8e7018885ab?__gda__=exp=1572872975~hmac=ff56453a9f40531c2800478e78eb2498b2
######################################################################## 100.0%
==> Pouring git-2.24.0.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions and functions have been installed to:
/usr/local/share/zsh/site-functions
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> Summary
πΊ /usr/local/Cellar/git/2.24.0: 1,547 files, 45.5MB
Removing: /usr/local/Cellar/git/2.23.0_1... (1,543 files, 44.9MB)
Removing: /Users/brett/Library/Caches/Homebrew/git--2.23.0.mojave.bottle.tar.gz... (17.1MB)
Removing: /Users/brett/Library/Caches/Homebrew/git--2.23.0_1.mojave.bottle.tar.gz... (17.1MB)
^C^C^C^C^C^C^C^C
Traceback (most recent call last):
4282: from /usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
4281: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:114:in `upgrade'
4280: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:367:in `check_dependents'
4279: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
4278: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
4277: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
4276: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `each'
4275: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
4274: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
4273: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
4272: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
4271: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
4270: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
4269: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
4268: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
4267: from /usr/local/Homebrew/Library/Homebrew/cache_store.rb:17:in `use'
4266: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:263:in `block in broken_dependents'
4265: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each'
4264: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:338:in `each_key'
4263: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:296:in `block (2 levels) in broken_dependents'
4262: from /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:262:in `broken_dependents'
and thousands of lines until
5: from /usr/local/Homebrew/Library/Homebrew/formula.rb:543:in `prefix'
4: from /usr/local/Homebrew/Library/Homebrew/formula.rb:377:in `pkg_version'
3: from /usr/local/Homebrew/Library/Homebrew/formula.rb:377:in `new'
2: from /usr/local/Homebrew/Library/Homebrew/pkg_version.rb:21:in `initialize'
1: from /usr/local/Homebrew/Library/Homebrew/pkg_version.rb:21:in `initialize'
/usr/local/Homebrew/Library/Homebrew/pkg_version.rb:21:in `initialize': Interrupt
2: from /usr/local/Homebrew/Library/Homebrew/brew.rb:38:in `<main>'
1: from /usr/local/Homebrew/Library/Homebrew/brew.rb:138:in `rescue in <main>'
/usr/local/Homebrew/Library/Homebrew/brew.rb:138:in `exit': exit (SystemExit)
/usr/local/Homebrew/Library/Homebrew/brew.rb: Interrupt
^C^C^C^C
Output of brew doctor
and brew config
:
brett@brettdeMacBook-Air ~ % brew doctor
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: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
brett@brettdeMacBook-Air ~ % brew config
HOMEBREW_VERSION: 2.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2bf8015bc44878d432fb9da4f11e1d8abcef8f32
Last commit: 3 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a34d39a63d090f1c5d4ccb7be7149195dc8059df
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_181
macOS: 10.15-x86_64
CLT: N/A
Xcode: 11.1
XQuartz: 2.7.11 => /opt/X11
I also experience similar issues with 'brew update', but I get consistent crash in ruby during that command.
result of the brew config
output
HOMEBREW_VERSION: 2.1.15-116-g33330ba
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 33330ba5b1b9776bb696d1b0dfbeee8e1e23dc4a
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a34d39a63d090f1c5d4ccb7be7149195dc8059df
Core tap last commit: 87 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
HOMEBREW_VISUAL: nano
CPU: quad-core 64-bit sandybridge
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_131, 1.8.0_40
macOS: 10.15-x86_64
CLT: N/A
Xcode: 11.1
XQuartz: 2.7.11 => /opt/X11
This crash has been happening in the last few weeks. It leads to filling up the memory of the computer till the brew upgrade
process crashes. I hope it leads to some solution.
Also the message from the crash stacktrace says to find the crash report from the ~/Library/Logs/DiagnosticReports
and /Library/Logs/DiagnosticReports
, but I can't find anything there related to the crash in ruby.
My suspicion in relation to the crash could be caused to the data malformation in the data cache used by brew, and there must be some way to verify the integrity of that cache to prevent such kinds of crashes.
Best regards
Everyone is going to see the same issue. Please do not comment here unless you have something new to add above what others have said that will make it easier for maintainers to fix this issue. That includes reproducible instructions (no-one has provided any yet) which makes it much harder to fix this problem.
Sorry to sound picky, but "reproducible instructions", per pretty much every report in this issue and others, are: Do a brew upgrade
. Unfortunately once a package is updated, it's hard to reproduce it until the package releases a new version....
@MikeMcQuaid I can pretty much agree on the not posting the same thing over and over again without new info, but please let us know your definition of "reproducible instructions" as I'm pretty sure I provided it in my very first post, with a note that I wasn't sure if it's trully "reproducible" because it does not happen to me 100% of the time. Now that so many people have chimed in saying they have the exact same issue (and at least a few said it happend to them every time), with pretty much the same steps (basically just brew upgrade
), what do you mean "no-one has provided any yet"?
Sorry to sound picky, but "reproducible instructions", per pretty much every report in this issue and others, are: Do a brew upgrade.
@jtsom I have run brew upgrade
many times and do not encounter this issue. Therefore: those are not reproducible instructions.
what do you mean "no-one has provided any yet"?
For "reproducible" instructions I mean "instructions which you can use with a clean Homebrew installation on any machine where the issue will happen every time you follow those instructions".
I appreciate that going from "this happened on my machine" to those instructions is non-trivial but that's what someone will need to do in order to fix this issue. It's likely for this to be fixed in a timely fashion that person will be me (please prove me wrong, though, PRs always very welcome!) and I have a tight work deadline which means I cannot dedicate as much time as I'd like to work on stuff like this.
I couldn't notice anything which could help. It happens every time I run brew upgrade
. I run at least once a day brew update
using crontab. The only strange thing was seeing is that there were uncommitted changes in /usr/local/Homebrew/Library
Warning: You have uncommitted modifications to Homebrew.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
cd /usr/local/Homebrew/Library && git stash && git clean -d -f
``` /usr/local/Homebrew/Library/Taps/homebrew (master*) $ git st ## master...origin/master ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/bytes.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/chars.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/each.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/each_byte.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/each_char.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/each_line.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/getbyte.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/lines.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/argf/readbyte.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/array.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/array/collect.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/array/combination.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/array/cycle.rb ?? ../../Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.15.0/lib/backports/1.8.7/array/delete_if.rb ... ```
Not sure if this is related. Fixing using suggestion from brew doctor
, did not help with the loop on upgrade.
If it helps, I have few taps configured.
@sashkab Sorry to be forceful but: please do not comment unless you have reproducible instructions you can provide which (you suspect) will work on my machine where a clean brew upgrade
does not reproduce this.
@MikeMcQuaid Gotcha!
I know it's hard to trace bugs like this, and I totally agree that having a trully reproducible procedure, especially on the maintainer's machine, would help a ton on getting the bug fix, but I guess this is just a strange issue, and could be that one package everyone here has installed.
Also, I'm sure no one is expecting the bugs are always fixed in a timely fashion because this is an open-source project, and we all really appreciate you guys effort putting on maintain this for all of us to use, so please relax we are not pushing you or anything. Please bear with us while we try to post things that might narrow this down, for you.
The 'reproducible instructions' is a fallacy for me if it is done on a clean system.
As a software engineer, I have to take in consideration the following scenario, that the user of my software is providing a crash report of my software on his computer system, because I have to accept the dirty state of the user's system (as a result of operating system upgrade, filesystem upgrade, etc.), so I have to design the storage of the software data that must be agnostic to these kind of changes to the OS version or filesystem version, and as such, I've adopted the principle to develop additional tools to ensure that the integrity of the saved data is respected (some of those tools would be bundled with my software).
As for my report of the crash in my previous comment, I've used brew since El Capitan, and I've dirty upgraded since then to Catalina without issues and even upgraded the filesystem from HPFS+ to APFS and I have not experienced any issues with the other installed software. Only brew upgrade
started this symptom of crashing since Mojave 10.14.5 (at that time there was no issue reported in relation to brew upgrade
), so I've waited till a similar issue popped up.
I've also used the command brew update-reset
in hope that the brew cache data is checked for integrity, alas no such thing.
Similar or same issue here, also for last 3 weeks or so, also intermittent (and therefore tough for me to give definite instructions on how to reproduce). This morning I let brew upgrade && brew cleanup
run for about 20 minutes before noting it was stuck again, this time with 28 GB of memory usage. Always gets stuck at the Removing:
stage.
==> Pouring hydra-9.0_2.catalina.bottle.tar.gz
πΊ /usr/local/Cellar/hydra/9.0_2: 16 files, 1.4MB
Removing: /usr/local/Cellar/hydra/9.0_1... (16 files, 1.4MB)
^C
This time with hydra
, I definitely remember it happening with bazel
recently as well, also at the Removing:
stage.
Every time if I kill the process with Ctrl C, I can re-run the previous command and it immediately completes successfully. I'll start running with the --verbose
flag just in case I can catch it to help collaborate on one of us getting a reproducible build.
I did run a sample in Activity Monitor prior to killing and saw similar output to what @jtsom posted above. Sorry, closed it before finding this thread.
EDIT:
$ brew config
HOMEBREW_VERSION: 2.1.15-116-g33330ba
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 33330ba5b1b9776bb696d1b0dfbeee8e1e23dc4a
Last commit: 6 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1ea069b7107b9c08771a39795535425e7ca37849
Core tap last commit: 78 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_VISUAL: nvim
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_66
macOS: 10.15-x86_64
CLT: 1100.0.33.8
Xcode: 11.1
XQuartz: 2.7.11 => /opt/X11
People: please, PLEASE stop posting duplicate comments. The time taken to read them is literally taken from the time I have to fix the issue. The more people who post comments on this issue the longer it's going to take me to fix it. I've hidden all those that don't add information to this thread to make it easier to follow. Unless you have something really, really, really important to add (i.e. reproducibility instructions): do not post to this thread!
Particularly please do not post some comment about how you don't agree with how we're handling reproducibility or about your experience as an engineer: it's distracting, demotivating and unhelpful.
Probably you may have a higher probability of running into this issue when App Store is updating apps in the background. I encountered this issue twice when App Store is updating Xcode.
edit: but anyway I am not sure if this really relates to the cause of this issue
brew upgrade
is back to normal for me. What's changed since the last time I was consistently seeing this issue is that I upgraded Xcode, so perhaps @BrettDong is on to something. I have no idea.
Here's my brew config
now:
HOMEBREW_VERSION: 2.1.15-116-g33330ba
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 33330ba5b1b9776bb696d1b0dfbeee8e1e23dc4a
Last commit: 6 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1ea069b7107b9c08771a39795535425e7ca37849
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_92, 1.7.0_65
macOS: 10.15.1-x86_64
CLT: N/A
Xcode: 11.2
You can compare it to my brew config
from before. The key differences appear to be:
To the folks still seeing this issue, perhaps try to apply any pending macOS or App Store updates, reboot, and then give brew upgrade
another shot.
Locking because people apparently can't resist posting more comments that add no information. If you figure out a reproducible test-case: email me.
I should have perhaps predicted this but: unless you have read the whole issue thread and understand what a "reproducible test case" is and don't want to otherwise offer to help/apologise/say "me too" please stop emailing me. I've got almost ten emails about this in less than a day.
brew update
before posting anything here please and don't post any "thanks" or "fixed for me" here, thanks.@MikeMcQuaid - I was (eventually) able to reproduce this reliably locally and have opened a PR (#6695)
2.1.16 temporarily disabled this check entirely. 2.1.17 (or >2.1.16 on the master
branch) re-enables this, dramatically improves performance and adds more messages (without needing to use --verbose
) to explain what's going on. This should resolve all problems and, when/if it doesn't, will help debug what exactly is going wrong.
I've released 2.1.16 which disables this functionality entirely until I rewrite it. If you hit this bug:
brew update
before posting anything here please and don't post any "thanks" or "fixed for me" here, thanks. (@MikeMcQuaid)I am not sure about the "reproducible" part because it does not happen every single time I do
brew upgrade
but a handful of times alread.I also notice this seems to start happening since the portable ruby is being downloaded, and used by brew.
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
I ran
brew upgrade
to upgrade all (unpinned) packages and noticed a huge spikes in both CPU and RAM usage forruby
task, and the brew process did not seem to finish until I doCtrl + C
(in the terminal). I did not wait for long this time (probably around 30 seconds) but it happened before so I know it won't stop until I doCtrl + C
.It looks like it hung trying to remove old packages or something.
What happened (include command output)
I'm not sure if this might caused by one (or more) packages I tried to upgrade.
Command output
What you expected to happen
The
brew upgrade
process successfully upgrades the packages, and stops executing, leaving noruby
process behind taking CPU and RAM resources.Step-by-step reproduction instructions (by running
brew
commands)brew update
brew upgrade
to upgrade the packages (brewug
is my alias)