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

mac [Intel-chip]: flutter commands are throwing Exhausted heap space, trying to allocate 32 bytes. ../../runtime/vm/object.cc: 2717: error: Out of memory. error #104387

Closed
darshankawar opened this issue May 23, 2022 · 35 comments
Assignees
Labels
a: first hour The first hour of using Flutter c: crash Stack traces logged to the console dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P0 Critical issues such as a build break or regression perf: memory Performance issues related to memory platform-mac Building on or for macOS specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@darshankawar
Copy link
Member

darshankawar commented May 23, 2022

There is a work around for this bug

Workaround: This has been fixed upstream--if your installation is broken you can unbreak it by checking out 0015ed2b754109f37ab811673de2050f559c7c3e (or later) or by stripping the signature via codesign --remove-signature bin/cache/dart-sdk/bin/dart

Bug

Since today morning, we observed that running any flutter command such as flutter upgrade or flutter channel is throwing below error only on intel-chip mac machines.

Exhausted heap space, trying to allocate 32 bytes. ../../runtime/vm/object.cc: 2717: error: Out of memory.

Below is complete log for flutter upgrade --force and flutter channel:

flutter upgrade --force log


dhs@Dhss-MacBook-Pro ~ % flutter upgrade --force
Upgrading Flutter to 3.1.0-0.0.pre.854 from 3.1.0-0.0.pre.820 in
/Users/dhs/documents/fluttersdk/flutter...
Downloading Darwin x64 Dart SDK from Flutter engine 1bfe551d6b5adec64bb677cbb31ffd56c5acff49...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0  188M    0 22120    0     0  20540      0  2:40:23  0:00:01  2:40:22 20867
  2  188M    2 4256k    0     0  2884k      0  0:01:06  0:00:01  0:01:05 2917k
  7  188M    7 15.0M    0     0  6219k      0  0:00:31  0:00:02  0:00:29 6261k
 13  188M   13 25.7M    0     0  7576k      0  0:00:25  0:00:03  0:00:22 7612k
 19  188M   19 36.7M    0     0  8420k      0  0:00:22  0:00:04  0:00:18 8450k
 24  188M   24 46.2M    0     0  8661k      0  0:00:22  0:00:05  0:00:17 10.5M
 30  188M   30 57.5M    0     0  9101k      0  0:00:21  0:00:06  0:00:15 10.6M
 36  188M   36 68.0M    0     0  9334k      0  0:00:20  0:00:07  0:00:13 10.6M
 41  188M   41 79.0M    0     0  9554k      0  0:00:20  0:00:08  0:00:12 10.6M
 47  188M   47 89.5M    0     0  9682k      0  0:00:19  0:00:09  0:00:10 10.5M
 53  188M   53  100M    0     0  9802k      0  0:00:19  0:00:10  0:00:09 10.7M
 59  188M   59  111M    0     0  9932k      0  0:00:19  0:00:11  0:00:08 10.7M
 64  188M   64  121M    0     0   9.7M      0  0:00:19  0:00:12  0:00:07 10.7M
 70  188M   70  132M    0     0   9.8M      0  0:00:19  0:00:13  0:00:06 10.7M
 76  188M   76  143M    0     0   9.9M      0  0:00:18  0:00:14  0:00:04 10.8M
 82  188M   82  154M    0     0   9.9M      0  0:00:18  0:00:15  0:00:03 10.8M
 87  188M   87  165M    0     0  10.0M      0  0:00:18  0:00:16  0:00:02 10.7M
 93  188M   93  175M    0     0  10.0M      0  0:00:18  0:00:17  0:00:01 10.8M
 94  188M   94  178M    0     0  9863k      0  0:00:19  0:00:18  0:00:01 9282k
 99  188M   99  186M    0     0  9825k      0  0:00:19  0:00:19 --:--:-- 8832k
100  188M  100  188M    0     0  9842k      0  0:00:19  0:00:19 --:--:-- 8364k
Building flutter tool...
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1026, thread=259, isolate_group=vm-isolate(0x7fddb4808a00), isolate=vm-isolate(0x7fddb480d600)
isolate_instructions=10a951a80, vm_instructions=10a951a80
  pc 0x000000010abb9a64 fp 0x00007ff7b5611b20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010a951c54 fp 0x00007ff7b5611c00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010ab399c7 fp 0x00007ff7b5611c50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010ab69c21 fp 0x00007ff7b5611cc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010ab6a011 fp 0x00007ff7b5611cf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010ac3c89c fp 0x00007ff7b5611e10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010ac3c760 fp 0x00007ff7b5611ec0 dart::StubCode::Init()+0xc0
  pc 0x000000010aab9939 fp 0x00007ff7b5612500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010aab9bef fp 0x00007ff7b5612510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010a92ae20 fp 0x00007ff7b5612650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010a92be29 fp 0x00007ff7b5612660 main+0x9
  pc 0x000000010f69f4fe fp 0x00007ff7b5612770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1026 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1049, thread=259, isolate_group=vm-isolate(0x7f8a56808a00), isolate=vm-isolate(0x7f8a5680d600)
isolate_instructions=1068a3a80, vm_instructions=1068a3a80
  pc 0x0000000106b0ba64 fp 0x00007ff7b96bfb20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x00000001068a3c54 fp 0x00007ff7b96bfc00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x0000000106a8b9c7 fp 0x00007ff7b96bfc50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000106abbc21 fp 0x00007ff7b96bfcc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000106abc011 fp 0x00007ff7b96bfcf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x0000000106b8e89c fp 0x00007ff7b96bfe10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000106b8e760 fp 0x00007ff7b96bfec0 dart::StubCode::Init()+0xc0
  pc 0x0000000106a0b939 fp 0x00007ff7b96c0500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000106a0bbef fp 0x00007ff7b96c0510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010687ce20 fp 0x00007ff7b96c0650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010687de29 fp 0x00007ff7b96c0660 main+0x9
  pc 0x00000001164844fe fp 0x00007ff7b96c0770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1049 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1052, thread=259, isolate_group=vm-isolate(0x7f7dad009a00), isolate=vm-isolate(0x7f7dad00e600)
isolate_instructions=10dd74a80, vm_instructions=10dd74a80
  pc 0x000000010dfdca64 fp 0x00007ff7b21eeb20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010dd74c54 fp 0x00007ff7b21eec00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010df5c9c7 fp 0x00007ff7b21eec50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010df8cc21 fp 0x00007ff7b21eecc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010df8d011 fp 0x00007ff7b21eecf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010e05f89c fp 0x00007ff7b21eee10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010e05f760 fp 0x00007ff7b21eeec0 dart::StubCode::Init()+0xc0
  pc 0x000000010dedc939 fp 0x00007ff7b21ef500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010dedcbef fp 0x00007ff7b21ef510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010dd4de20 fp 0x00007ff7b21ef650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010dd4ee29 fp 0x00007ff7b21ef660 main+0x9
  pc 0x00000001168474fe fp 0x00007ff7b21ef770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1052 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1055, thread=259, isolate_group=vm-isolate(0x7fa3d5808a00), isolate=vm-isolate(0x7fa3d580d600)
isolate_instructions=10794aa80, vm_instructions=10794aa80
  pc 0x0000000107bb2a64 fp 0x00007ff7b8618b20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010794ac54 fp 0x00007ff7b8618c00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x0000000107b329c7 fp 0x00007ff7b8618c50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000107b62c21 fp 0x00007ff7b8618cc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000107b63011 fp 0x00007ff7b8618cf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x0000000107c3589c fp 0x00007ff7b8618e10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000107c35760 fp 0x00007ff7b8618ec0 dart::StubCode::Init()+0xc0
  pc 0x0000000107ab2939 fp 0x00007ff7b8619500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000107ab2bef fp 0x00007ff7b8619510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000107923e20 fp 0x00007ff7b8619650 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000107924e29 fp 0x00007ff7b8619660 main+0x9
  pc 0x000000010e0af4fe fp 0x00007ff7b8619770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1055 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1058, thread=259, isolate_group=vm-isolate(0x7f9c4f809400), isolate=vm-isolate(0x7f9c4f80e000)
isolate_instructions=10c8eea80, vm_instructions=10c8eea80
  pc 0x000000010cb56a64 fp 0x00007ff7b3674b20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010c8eec54 fp 0x00007ff7b3674c00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010cad69c7 fp 0x00007ff7b3674c50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010cb06c21 fp 0x00007ff7b3674cc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010cb07011 fp 0x00007ff7b3674cf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010cbd989c fp 0x00007ff7b3674e10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010cbd9760 fp 0x00007ff7b3674ec0 dart::StubCode::Init()+0xc0
  pc 0x000000010ca56939 fp 0x00007ff7b3675500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010ca56bef fp 0x00007ff7b3675510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010c8c7e20 fp 0x00007ff7b3675650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010c8c8e29 fp 0x00007ff7b3675660 main+0x9
  pc 0x00000001128184fe fp 0x00007ff7b3675770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1058 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1061, thread=259, isolate_group=vm-isolate(0x7f8628008a00), isolate=vm-isolate(0x7f862800d600)
isolate_instructions=10c0d8a80, vm_instructions=10c0d8a80
  pc 0x000000010c340a64 fp 0x00007ff7b3e8ab20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010c0d8c54 fp 0x00007ff7b3e8ac00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010c2c09c7 fp 0x00007ff7b3e8ac50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010c2f0c21 fp 0x00007ff7b3e8acc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010c2f1011 fp 0x00007ff7b3e8acf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010c3c389c fp 0x00007ff7b3e8ae10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010c3c3760 fp 0x00007ff7b3e8aec0 dart::StubCode::Init()+0xc0
  pc 0x000000010c240939 fp 0x00007ff7b3e8b500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010c240bef fp 0x00007ff7b3e8b510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010c0b1e20 fp 0x00007ff7b3e8b650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010c0b2e29 fp 0x00007ff7b3e8b660 main+0x9
  pc 0x000000011c80d4fe fp 0x00007ff7b3e8b770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1061 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (4 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1064, thread=259, isolate_group=vm-isolate(0x7fc0d9013a00), isolate=vm-isolate(0x7fc0d9018000)
isolate_instructions=10ed85a80, vm_instructions=10ed85a80
  pc 0x000000010efeda64 fp 0x00007ff7b11ddb20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010ed85c54 fp 0x00007ff7b11ddc00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010ef6d9c7 fp 0x00007ff7b11ddc50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010ef9dc21 fp 0x00007ff7b11ddcc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010ef9e011 fp 0x00007ff7b11ddcf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010f07089c fp 0x00007ff7b11dde10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010f070760 fp 0x00007ff7b11ddec0 dart::StubCode::Init()+0xc0
  pc 0x000000010eeed939 fp 0x00007ff7b11de500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010eeedbef fp 0x00007ff7b11de510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010ed5ee20 fp 0x00007ff7b11de650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010ed5fe29 fp 0x00007ff7b11de660 main+0x9
  pc 0x00000001207874fe fp 0x00007ff7b11de770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1064 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (3 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1070, thread=259, isolate_group=vm-isolate(0x7f8f33008a00), isolate=vm-isolate(0x7f8f3300d600)
isolate_instructions=10378da80, vm_instructions=10378da80
  pc 0x00000001039f5a64 fp 0x00007ff7bc7d5b20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010378dc54 fp 0x00007ff7bc7d5c00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001039759c7 fp 0x00007ff7bc7d5c50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x00000001039a5c21 fp 0x00007ff7bc7d5cc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x00000001039a6011 fp 0x00007ff7bc7d5cf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x0000000103a7889c fp 0x00007ff7bc7d5e10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000103a78760 fp 0x00007ff7bc7d5ec0 dart::StubCode::Init()+0xc0
  pc 0x00000001038f5939 fp 0x00007ff7bc7d6500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x00000001038f5bef fp 0x00007ff7bc7d6510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000103766e20 fp 0x00007ff7bc7d6650 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000103767e29 fp 0x00007ff7bc7d6660 main+0x9
  pc 0x000000010baf94fe fp 0x00007ff7bc7d6770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1070 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (2 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=1073, thread=259, isolate_group=vm-isolate(0x7f78af009a00), isolate=vm-isolate(0x7f78af00e600)
isolate_instructions=10c81ba80, vm_instructions=10c81ba80
  pc 0x000000010ca83a64 fp 0x00007ff7b3747b20 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010c81bc54 fp 0x00007ff7b3747c00 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010ca039c7 fp 0x00007ff7b3747c50 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010ca33c21 fp 0x00007ff7b3747cc0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010ca34011 fp 0x00007ff7b3747cf0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010cb0689c fp 0x00007ff7b3747e10 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010cb06760 fp 0x00007ff7b3747ec0 dart::StubCode::Init()+0xc0
  pc 0x000000010c983939 fp 0x00007ff7b3748500 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010c983bef fp 0x00007ff7b3748510 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010c7f4e20 fp 0x00007ff7b3748650 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010c7f5e29 fp 0x00007ff7b3748660 main+0x9
  pc 0x00000001188244fe fp 0x00007ff7b3748770 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  1073 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
Command 'pub upgrade' still failed after 10 tries, giving up.

flutter channel log

dhs@Dhss-MacBook-Pro ~ % flutter channel
Building flutter tool...
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3038, thread=259, isolate_group=vm-isolate(0x7f9e44813e00), isolate=vm-isolate(0x7f9e44818400)
isolate_instructions=10801aa80, vm_instructions=10801aa80
  pc 0x0000000108282a64 fp 0x00007ff7b7f48b90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010801ac54 fp 0x00007ff7b7f48c70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001082029c7 fp 0x00007ff7b7f48cc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000108232c21 fp 0x00007ff7b7f48d30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000108233011 fp 0x00007ff7b7f48d60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010830589c fp 0x00007ff7b7f48e80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000108305760 fp 0x00007ff7b7f48f30 dart::StubCode::Init()+0xc0
  pc 0x0000000108182939 fp 0x00007ff7b7f49570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000108182bef fp 0x00007ff7b7f49580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000107ff3e20 fp 0x00007ff7b7f496c0 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000107ff4e29 fp 0x00007ff7b7f496d0 main+0x9
  pc 0x0000000111cd94fe fp 0x00007ff7b7f497e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3038 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3042, thread=259, isolate_group=vm-isolate(0x7fcaa3009400), isolate=vm-isolate(0x7fcaa300e000)
isolate_instructions=108c4ea80, vm_instructions=108c4ea80
  pc 0x0000000108eb6a64 fp 0x00007ff7b7314b90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x0000000108c4ec54 fp 0x00007ff7b7314c70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x0000000108e369c7 fp 0x00007ff7b7314cc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000108e66c21 fp 0x00007ff7b7314d30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000108e67011 fp 0x00007ff7b7314d60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x0000000108f3989c fp 0x00007ff7b7314e80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000108f39760 fp 0x00007ff7b7314f30 dart::StubCode::Init()+0xc0
  pc 0x0000000108db6939 fp 0x00007ff7b7315570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000108db6bef fp 0x00007ff7b7315580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000108c27e20 fp 0x00007ff7b73156c0 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000108c28e29 fp 0x00007ff7b73156d0 main+0x9
  pc 0x00000001112224fe fp 0x00007ff7b73157e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3042 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3045, thread=259, isolate_group=vm-isolate(0x7fc9c380a200), isolate=vm-isolate(0x7fc9c380ee00)
isolate_instructions=10c7d8a80, vm_instructions=10c7d8a80
  pc 0x000000010ca40a64 fp 0x00007ff7b378ab90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010c7d8c54 fp 0x00007ff7b378ac70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010c9c09c7 fp 0x00007ff7b378acc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010c9f0c21 fp 0x00007ff7b378ad30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010c9f1011 fp 0x00007ff7b378ad60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010cac389c fp 0x00007ff7b378ae80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010cac3760 fp 0x00007ff7b378af30 dart::StubCode::Init()+0xc0
  pc 0x000000010c940939 fp 0x00007ff7b378b570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010c940bef fp 0x00007ff7b378b580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010c7b1e20 fp 0x00007ff7b378b6c0 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010c7b2e29 fp 0x00007ff7b378b6d0 main+0x9
  pc 0x00000001146b74fe fp 0x00007ff7b378b7e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3045 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3049, thread=259, isolate_group=vm-isolate(0x7f80a0009400), isolate=vm-isolate(0x7f80a000e000)
isolate_instructions=1091dfa80, vm_instructions=1091dfa80
  pc 0x0000000109447a64 fp 0x00007ff7b6d83b90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x00000001091dfc54 fp 0x00007ff7b6d83c70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001093c79c7 fp 0x00007ff7b6d83cc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x00000001093f7c21 fp 0x00007ff7b6d83d30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x00000001093f8011 fp 0x00007ff7b6d83d60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x00000001094ca89c fp 0x00007ff7b6d83e80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x00000001094ca760 fp 0x00007ff7b6d83f30 dart::StubCode::Init()+0xc0
  pc 0x0000000109347939 fp 0x00007ff7b6d84570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000109347bef fp 0x00007ff7b6d84580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x00000001091b8e20 fp 0x00007ff7b6d846c0 dart::bin::main(int, char**)+0x4a0
  pc 0x00000001091b9e29 fp 0x00007ff7b6d846d0 main+0x9
  pc 0x000000010e7e54fe fp 0x00007ff7b6d847e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3049 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3052, thread=259, isolate_group=vm-isolate(0x7fa337008a00), isolate=vm-isolate(0x7fa33700d600)
isolate_instructions=108416a80, vm_instructions=108416a80
  pc 0x000000010867ea64 fp 0x00007ff7b7b4cb90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x0000000108416c54 fp 0x00007ff7b7b4cc70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001085fe9c7 fp 0x00007ff7b7b4ccc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010862ec21 fp 0x00007ff7b7b4cd30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010862f011 fp 0x00007ff7b7b4cd60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010870189c fp 0x00007ff7b7b4ce80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000108701760 fp 0x00007ff7b7b4cf30 dart::StubCode::Init()+0xc0
  pc 0x000000010857e939 fp 0x00007ff7b7b4d570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010857ebef fp 0x00007ff7b7b4d580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x00000001083efe20 fp 0x00007ff7b7b4d6c0 dart::bin::main(int, char**)+0x4a0
  pc 0x00000001083f0e29 fp 0x00007ff7b7b4d6d0 main+0x9
  pc 0x000000011199c4fe fp 0x00007ff7b7b4d7e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3052 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3056, thread=259, isolate_group=vm-isolate(0x7f7dd8808a00), isolate=vm-isolate(0x7f7dd880d600)
isolate_instructions=105177a80, vm_instructions=105177a80
  pc 0x00000001053dfa64 fp 0x00007ff7badebb90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x0000000105177c54 fp 0x00007ff7badebc70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010535f9c7 fp 0x00007ff7badebcc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010538fc21 fp 0x00007ff7badebd30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000105390011 fp 0x00007ff7badebd60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010546289c fp 0x00007ff7badebe80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000105462760 fp 0x00007ff7badebf30 dart::StubCode::Init()+0xc0
  pc 0x00000001052df939 fp 0x00007ff7badec570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x00000001052dfbef fp 0x00007ff7badec580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000105150e20 fp 0x00007ff7badec6c0 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000105151e29 fp 0x00007ff7badec6d0 main+0x9
  pc 0x00000001123994fe fp 0x00007ff7badec7e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3056 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (4 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3059, thread=259, isolate_group=vm-isolate(0x7fb1c8808a00), isolate=vm-isolate(0x7fb1c880d600)
isolate_instructions=10a19da80, vm_instructions=10a19da80
  pc 0x000000010a405a64 fp 0x00007ff7b5dc5b90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010a19dc54 fp 0x00007ff7b5dc5c70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000000010a3859c7 fp 0x00007ff7b5dc5cc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x000000010a3b5c21 fp 0x00007ff7b5dc5d30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x000000010a3b6011 fp 0x00007ff7b5dc5d60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010a48889c fp 0x00007ff7b5dc5e80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010a488760 fp 0x00007ff7b5dc5f30 dart::StubCode::Init()+0xc0
  pc 0x000000010a305939 fp 0x00007ff7b5dc6570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x000000010a305bef fp 0x00007ff7b5dc6580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x000000010a176e20 fp 0x00007ff7b5dc66c0 dart::bin::main(int, char**)+0x4a0
  pc 0x000000010a177e29 fp 0x00007ff7b5dc66d0 main+0x9
  pc 0x0000000117fb24fe fp 0x00007ff7b5dc67e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3059 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (3 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3063, thread=259, isolate_group=vm-isolate(0x7fef7080a400), isolate=vm-isolate(0x7fef7080f000)
isolate_instructions=1018dca80, vm_instructions=1018dca80
  pc 0x0000000101b44a64 fp 0x00007ff7be686b90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x00000001018dcc54 fp 0x00007ff7be686c70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x0000000101ac49c7 fp 0x00007ff7be686cc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000101af4c21 fp 0x00007ff7be686d30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000101af5011 fp 0x00007ff7be686d60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x0000000101bc789c fp 0x00007ff7be686e80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000101bc7760 fp 0x00007ff7be686f30 dart::StubCode::Init()+0xc0
  pc 0x0000000101a44939 fp 0x00007ff7be687570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000101a44bef fp 0x00007ff7be687580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x00000001018b5e20 fp 0x00007ff7be6876c0 dart::bin::main(int, char**)+0x4a0
  pc 0x00000001018b6e29 fp 0x00007ff7be6876d0 main+0x9
  pc 0x00000001092594fe fp 0x00007ff7be6877e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3063 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (2 tries left)
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=3066, thread=259, isolate_group=vm-isolate(0x7fdefd814400), isolate=vm-isolate(0x7fdefd818a00)
isolate_instructions=104d26a80, vm_instructions=104d26a80
  pc 0x0000000104f8ea64 fp 0x00007ff7bb23cb90 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x0000000104d26c54 fp 0x00007ff7bb23cc70 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x0000000104f0e9c7 fp 0x00007ff7bb23ccc0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x0000000104f3ec21 fp 0x00007ff7bb23cd30 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x0000000104f3f011 fp 0x00007ff7bb23cd60 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010501189c fp 0x00007ff7bb23ce80 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000105011760 fp 0x00007ff7bb23cf30 dart::StubCode::Init()+0xc0
  pc 0x0000000104e8e939 fp 0x00007ff7bb23d570 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000104e8ebef fp 0x00007ff7bb23d580 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000104cffe20 fp 0x00007ff7bb23d6c0 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000104d00e29 fp 0x00007ff7bb23d6d0 main+0x9
  pc 0x000000010f4c54fe fp 0x00007ff7bb23d7e0 Unknown symbol
-- End of DumpStackTrace
/Users/dhs/documents/fluttersdk/flutter/bin/internal/shared.sh: line 20:  3066 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
Command 'pub upgrade' still failed after 10 tries, giving up.

This seems to be only happening on mac machine with intel-chip, as our colleagues with M1 chip confirmed that they didn't see such error while upgrading to master or while running any other flutter commands.

flutter upgrade on M1

mahesh@Maheshs-MacBook-Air-M1 newapp % flutterm upgrade
Upgrading Flutter to 3.1.0-0.0.pre.854 from 3.1.0-0.0.pre.799 in /Users/mahesh/Documents/flutter_master...
Downloading Darwin arm64 Dart SDK from Flutter engine 1bfe551d6b5adec64bb677cbb31ffd56c5acff49...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0  173M    0  4179    0     0   6841      0  7:22:29 --:--:--  7:22:29  6884
  3  173M    3 6446k    0     0  4262k      0  0:00:41  0:00:01  0:00:40 4275k
  8  173M    8 14.8M    0     0  6054k      0  0:00:29  0:00:02  0:00:27 6064k
 13  173M   13 23.5M    0     0  6873k      0  0:00:25  0:00:03  0:00:22 6882k
 18  173M   18 31.9M    0     0  7255k      0  0:00:24  0:00:04  0:00:20 7261k
 22  173M   22 39.1M    0     0  7275k      0  0:00:24  0:00:05  0:00:19 8179k
 26  173M   26 45.7M    0     0  7185k      0  0:00:24  0:00:06  0:00:18 8070k
 30  173M   30 52.9M    0     0  7215k      0  0:00:24  0:00:07  0:00:17 7798k
 35  173M   35 60.8M    0     0  7313k      0  0:00:24  0:00:08  0:00:16 7622k
 39  173M   39 68.5M    0     0  7376k      0  0:00:24  0:00:09  0:00:15 7488k
 43  173M   43 75.9M    0     0  7394k      0  0:00:23  0:00:10  0:00:13 7526k
 47  173M   47 82.4M    0     0  7332k      0  0:00:24  0:00:11  0:00:13 7524k
 52  173M   52 90.2M    0     0  7383k      0  0:00:24  0:00:12  0:00:12 7635k
 56  173M   56 97.8M    0     0  7417k      0  0:00:23  0:00:13  0:00:10 7593k
 60  173M   60  105M    0     0  7449k      0  0:00:23  0:00:14  0:00:09 7587k
 65  173M   65  113M    0     0  7466k      0  0:00:23  0:00:15  0:00:08 7617k
 68  173M   68  118M    0     0  7378k      0  0:00:24  0:00:16  0:00:08 7484k
 71  173M   71  123M    0     0  7220k      0  0:00:24  0:00:17  0:00:07 6812k
 75  173M   75  130M    0     0  7196k      0  0:00:24  0:00:18  0:00:06 6597k
 78  173M   78  136M    0     0  7176k      0  0:00:24  0:00:19  0:00:05 6385k
 83  173M   83  144M    0     0  7191k      0  0:00:24  0:00:20  0:00:04 6339k
 88  173M   88  152M    0     0  7257k      0  0:00:24  0:00:21  0:00:03 6854k
 92  173M   92  160M    0     0  7284k      0  0:00:24  0:00:22  0:00:02 7507k
 96  173M   96  167M    0     0  7305k      0  0:00:24  0:00:23  0:00:01 7708k
100  173M  100  173M    0     0  7290k      0  0:00:24  0:00:24 --:--:-- 7751k
Building flutter tool...
Upgrading engine...
Downloading android-arm-profile/darwin-x64 tools...              1,290ms
Downloading android-arm-release/darwin-x64 tools...                651ms
Downloading android-arm64-profile/darwin-x64 tools...              687ms
Downloading android-arm64-release/darwin-x64 tools...            1,993ms
Downloading android-x64-profile/darwin-x64 tools...                697ms
Downloading android-x64-release/darwin-x64 tools...                646ms
Downloading android-x86 tools...                                 1,931ms
Downloading android-x64 tools...                                 2,050ms
Downloading android-arm tools...                                 1,951ms
Downloading android-arm-profile tools...                         1,305ms
Downloading android-arm-release tools...                           900ms
Downloading android-arm64 tools...                               2,278ms
Downloading android-arm64-profile tools...                       1,568ms
Downloading android-arm64-release tools...                       1,257ms
Downloading android-x64-profile tools...                         1,372ms
Downloading android-x64-release tools...                         1,046ms
Downloading android-x86-jit-release tools...                     1,377ms
Downloading ios tools...                                            6.5s
Downloading ios-profile tools...                                    6.3s
Downloading ios-release tools...                                   19.6s
Downloading Web SDK...                                              5.5s
Downloading CanvasKit...                                         1,774ms
Downloading package sky_engine...                                  476ms
Downloading flutter_patched_sdk tools...                           763ms
Downloading flutter_patched_sdk_product tools...                   753ms
Downloading darwin-x64 tools...                                     4.0s
Downloading darwin-x64/FlutterMacOS.framework tools...              4.6s
Downloading darwin-x64/gen_snapshot tools...                       933ms
Downloading darwin-x64-profile/FlutterMacOS.framework tools...         3.4s
Downloading darwin-x64-profile tools...                            791ms
Downloading darwin-x64-profile/gen_snapshot tools...               992ms
Downloading darwin-x64-release/FlutterMacOS.framework tools...      2,591ms
Downloading darwin-x64-release tools...                            622ms
Downloading darwin-x64-release/gen_snapshot tools...               886ms
Downloading darwin-x64/font-subset tools...                        473ms
Flutter 3.1.0-0.0.pre.854 • channel master • https://github.com/flutter/flutter.git
Framework • revision ec20ea80ad (34 hours ago) • 2022-05-21 16:28:06 -0400
Engine • revision 1bfe551d6b
Tools • Dart 2.18.0 (build 2.18.0-142.0.dev) • DevTools 2.13.1
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
Could not load custom device from config index 0: Expected enabled to be a boolean.
[✓] Flutter (Channel master, 3.1.0-0.0.pre.854, on macOS 12.3 21E230 darwin-arm, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    ! CocoaPods 1.10.2 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
[✓] VS Code (version 1.66.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
mahesh@Maheshs-MacBook-Air-M1 newapp % flutterm doctor -v
Could not load custom device from config index 0: Expected enabled to be a boolean.
[✓] Flutter (Channel master, 3.1.0-0.0.pre.854, on macOS 12.3 21E230 darwin-arm, locale en-IN)
    • Flutter version 3.1.0-0.0.pre.854 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ec20ea80ad (34 hours ago), 2022-05-21 16:28:06 -0400
    • Engine revision 1bfe551d6b
    • Dart version 2.18.0 (build 2.18.0-142.0.dev)
    • DevTools version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! CocoaPods 1.10.2 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8
[✓] VS Code (version 1.66.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0
[✓] Connected device (3 available)
    • Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.3 21E230 darwin-arm
    • Chrome (web)           • chrome           • web-javascript • Google Chrome 101.0.4951.64
[✓] HTTP Host Availability
    • All required HTTP hosts are available
! Doctor found issues in 1 category.


@maheshmnj also confirmed the same works on Windows machine too properly.

flutter upgrade on windows machine

Microsoft Windows [Version 10.0.19044.1706]
(c) Microsoft Corporation. All rights reserved.
C:\Users\mahesh>flutterm upgrade
Upgrading Flutter to 3.1.0-0.0.pre.854 from 3.1.0-0.0.pre.825 in C:\flutter_sdk\master...
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 1bfe551d6b5adec64bb677cbb31ffd56c5acff49...
Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Upgrading engine...
Downloading android-arm-profile/windows-x64 tools...             2,319ms
Downloading android-arm-release/windows-x64 tools...               457ms
Downloading android-arm64-profile/windows-x64 tools...             456ms
Downloading android-arm64-release/windows-x64 tools...             608ms
Downloading android-x64-profile/windows-x64 tools...               419ms
Downloading android-x64-release/windows-x64 tools...             1,200ms
Downloading android-x86 tools...                                 2,329ms
Downloading android-x64 tools...                                 1,387ms
Downloading android-arm tools...                                 1,206ms
Downloading android-arm-profile tools...                           692ms
Downloading android-arm-release tools...                           376ms
Downloading android-arm64 tools...                               1,437ms
Downloading android-arm64-profile tools...                         717ms
Downloading android-arm64-release tools...                         454ms
Downloading android-x64-profile tools...                           717ms
Downloading android-x64-release tools...                           646ms
Downloading android-x86-jit-release tools...                       943ms
Downloading Web SDK...                                              3.5s
Downloading CanvasKit...                                         1,406ms
Downloading package sky_engine...                                  135ms
Downloading flutter_patched_sdk tools...                           291ms
Downloading flutter_patched_sdk_product tools...                   307ms
Downloading windows-x64 tools...                                    3.8s
Downloading windows-x64/windows-x64-flutter tools...                7.1s
Downloading windows-x64/flutter-cpp-client-wrapper tools...        361ms
Downloading windows-x64-profile/windows-x64-flutter tools...        12.3s
Downloading windows-x64-release/windows-x64-flutter tools...         7.2s
Downloading windows-x64/font-subset tools...                       412ms
Flutter 3.1.0-0.0.pre.854 • channel master • https://github.com/flutter/flutter.git
Framework • revision ec20ea80ad (28 hours ago) • 2022-05-21 16:28:06 -0400
Engine • revision 1bfe551d6b
Tools • Dart 2.18.0 (build 2.18.0-142.0.dev) • DevTools 2.13.1
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.1.0-0.0.pre.854, on Microsoft Windows [Version 10.0.19044.1706], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.64.2)
[√] Connected device (3 available)
[√] HTTP Host Availability
• No issues found!
C:\Users\mahesh>flutterm doctor -v
[√] Flutter (Channel master, 3.1.0-0.0.pre.854, on Microsoft Windows [Version 10.0.19044.1706], locale en-IN)
    • Flutter version 3.1.0-0.0.pre.854 at C:\flutter_sdk\master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ec20ea80ad (28 hours ago), 2022-05-21 16:28:06 -0400
    • Engine revision 1bfe551d6b
    • Dart version 2.18.0 (build 2.18.0-142.0.dev)
    • DevTools version 2.13.1
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\mahesh\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.
[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31727.386
    • Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[√] VS Code (version 1.64.2)
    • VS Code at C:\Users\mahesh\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.40.0
[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1706]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 101.0.4951.67
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 100.0.1185.50
[√] HTTP Host Availability
    • All required HTTP hosts are available
• No issues found!
C:\Users\mahesh>

@darshankawar darshankawar added in triage Presently being triaged by the triage team tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically engine flutter/engine repository. See also e: labels. dependency: dart Dart team may need to help us c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels May 23, 2022
@darshankawar
Copy link
Member Author

/cc @mraleph

@darshankawar darshankawar added perf: memory Performance issues related to memory has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.1 Found to occur in 3.1 labels May 23, 2022
@mraleph
Copy link
Member

mraleph commented May 23, 2022

@darshankawar could you try bisecting the git history to see which commit caused this?

/cc @rmacnak-google fyi

@darshankawar
Copy link
Member Author

could you try bisecting the git history to see which commit caused this?

I tried bisecting it and it seem to point to #101006 but I am not sure if that' the correct bisect.

@Theunodb
Copy link

Here is the complete error

Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=7107, thread=259, isolate_group=vm-isolate(0x7f8f5b008a00), isolate=vm-isolate(0x7f8f5b00d600)
isolate_instructions=1054aca80, vm_instructions=1054aca80
  pc 0x0000000105714a64 fp 0x00007ff7baab6bb0 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x00000001054acc54 fp 0x00007ff7baab6c90 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001056949c7 fp 0x00007ff7baab6ce0 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x00000001056c4c21 fp 0x00007ff7baab6d50 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x00000001056c5011 fp 0x00007ff7baab6d80 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010579789c fp 0x00007ff7baab6ea0 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x0000000105797760 fp 0x00007ff7baab6f50 dart::StubCode::Init()+0xc0
  pc 0x0000000105614939 fp 0x00007ff7baab7590 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x0000000105614bef fp 0x00007ff7baab75a0 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000105485e20 fp 0x00007ff7baab76e0 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000105486e29 fp 0x00007ff7baab76f0 main+0x9
  pc 0x000000010d4a751e fp 0x00007ff7baab7800 Unknown symbol
-- End of DumpStackTrace
/Users/theunodebruin/flutter/bin/internal/shared.sh: line 20:  7107 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
Command 'pub upgrade' still failed after 10 tries, giving up.

@sma
Copy link

sma commented May 23, 2022

I got that error, too. Perhaps the version information from the first line is helpful:

$ flutter upgrade
Upgrading Flutter to 3.1.0-0.0.pre.854 from 3.1.0-0.0.pre.745 in
/Users/sma/Work/flutter...
Downloading Darwin x64 Dart SDK from Flutter engine 1bfe551d6b5adec64bb677cbb31ffd56c5acff49...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  1  188M    1 2526k    0     0  4206k      0  0:00:45 --:--:--  0:00:45 4275k
  5  188M    5 9774k    0     0  6091k      0  0:00:31  0:00:01  0:00:30 6128k
  9  188M    9 17.0M    0     0  6704k      0  0:00:28  0:00:02  0:00:26 6730k
...
Building flutter tool...
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2717: error: Out of memory.
version=2.18.0-142.0.dev (dev) (Sat May 21 02:57:16 2022 -0700) on "macos_x64"
pid=84609, thread=259, isolate_group=vm-isolate(0x7fc621812000), isolate=vm-isolate(0x7fc621816600)
isolate_instructions=10218fa80, vm_instructions=10218fa80
  pc 0x00000001023f7a64 fp 0x00007ff7bddd3c00 dart::Profiler::DumpStackTrace(void*)+0x64
  pc 0x000000010218fc54 fp 0x00007ff7bddd3ce0 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x00000001023779c7 fp 0x00007ff7bddd3d30 dart::Object::Allocate(long, long, dart::Heap::Space, bool)+0x117
  pc 0x00000001023a7c21 fp 0x00007ff7bddd3da0 dart::Code::FinalizeCode(dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0xb1
  pc 0x00000001023a8011 fp 0x00007ff7bddd3dd0 dart::Code::FinalizeCodeAndNotify(char const*, dart::FlowGraphCompiler*, dart::compiler::Assembler*, dart::Code::PoolAttachment, bool, dart::CodeStatistics*)+0x21
  pc 0x000000010247a89c fp 0x00007ff7bddd3ef0 dart::StubCode::Generate(char const*, dart::compiler::ObjectPoolBuilder*, void (*)(dart::compiler::Assembler*))+0xbc
  pc 0x000000010247a760 fp 0x00007ff7bddd3fa0 dart::StubCode::Init()+0xc0
  pc 0x00000001022f7939 fp 0x00007ff7bddd45e0 dart::Dart::DartInit(Dart_InitializeParams const*)+0x4a9
  pc 0x00000001022f7bef fp 0x00007ff7bddd45f0 dart::Dart::Init(Dart_InitializeParams const*)+0x1f
  pc 0x0000000102168e20 fp 0x00007ff7bddd4730 dart::bin::main(int, char**)+0x4a0
  pc 0x0000000102169e29 fp 0x00007ff7bddd4740 main+0x9
  pc 0x000000010b58d51e fp 0x00007ff7bddd4850 Unknown symbol
-- End of DumpStackTrace
/Users/sma/Work/flutter/bin/internal/shared.sh: line 20: 84609 Abort trap: 6           "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile

My installation is completely broken now.

@mraleph
Copy link
Member

mraleph commented May 23, 2022

I have checked the dart binary. The change here is that it became signed but it did not get proper entitlements (dart binary needs com.apple.security.cs.allow-jit to function properly).

Workaround: if your installation is broken you can unbreak it by either checking out b8b0c80 (or earlier) or by stripping the signature via codesign --remove-signature bin/cache/dart-sdk/bin/dart

AFAIK the breakage started from ec20ea8 - but I don't think it is the roll itself that broke things. The must have been some change in the configuration that handles signing that caused this.

/cc @jmagman @godofredoc @athomas for visibility

@sma
Copy link

sma commented May 23, 2022

Removing the signature did indeed help. flutter doctor -v works as it should. Thank you very much.

@mraleph
Copy link
Member

mraleph commented May 23, 2022

I have identified the change to the internal recipes that likely caused this and notified the author.

@godofredoc
Copy link
Contributor

Let's revert it but the reason for the breakage may be different. https://flutter-review.googlesource.com/c/recipes/+/30202 is only adding new dependencies which run at packaging time as the last step of the release process.

@godofredoc
Copy link
Contributor

On 05/17 we started using dart artifacts from CIPD packages maybe something different on cipd compared to the GCS bundles? flutter/engine@051eee8

@christopherfujino
Copy link
Member

On 05/17 we started using dart artifacts from CIPD packages maybe something different on cipd compared to the GCS bundles? flutter/engine@051eee8

Let me take a look at if that is the cause...

@christopherfujino christopherfujino self-assigned this May 23, 2022
@dnfield dnfield added P0 Critical issues such as a build break or regression a: first hour The first hour of using Flutter labels May 23, 2022
@dnfield
Copy link
Contributor

dnfield commented May 23, 2022

Marking P0.

@christopherfujino
Copy link
Member

Hmm, I can't reproduce this at flutter/engine@051eee8, I'll have to bisect further

@christopherfujino
Copy link
Member

Lemme see if I can reproduce:

#104387 (comment)

@christopherfujino
Copy link
Member

Hmm, The tool compiles fine at #101006. Which makes me think this is flaky and not consistently failing...

@christopherfujino
Copy link
Member

Ok, I merged my engine revert; I will monitor post-submits and manually roll to the framework if we're all green

@XilaiZhang
Copy link
Contributor

cc @XilaiZhang

@dnfield
Copy link
Contributor

dnfield commented May 23, 2022

I'm not sure if this fully explains it, but it looks like this passed on bots running macOS 12.0.1, but failed on bots running 12.2. I'm seeing failures on macOS 12.4.

christopherfujino added a commit to christopherfujino/flutter that referenced this issue May 23, 2022
Manual engine roll to work around flutter#104387

d882b2d Revert "Use CIPD to download prebuilt Dart SDKs (flutter#33345)" (flutter#33558)
4bff087 Roll Skia from d3cbea4114aa to 86323276b2fc (4 revisions) (flutter#33556)
80b183e [Windows] Add textScaleFactor support (flutter#33316)
9388aa1 Roll Fuchsia Mac SDK from SmBoqSpQQ... to 1URI3xQBh... (flutter#33554)
98be801 Roll Fuchsia Linux SDK from t9KwJZBWT... to KG9Y2q6J-... (flutter#33553)
0c591bf Roll Skia from fb7f03aeac6e to d3cbea4114aa (1 revision) (flutter#33550)
945cb27 reduce the number of dependencies declared by flutter_frontend_server (flutter#33520)
76137e8 Roll Fuchsia Mac SDK from yKCDVbBgS... to SmBoqSpQQ... (flutter#33542)
dc49d18 Roll Fuchsia Linux SDK from 3mdV9nX-U... to t9KwJZBWT... (flutter#33541)
6a4c45a Roll Dart SDK from d3e96bbc3d87 to 7fa990079a0a (1 revision) (flutter#33540)
5a3a0c1 Roll Skia from ade84dfd2ba5 to fb7f03aeac6e (1 revision) (flutter#33539)
4db98a0 Roll Fuchsia Mac SDK from 1QcM2qaSN... to yKCDVbBgS... (flutter#33538)
f13d03c Roll Dart SDK from 708801716094 to d3e96bbc3d87 (1 revision) (flutter#33537)
2d3affd Roll Fuchsia Linux SDK from asLtG1Pbw... to 3mdV9nX-U... (flutter#33536)
dfa4724 Roll Dart SDK from 90d5fdb9368b to 708801716094 (1 revision) (flutter#33534)
@christopherfujino
Copy link
Member

Manual engine roll of my revert out for review: #104431

@mraleph
Copy link
Member

mraleph commented May 23, 2022

It's pretty mysterious. If I download SDK from cloud storage, I get signed dart binary:

$ gsutil.py cp gs://flutter_infra_release/flutter/1bfe551d6b5adec64bb677cbb31ffd56c5acff49/dart-sdk-darwin-x64.zip .
$ unzip dart-sdk-darwin-x64.zip
$ otool -l dart-sdk/bin/dart | grep -A2 LC_UU
     cmd LC_UUID
 cmdsize 24
    uuid 1E5DE27B-F121-3585-94C4-00E40C5BBF08
$ codesign -dv dart-sdk/bin/dart
Executable=/Users/vegorov/dart-sdk/bin/dart
Identifier=dart
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=304080 flags=0x10000(runtime) hashes=9497+2 location=embedded
Signature size=8978
Timestamp=22 May 2022 at 02.08.42
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=11.1.0
Sealed Resources=none
Internal requirements count=1 size=164

If I download the binary from CIPD then I get unsigned binary (and it's the very same binary!):

$ cat ensure_file
flutter/dart-sdk/mac-amd64 PAS9kiLp-LpB4gbORggYeSJMFUan4cd2Dr3ZmraJZlwC
$ cipd ensure -root sdk_root -ensure-file ensure_file
$ otool -l sdk_root/bin/dart | grep -A3 LC_UU
     cmd LC_UUID
 cmdsize 24
    uuid 1E5DE27B-F121-3585-94C4-00E40C5BBF08
$ codesign -dv sdk_root/bin/dart
sdk_root/bin/dart: code object is not signed at all

Also when I look at other (subsequent) engine builds they seem to be fine. So we don't have to actually revert anything. I wonder if somebody run some testing script and replaced an SDK build in the bucket?

@christopherfujino
Copy link
Member

It's pretty mysterious. If I download SDK from cloud storage, I get signed dart binary:

$ gsutil.py cp gs://flutter_infra_release/flutter/1bfe551d6b5adec64bb677cbb31ffd56c5acff49/dart-sdk-darwin-x64.zip .
$ unzip dart-sdk-darwin-x64.zip
$ otool -l dart-sdk/bin/dart | grep -A2 LC_UU
     cmd LC_UUID
 cmdsize 24
    uuid 1E5DE27B-F121-3585-94C4-00E40C5BBF08
$ codesign -dv dart-sdk/bin/dart
Executable=/Users/vegorov/dart-sdk/bin/dart
Identifier=dart
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=304080 flags=0x10000(runtime) hashes=9497+2 location=embedded
Signature size=8978
Timestamp=22 May 2022 at 02.08.42
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=11.1.0
Sealed Resources=none
Internal requirements count=1 size=164

If I download the binary from CIPD then I get unsigned binary (and it's the very same binary!):

$ cat ensure_file
flutter/dart-sdk/mac-amd64 PAS9kiLp-LpB4gbORggYeSJMFUan4cd2Dr3ZmraJZlwC
$ cipd ensure -root sdk_root -ensure-file ensure_file
$ otool -l sdk_root/bin/dart | grep -A3 LC_UU
     cmd LC_UUID
 cmdsize 24
    uuid 1E5DE27B-F121-3585-94C4-00E40C5BBF08
$ codesign -dv sdk_root/bin/dart
sdk_root/bin/dart: code object is not signed at all

Also when I look at other (subsequent) engine builds they seem to be fine. So we don't have to actually revert anything. I wonder if somebody run some testing script and replaced an SDK build in the bucket?

Wow, I assumed the asset CIPD was downloading had gotten retroactively codesigned, but if CIPD still yields the unsigned binary...I'm really confused.

@athomas
Copy link
Contributor

athomas commented May 23, 2022

It's pretty mysterious. If I download SDK from cloud storage, I get signed dart binary:

Isn't cloud storage where the signed binaries live?

If I download the binary from CIPD then I get unsigned binary (and it's the very same binary!):

CIPD is content addressed storage, if something modifies the package it gets a different hash. The Dart binaries on flutter's CIPD namespace are unsigned.

Also when I look at other (subsequent) engine builds they seem to be fine. So we don't have to actually revert anything. I wonder if somebody run some testing script and replaced an SDK build in the bucket?

Wow, I assumed the asset CIPD was downloading had gotten retroactively codesigned, but if CIPD still yields the unsigned binary...I'm really confused.

@christopherfujino
Copy link
Member

christopherfujino commented May 23, 2022

Yeah, so it looks like this was signed on the Flutter side:

~/git/flutter$ codesign -dvvv bin/cache/dart-sdk/bin/dart
Executable=/Users/fujino/git/flutter/bin/cache/dart-sdk/bin/dart
Identifier=dart
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=304080 flags=0x10000(runtime) hashes=9497+2 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=dd48875c982173b0c3ad923798da5c292a16ba5e
CandidateCDHashFull sha256=dd48875c982173b0c3ad923798da5c292a16ba5ee8bef5c0d9b856a9f9324031
Hash choices=sha256
CMSDigest=dd48875c982173b0c3ad923798da5c292a16ba5ee8bef5c0d9b856a9f9324031
CMSDigestType=2
CDHash=dd48875c982173b0c3ad923798da5c292a16ba5e
Signature size=8978
Authority=Developer ID Application: FLUTTER.IO LLC (S8QB4VV633)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=May 21, 2022 at 5:08:42 PM
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=11.1.0
Sealed Resources=none
Internal requirements count=1 size=164

cc @XilaiZhang

@mraleph
Copy link
Member

mraleph commented May 23, 2022

@athomas These ones are not supposed to be signed IIRC, at least not yet. If I download a different build it is unsigned (e.g. dfa4724 is the next engine build and it is unsigned). So I'd say it is unexpected that this particular SDK build is signed. It's supposed to be just a copy of Dart SDK build, but it is somehow got signed with Flutter's certificates. And we can't find the place in the code where it happened. Nothing in https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20Host%20Engine/16012/overview indicates there was any signing steps.

@mraleph
Copy link
Member

mraleph commented May 23, 2022

Does Flutter have cloud storage audit logs enabled? We could look at that to figure out if something overwrote the engine build by accident.

@christopherfujino
Copy link
Member

christopherfujino commented May 23, 2022

@athomas These ones are not supposed to be signed IIRC, at least not yet. If I download a different build it is unsigned (e.g. dfa4724 is the next engine build and it is unsigned). So I'd say it is unexpected that this particular SDK build is signed. It's supposed to be just a copy of Dart SDK build, but it is somehow got signed with Flutter's certificates. And we can't find the place in the code where it happened. Nothing in https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20Host%20Engine/16012/overview indicates there was any signing steps.

I believe this was, as you suspected, a manual test that was run on production binaries incorrectly. And I think you're right, we didn't need a revert.

@christopherfujino
Copy link
Member

I will continue to investigate to confirm how these binaries got signed.

However, to unblock the Framework tree, I think I will still land #104431, since it has unsigned binaries.

Once I can verify how these were getting signed and guarantee no future binaries will be codesigned, I will unroll my revert (or re-land Zach's change).

I'm also working on a retrospective doc which I will share with interested parties.

christopherfujino added a commit that referenced this issue May 23, 2022
Manual engine roll to work around #104387

d882b2d Revert "Use CIPD to download prebuilt Dart SDKs (#33345)" (#33558)
4bff087 Roll Skia from d3cbea4114aa to 86323276b2fc (4 revisions) (#33556)
80b183e [Windows] Add textScaleFactor support (#33316)
9388aa1 Roll Fuchsia Mac SDK from SmBoqSpQQ... to 1URI3xQBh... (#33554)
98be801 Roll Fuchsia Linux SDK from t9KwJZBWT... to KG9Y2q6J-... (#33553)
0c591bf Roll Skia from fb7f03aeac6e to d3cbea4114aa (1 revision) (#33550)
945cb27 reduce the number of dependencies declared by flutter_frontend_server (#33520)
76137e8 Roll Fuchsia Mac SDK from yKCDVbBgS... to SmBoqSpQQ... (#33542)
dc49d18 Roll Fuchsia Linux SDK from 3mdV9nX-U... to t9KwJZBWT... (#33541)
6a4c45a Roll Dart SDK from d3e96bbc3d87 to 7fa990079a0a (1 revision) (#33540)
5a3a0c1 Roll Skia from ade84dfd2ba5 to fb7f03aeac6e (1 revision) (#33539)
4db98a0 Roll Fuchsia Mac SDK from 1QcM2qaSN... to yKCDVbBgS... (#33538)
f13d03c Roll Dart SDK from 708801716094 to d3e96bbc3d87 (1 revision) (#33537)
2d3affd Roll Fuchsia Linux SDK from asLtG1Pbw... to 3mdV9nX-U... (#33536)
dfa4724 Roll Dart SDK from 90d5fdb9368b to 708801716094 (1 revision) (#33534)
@christopherfujino
Copy link
Member

We should be in a good state as of 0015ed2

@dnfield
Copy link
Contributor

dnfield commented May 23, 2022

@christopherfujino should we lower the priority on this now?

Based on offline conversation it sounds like there's a bit of work to do around auditing the GCS bucket and fixing some potential bugs in the way entitlements were getting added to the dart binary, but that we're otherwise in the clear now?

@christopherfujino
Copy link
Member

I will continue to investigate to confirm how these binaries got signed.

I can confirm that manually testing the codesign script accidentally and incorrectly codesigned production binaries. This has been addressed, so I think moving forward we are in a good state. I will close this bug now and link the follow up retrospective action item issues.

@XilaiZhang
Copy link
Contributor

Really sorry for the havoc caused, I was testing an unfinished code signing script and caused erroneous binaries to be uploaded. The 4 engine hashes I used for testing were 1bfe551, fce741d, eba6dba, 7bde72a. Those 4 binaries could cause problems since they were not correctly code signed. Thanks a ton everyone for quickly detecting the problem! I will follow #104450 and make sure bad testings never happen again. My bad, very very sincere apologies.

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: first hour The first hour of using Flutter c: crash Stack traces logged to the console dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P0 Critical issues such as a build break or regression perf: memory Performance issues related to memory platform-mac Building on or for macOS specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

9 participants