Skip to content

codesigning errors on mac m1 bots #49275

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

Closed
aam opened this issue Jun 16, 2022 · 12 comments
Closed

codesigning errors on mac m1 bots #49275

aam opened this issue Jun 16, 2022 · 12 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-duplicate Closed in favor of an existing report gardening

Comments

@aam
Copy link
Contributor

aam commented Jun 16, 2022

pkg/_fe_analyzer_shared/test/macros/executor/executor_test
pkg/dartdev/test/commands/compile_test
pkg/vm_snapshot_analysis/test/precompiler_trace_test

fail with codesigning errors on mac m1 bots

From log:

--- Command "vm" (took 08.000258s):
DART_CONFIGURATION=ReleaseARM64 CHROME_PATH="/opt/s/w/ir/cache/builder/sdk/third_party/browsers/chrome/Google Chrome.app/Contents/MacOS/Google Chrome" xcodebuild/ReleaseARM64/dart-sdk/bin/dart --enable_asserts -Dtest_runner.configuration=unittest-asserts-release-mac-arm64 --ignore-unrecognized-flags --packages=/opt/s/w/ir/cache/builder/sdk/.dart_tool/package_config.json /opt/s/w/ir/cache/builder/sdk/pkg/vm_snapshot_analysis/test/precompiler_trace_test.dart

exit code:
255

stdout:
00:00 �[32m+0�[0m: precompiler-trace basic-parsing�[0m

00:01 �[32m+0�[0m�[31m -1�[0m: precompiler-trace basic-parsing �[1m�[31m[E]�[0m�[0m

  Expected: <0>
    Actual: <64>
  Compilation completed with exit code 64.
  
  Command line: /opt/s/w/ir/cache/builder/sdk/xcodebuild/ReleaseARM64/dart-sdk/bin/dart compile exe -o /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe --packages=/opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/.packages --extra-gen-snapshot-options=--dwarf-stack-traces,--trace_precompiler_to=/opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/sizes.json /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/main.dart
  
  stdout: Info: Compiling without sound null safety
  Failed to add a linker signed signature, adding a regular signature instead.
  Failed to replace the dartaotruntime signature, 
  subcommand terminated with exit code 1.
  Subcommand stderr:
  /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe: replacing existing signature
  /opt/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: object: /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe malformed object (offset field of section 0 in LC_SEGMENT command 1 not past the headers of the file)
  /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe: the codesign_allocate helper tool cannot be found or used
  
  
  stderr: Error: AOT compilation failed
  Could not sign the new executable
@aam aam added the gardening label Jun 16, 2022
@devoncarew devoncarew added the area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes. label Jun 16, 2022
@athomas athomas added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. and removed area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes. labels Jun 16, 2022
@athomas
Copy link
Member

athomas commented Jun 16, 2022

I see this message saying that output.exe is malformed? Isn't that a VM issue?

  /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe: replacing existing signature
  /opt/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: object: /opt/s/w/ir/x/t/instruction-sizes-test-lG5VgV/output.exe malformed object (offset field of section 0 in LC_SEGMENT command 1 not past the headers of the file)

@aam
Copy link
Contributor Author

aam commented Jun 16, 2022

I see this message saying that output.exe is malformed? Isn't that a VM issue?

It seems unlikely as it started to fail on seemingly unrelated change.
Were there any changes to xcode toolchain on the bots done recently?

@aam
Copy link
Contributor Author

aam commented Jun 16, 2022

cc @sstrickl who might have more context for codesigning potential source of failures.

@athomas
Copy link
Member

athomas commented Jun 16, 2022

No, same version of xcode installed on failing and passing builds. Also, it recovered on a later commit.

@aam
Copy link
Contributor Author

aam commented Jun 16, 2022

No, same version of xcode installed on failing and passing builds. Also, it recovered on a later commit.

I don't think it did - _fe_analyzer_shared/test/macros/executor/executor_test is still RuntimeError according to results.json. I just approved those failure, which turned the bot green.

@athomas
Copy link
Member

athomas commented Jun 16, 2022

Ah sorry.

@aam
Copy link
Contributor Author

aam commented Jun 16, 2022

@aam
Copy link
Contributor Author

aam commented Jun 27, 2022

@sstrickl
Copy link
Contributor

sstrickl commented Jul 1, 2022

Taking a look now.

@sstrickl
Copy link
Contributor

sstrickl commented Jul 1, 2022

So unfortunately the log output is nearly useless for figuring out why there was a failure (going to make a small CL to make that better), but on my local M1 laptop these seem to be working a-ok, so I'm going to have to try things out on the trybots themselves.

@sstrickl
Copy link
Contributor

sstrickl commented Jul 1, 2022

(Just realized that the first log in the issue does have the extra info I'm interested in, so yeah, will have to dig into why it's thinking the Mach-O file is malformed on the trybots, especially since I'm not getting this error locally 🤔)

copybara-service bot pushed a commit that referenced this issue Jul 1, 2022
When signing a MachO executable fails, print all the diagnostics
to stderr instead of stdout before throwing.

Change-Id: I10cef830f2e1a548250685fbccaf5c9dae63877e
Bug: #49275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250383
Reviewed-by: Daco Harkes <[email protected]>
Commit-Queue: Tess Strickland <[email protected]>
@athomas athomas assigned sstrickl and unassigned athomas Aug 24, 2022
copybara-service bot pushed a commit that referenced this issue Aug 24, 2022
  This reverts commit fef426a
  This reverts commit e9f629f
  This reverts commit 413f60a

Reason for revert: With newer clang toolchain for MachOS, the produced
MachO binaries (e.g. `dartaotruntime`) can no longer be signed with
`codesign` on older MacOS versions (before MacOS 12).

We will report this breaking change to fuchsia-clang team and revert
to older (working) clang in the meantime to unblock releases.

Issue #49275

Tested: ci
Co-authored-by: Martin Kustermann <[email protected]>
Change-Id: I0d4fa6617df2908c4af31e102f5faf9e3ea1df95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256208
Reviewed-by: Alexander Thomas <[email protected]>
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Reviewed-by: Tess Strickland <[email protected]>
@a-siva a-siva added the closed-duplicate Closed in favor of an existing report label Aug 24, 2022
@a-siva
Copy link
Contributor

a-siva commented Aug 24, 2022

Marking this as a duplicate of #49783

@a-siva a-siva closed this as completed Aug 24, 2022
copybara-service bot pushed a commit that referenced this issue Aug 25, 2022
  This reverts commit fef426a
  This reverts commit e9f629f
  This reverts commit 413f60a

Reason for revert: With newer clang toolchain for MachOS, the produced
MachO binaries (e.g. `dartaotruntime`) can no longer be signed with
`codesign` on older MacOS versions (before MacOS 12).

We will report this breaking change to fuchsia-clang team and revert
to older (working) clang in the meantime to unblock releases.

Issue #49275

Tested: ci
Co-authored-by: Martin Kustermann <[email protected]>
Change-Id: I0d4fa6617df2908c4af31e102f5faf9e3ea1df95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256208
Reviewed-by: Alexander Thomas <[email protected]>
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Reviewed-by: Tess Strickland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-duplicate Closed in favor of an existing report gardening
Projects
None yet
Development

No branches or pull requests

5 participants