Closed Bug 2084876 Opened 29 days ago Closed 14 days ago

[clang-23] Perma /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(114,25): error: '__try' is not permitted in functions that require object unwinding

Categories

(Toolkit :: Application Update, defect, P5)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: RyanVM)

References

(Blocks 1 open bug)

Details

Attachments

(2 external files)

Filed by: mh [at] glandium.org
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=601775840&repo=try&task=J8tFc3naSZayMtf0HXKqOw.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/J8tFc3naSZayMtf0HXKqOw/runs/0/artifacts/public/logs/live_backing.log


[task 2026-10-22T05:25:26.458+00:00] 05:25:26    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(114,25): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:26.458+00:00] 05:25:26     INFO -    114 |   ExceptionFilterHelper exception_filter_helper;
[task 2026-10-22T05:25:26.458+00:00] 05:25:26     INFO -        |                         ^
[task 2026-10-22T05:25:26.459+00:00] 05:25:26    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(117,22): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:26.459+00:00] 05:25:26     INFO -    117 |     MappedFileReader mapped_patch(std::move(patch_file));
[task 2026-10-22T05:25:26.459+00:00] 05:25:26     INFO -        |                      ^
[task 2026-10-22T05:25:26.459+00:00] 05:25:26    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(128,10): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:26.459+00:00] 05:25:26     INFO -    128 |     auto patch_reader = EnsemblePatchReader::Create(mapped_patch.region());
[task 2026-10-22T05:25:26.460+00:00] 05:25:26     INFO -        |          ^
[task 2026-10-22T05:25:26.460+00:00] 05:25:26    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(134,22): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:26.460+00:00] 05:25:26     INFO -    134 |     MappedFileReader mapped_old(std::move(old_file));
[task 2026-10-22T05:25:26.460+00:00] 05:25:26     INFO -        |                      ^
[task 2026-10-22T05:25:26.461+00:00] 05:25:26    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/chromium/components/zucchini/zucchini_integration.cc(147,22): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:26.461+00:00] 05:25:26     INFO -    147 |     MappedFileWriter mapped_new(names.new_name, std::move(new_file),
[task 2026-10-22T05:25:26.461+00:00] 05:25:26     INFO -        |                      ^
[task 2026-10-22T05:25:26.461+00:00] 05:25:26     INFO -  5 errors generated.
[task 2026-10-22T05:25:27.710+00:00] 05:25:27    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/moz_zucchini.cc(196,14): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:27.710+00:00] 05:25:27     INFO -    196 |   base::File patchFile = base::FILEToFile(aPatchFile);
[task 2026-10-22T05:25:27.710+00:00] 05:25:27     INFO -        |              ^
[task 2026-10-22T05:25:27.711+00:00] 05:25:27    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/moz_zucchini.cc(277,14): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:27.711+00:00] 05:25:27     INFO -    277 |   base::File newFile = base::FILEToFile(aNewFile);
[task 2026-10-22T05:25:27.711+00:00] 05:25:27     INFO -        |              ^
[task 2026-10-22T05:25:27.711+00:00] 05:25:27    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/moz_zucchini.cc(285,18): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:27.712+00:00] 05:25:27     INFO -    285 |   base::FilePath name;
[task 2026-10-22T05:25:27.712+00:00] 05:25:27     INFO -        |                  ^
[task 2026-10-22T05:25:27.712+00:00] 05:25:27    ERROR -  /builds/worker/checkouts/gecko/third_party/zucchini/moz_zucchini.cc(287,20): error: '__try' is not permitted in functions that require object unwinding
[task 2026-10-22T05:25:27.712+00:00] 05:25:27     INFO -    287 |   MappedFileWriter mappedNew(name, std::move(newFile), header.new_size,
[task 2026-10-22T05:25:27.713+00:00] 05:25:27     INFO -        |                    ^
[task 2026-10-22T05:25:27.713+00:00] 05:25:27     INFO -  4 errors generated.
Blocks: clang-23
Flags: needinfo?(yjuglaret)

clang 23 now enforces the MSVC C2712 rule: when C++ exceptions are enabled, __try is rejected in any function whose locals need destructors run on unwind. That includes temporaries such as the LOG(ERROR) streams in the __try and __except bodies. Upstream Chromium builds zucchini without exceptions, so it never hits this. We enable /EHs /GR in third_party/zucchini/moz.build so that the updater can turn std::bad_alloc into an out-of-memory status, which makes every __try in that library fail with clang 23.

There are three affected functions:

  • MappedPatch::LoadImpl in moz_zucchini.cc
  • MappedPatch::ApplyUnsafeImpl in moz_zucchini.cc
  • ApplyCommon in zucchini_integration.cc, which this log shows

ApplyCommon is only reached through zucchini::Apply, which only the zucchini command-line tool calls from zucchini_commands.cc. Building zucchini_integration.cc as part of the executable instead of the library compiles it without exceptions, as upstream does, so it needs no source change. The two moz_zucchini.cc functions are on the updater's path, so the guarded code would have to move into a lambda called from a helper that holds only the __try, with the __except logging done in a separate function. The behavior on an in-page error (kStatusDiskFull or kStatusIoError) stays the same.

MOZ_NEUTER_SEH_FOR_MINGWCLANG isn't an option for the clang-cl builds. It removes the handler entirely, so an in-page error would crash the updater instead of returning a status.

zucchini is built with C++ exceptions enabled, and like MSVC, clang 23 rejects __try in any function that
needs object unwinding in that mode. The guarded code now runs in a lambda called from a helper that holds
only the __try, and the __except block logs through a separate function.

Only the zucchini executable uses zucchini::Apply. Outside of the library it builds without C++ exceptions, as
upstream does, which keeps the __try in ApplyCommon valid with clang 23.

Assignee: nobody → ryanvm
Attachment #9668328 - Attachment description: WIP: Bug 2084876 - Run the zucchini page error handlers in functions that need no object unwinding. → Bug 2084876 - Run the zucchini page error handlers in functions that need no object unwinding. r?yjuglaret
Status: NEW → ASSIGNED
Attachment #9668329 - Attachment description: WIP: Bug 2084876 - Build zucchini_integration.cc as part of the zucchini executable. → Bug 2084876 - Build zucchini_integration.cc as part of the zucchini executable. r?yjuglaret
Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ac5bdf02a558 https://hg.mozilla.org/integration/autoland/rev/bc51033d6650 Run the zucchini page error handlers in functions that need no object unwinding. r=yjuglaret,application-update-reviewers https://github.com/mozilla-firefox/firefox/commit/d9bfb5b3fc1f https://hg.mozilla.org/integration/autoland/rev/8fdd2dcd5de2 Build zucchini_integration.cc as part of the zucchini executable. r=yjuglaret
Flags: needinfo?(yjuglaret)
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: